Skip to content

Fitting to data

Fitting is where a model stops being a drawing and starts being a claim with numbers attached. ProcessDB's optimizers minimise the weighted sum of squared differences between simulated curves and your measurements.

Before you optimize

Three things need to be true, and each has a home in the interface.

1. Every measurement knows which model variable it corresponds to. Press Edit Associations and Weights in the Parameter Explorer. The left column lists measurements with a Variable you can edit; the middle lists that measurement's data sets; the right shows the data points.

2. The weights say what you believe. See below.

3. You are fitting the right parameters. Tick Adj for the parameters you want estimated, and give each a Lower and Upper bound. Rate constants that span orders of magnitude should also have Log ticked, so the search moves multiplicatively.

Bounds do more work than they look like they do. Too wide and the search wanders through regions where the solver fails; too narrow and the answer sits on a bound, which is the optimizer reporting that the bound is wrong. Find Potent Parameters shows which parameters the data can determine at all.

Weights

Weights control how much each data point contributes. There are three levels, and they multiply:

  • a weight per data set, on the Data Sets list — for whole replicates you trust more or less;
  • a value weight per data point;
  • a time weight per data point, for when the timing itself is uncertain.

Setting these one by one is unreasonable, so the weights editor has two buttons — Set value weights from Formula and Set time weights from Formula — offering standard schemes, each applicable to the selected data set or to all of them at once:

Formula Effect
1/value² Constant relative error: every point contributes equally in percentage terms. The usual choice for concentration data spanning orders of magnitude
1/(F·value)² The same, scaled by a factor you supply
1/avg(value)² Constant absolute error, scaled by the series mean — keeps a series with small values from being ignored
1/median(value)² As above, but robust to outliers
1.0 Unweighted — every point contributes its absolute squared error

The default of unweighted least squares means your largest measurements dominate the fit entirely. That is rarely what you want in biology, where error is usually proportional to signal; 1/value² is a better default for most data.

Running the optimizer

Press Optimize. Choose an Algorithm and press Start.

Algorithm Character
Particle Swarm (default) A global search — a population of candidate parameter vectors exploring the space together. Robust to rough objective surfaces and to bad starting points, which is why it is the default for biological models
Random Walk A simple stochastic search, useful as a sanity check
Odrpack95 Orthogonal distance regression — fast local convergence when you are already close
VTdirect A deterministic global search over a bounded box

The status area reports the initial and best objective function value, the current value, the iteration count, how many parameters are being estimated, and how many objective-function evaluations have succeeded and failed. A steady stream of failed evaluations means the search is wandering into regions where the model will not simulate — usually a sign that bounds are too wide.

Particle Swarm exposes its own settings: number of particles, neighbourhood size, acceleration constant, initial and maximum velocities, a convergence epsilon, and a cap on evaluations. The defaults are reasonable; raise the particle count for a hard problem and the evaluation cap for a slow one.

The four tabs below:

  • Parameters — the parameters and their bounds. All Parameters toggles between every parameter and only the ones being estimated, and Keep Best Parameters writes the best values found back into the parameter set;
  • Residuals — per-point differences between model and data;
  • Simulations — individual candidate simulations, which you can show on the graphs to watch the swarm explore;
  • Additional Output — whatever the algorithm reports.

When the run finishes, press Keep Best Parameters if you want the result. Until you do, your parameter set is untouched. If the set had unsaved edits when you started, ProcessDB offers to save it first rather than overwriting them.

Reading the result

A falling objective function is not by itself a fit. What tells you more:

  • The curves. A low objective function with a systematically wrong shape means the weights are hiding the disagreement, not that the model is right.
  • The residuals. Structure in the residuals — a run of same-sign differences — says the model is missing a mechanism, not a parameter value.
  • Parameters sitting on a bound. Either the bound is wrong or the model wants something the data cannot supply.
  • FSD. A large fractional standard deviation means the data did not determine that parameter. Fixing it at a literature value and refitting the rest is usually more honest than reporting an estimate the data does not support.
  • How many experiments the fit covers. One parameter set explaining several experiments at once is a far stronger result than the same fit to a single time course, which is why a MOE spanning several experiments constrains a model so much harder than one that does not.

Saving a fit

Fitted values live in the parameter set. Press the Parameter Explorer's Save button to keep them, and give the set a name and a note saying what it was fitted to. Then commit in the main window.

A new parameter set made before an ambitious fit is cheap insurance: the set you already trust stays untouched, and Open and Open Ref flip between them.