AI User-Defined Model Discovery
vApplies to: Studio. User-Defined Model Discovery runs under Claude Code (tested candidates) or Codex CLI (untested proposals); Predictive Linear Model (GLM) Discovery requires Claude Code. In TableCurve 2D and TableCurve 3D the AI window offers only Copy for ChatGPT / Claude.ai.
AI User-Defined Model Discovery
The AI Guidance window (see AI Model Selection Guidance [JUMP]) normally recommends one of the models the Review has already fitted. Two further requests in its Ask menu go beyond the catalogue. The first asks the advisor to search for a model the catalogue does not contain and to test what it finds against your data with TableCurve's own fitting engine. The second asks it to design a predictive linear model from basis functions and to fit every combination of them with TableCurve's full-permutation GLM. Both are advanced features: they take longer than a model selection, they write files to your computer, and they put the whole fitting engine at the advisor's disposal.
How the advisor reaches the engine
Beside the TableCurve program sits a small helper, tc9mcp.exe, that exposes a handful of named engine operations to Claude Code: evaluate an expression over the data, fit one user-defined function to a curve or a surface, fit the catalogue families to a curve, slice a surface into profiles and fit each, build a basis matrix, and run a GLM over it. The advisor calls these operations by name while it thinks, exactly as it would call a calculator, and reads back the fit statistics. It cannot run any other program and has no command shell. Every call is logged (see Files below). This is why Claude Code is required for tested discovery: Codex CLI has no access to these operations.
Each operation has a time limit, so a runaway candidate cannot hold the advisor indefinitely. Nothing the advisor does through the helper touches the fit in the Review; its models live in their own folder until you load one.
+ User-Defined Model Discovery
Ask | + User-Defined Model Discovery begins with a full model selection and then continues: the advisor proposes composite forms, mechanism models from the literature of your field, compositions of known shapes, and reparameterisations of catalogue models that fit badly, and it tests every candidate against your data before it speaks. For a curve it fits the candidate with the same Levenberg-Marquardt engine the program uses, with the program's starting estimates for peak, transition and kinetic shapes; for a surface it fits the candidate as a function of x and y, or slices the surface into profiles, fits each profile, and reads how the profile parameters drift with the second variable. It reads back rē, the standard error, AICc and the fitted parameters, and recommends only what it has tested, ranked against the best catalogue model by the same parsimony rules as a model selection.
Each candidate is written as a user-defined function file, C:\TableCurve\AI\Models\name.udf, in the same format Fit | User Defined Functions [JUMP] reads and writes. Load the one you want from there to fit it in the program, review it, graph it and generate code from it; the advisor's file carries the starting estimates it found. The function names available to the advisor are those of TableCurve's expression language, listed in the parser reference beside the program; natural logarithm is ln or log, base-10 is log10.
Under Codex CLI the same ask writes candidate files but cannot fit them. Codex's proposals are reasoned, not tested; load each into User Defined Functions and judge it there.
+ Predictive Linear Model (GLM) Discovery
When no single catalogue model describes the data within its noise, or when you want a predictive model rather than a mechanistic one, Ask | + Predictive Linear Model (GLM) Discovery asks the advisor to design a set of basis functions powers, logarithms, exponential decays with chosen scales, rational terms, hinges, Fourier pairs, and for surfaces products in x and y to evaluate them over your data, and to fit every combination of them with TableCurve's full-permutation GLM [JUMP], ranked by leave-one-out prediction. The advisor first inspects the columns and the correlations among them, prunes what is redundant, and then runs the permutation fit. It reports the best model for each predictor count, the most economical model (the fewest predictors whose predicted error is within two percent of the best), and the coefficients and their t-values, and it ends its reply with an @GLM line.
That line enables Model | Open GLM Model, which opens the full GLM Review [JUMP] over the AI window with everything the GLM Review offers: the significance plot, the numeric summary, prediction statistics, and code generation. Close the GLM Review and you are back in the conversation, where you can ask for another round with different scales, more basis functions, or fewer. The same procedure serves curves (y against x), surfaces (z against x and y) and matrices of several named variables (see Your own matrices). Each model is saved under C:\TableCurve\AI\Models, and Model | Open GLM Model File reopens any of them later, in this or a future session.
The GLM here is the program's own: the statistics, the leave-one-out ranking and the Review are those of TableCurve's GLM feature, and the advisor's role is to design the basis and to read the result. The GLM asks for at least two or three predictors; with fewer, a catalogue model is the better tool.
Your own matrices
GLM discovery is not limited to the Review's x and y (or x, y and z). Place a CSV file with a header row of variable names in C:\TableCurve\AI\Matrices and the advisor can build a predictive model of any one column from functions of the others. Name the file and the response variable in your ask. The resulting model opens in the GLM Review like any other, with the variable names carried through.
What the advisor may do, and may not
In the discovery asks the advisor's permissions are wider than in model selection, and still narrow. It may read the files TableCurve wrote for it and the guidance documents. It may write only under C:\TableCurve\AI: candidate function files and GLM models in Models, and, when you ask it to, dated notes in the Learned additions section of your guidance. It may call the engine operations named above and nothing else. It has no command shell, cannot run programs, and cannot reach the network except through its own provider. The helper that carries its engine calls lives beside the program, outside any folder the advisor can write to.
The guidance you own
The doctrine for the discovery asks lives in the same three documents as model selection, GUIDANCE_PARAMETRIC.md, GUIDANCE_APPROX.md and GUIDANCE_GLM.md in C:\TableCurve\AI, edited with Guidance | View/Edit Guidance and restored with Reset Guidance to Default. The GLM document is the one that governs basis design: which families to try, how to choose the decay scales and hinge positions, how many predictors to allow for a given number of points. If you find the advisor's bases too cautious or too lavish for your field, that is the document to change. At the end of a discovery ask you can tell the advisor to "distil what you learned for future guidance" and it appends dated bullets to the document's Learned additions section.
Files
C:\TableCurve\AI\Models\name.udf candidate user-defined functions, loadable with Fit | User Defined Functions.
C:\TableCurve\AI\Models\name.csv and .bin basis matrices and the fitted GLM models Model | Open GLM Model File reopens.
C:\TableCurve\AI\Models\tc9mcp.log one line per engine call: the operation, its arguments, the elapsed time and the outcome. Read it to see exactly what the advisor tried.
C:\TableCurve\AI\Matrices\ your own data matrices for GLM discovery.
tc9mcp.exe beside the program and tc9mcp.json in C:\TableCurve the engine helper and its registration, written by TableCurve; do not move or edit them.
Acknowledgement
The scientific guidance, the evidence format, the model-selection and model-discovery procedures, and the engine tools behind this window were developed jointly by the author of TableCurve and Claude (Anthropic) over the course of 2026, from the author's decades of curve-fitting practice and Claude's analysis of the TableCurve fitting engine. They are part of TableCurve 9 and are the property of its publisher. The Codex CLI provider option runs this same guidance through OpenAI's Codex; it contributes no guidance of its own. Claude Code and Codex CLI are products of Anthropic and OpenAI respectively, installed and licensed by the user; TableCurve does not include or resell them.