calibrate
Fit constant model parameters to observed time-series, minimizing residual sum of squares. Choose local least-squares (with standard errors) or global differential evolution for calibration.
Instructions
Fit constant model parameters to an observed time-series — the inverse of simulate. Only constant auxiliaries/flows can be calibrated (stocks are rejected: overriding a stock pins it to a constant rather than setting its initial value). least_squares (default) reports a linearized std_error; differential_evolution is a global, seeded alternative requiring bounds. Observation times must lie within the model window (no extrapolation). Requires the optional pysd dependency (pip install 'stella-mcp[sim]').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | differential_evolution seed (kept non-null for reproducibility) | |
| method | No | Optimizer: least_squares (local, gives std_error) or differential_evolution (global, seeded, needs bounds) | least_squares |
| maxiter | No | differential_evolution generation cap (default 100) | |
| popsize | No | differential_evolution population multiplier | |
| weights | No | Optional positive per-target residual multipliers; inverse-sigma values give normalized residuals and the usual statistical std_error interpretation | |
| max_nfev | No | least_squares function-evaluation cap | |
| model_id | No | Session-scoped model ID. Optional; defaults to the current model for this session. | |
| objective | No | Objective (sum of squared residuals; scale via weights) | sse |
| parameters | Yes | Constant parameters to fit (constant auxiliaries/flows only; stocks are rejected) | |
| observations | Yes | Observed data on one shared time grid: inline {time, targets} or {csv_path} (first CSV column is time) | |
| save_fit_csv | No | Optional path to write a long (time, target, observed, fitted) CSV | |
| workspace_id | No | Opaque application workspace handle. Required by MCP 2026-07-28 clients; supported legacy stdio clients may omit it to use the process-local compatibility workspace. | |
| return_fit_series | No | Also return the best-fit downsampled series per target |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model_id | Yes |