Optimize Fit
optimize_fitFits nonlinear models to data using bounded parameters, multistart optimization, and weighted least squares, then reports rank-checked covariance and t95 intervals.
Instructions
Fit nonlinear models with bounded LM, up to 12 parameters, 20000 rows and 64 starts. Each parameter is scaled by its initial value, so give initial values of the expected size. Reports rank-checked local covariance and t95 intervals. Grammar: numbers, names, + - * / ^ (**), parentheses, whitelisted math calls; no comparisons inside expressions. Variables are plain numbers in the units you choose; the tool does not track units inside expressions.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "optimize_fit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | JSON column lists or rows, e.g. '{"x":[0,1,2],"y":[2,1,0.5]}'. | |
| seed | No | Deterministic random seed, e.g. 0; integer 0..4294967295, echoed in the result. | |
| model | No | Model expression, e.g. 'a*exp(-b*x)'; parameters and independent names are allowed. | |
| sigma | No | Optional JSON positive standard deviations, e.g. '[0.1,0.2,0.1]', one per row; blank means unit weights. | |
| bounds | No | Parameter JSON bound pairs in initial order, e.g. '[[0,5],[0,2]]'; null means unbounded. | |
| initial | No | Parameter initial records, e.g. 'a=2;b=0.5'; at most 12; a nonzero value also sets the parameter's scale. | |
| data_file | No | Optional CSV path, e.g. 'observations.csv', with numeric named columns; use instead of data. | |
| dependent | No | Dependent data column name, e.g. 'y'. | y |
| tolerance | No | Dimensionless convergence tolerance, e.g. 1e-7; supported 1e-12..0.01. | |
| multistart | No | Seeded fit start count, e.g. 8; 1..64, best converged weighted least squares is retained. | |
| time_limit | No | Wall-clock budget with time units, e.g. '10 s'; supported 0.001..60 s, shared by all solver stages. | 10 s |
| independent | No | Comma-separated independent column names, e.g. 'x' or 'x,z'. | x |
| absolute_sigma | No | Known-sigma covariance flag, e.g. true; false scales covariance by reduced chi-square. | |
| max_iterations | No | LM iteration cap per start, e.g. 500; 1..2000. |