This is a system of ODEs I have set up to model a disease.

I'm trying to fit the parameters for this model for a given data set using a least squares fitting algorithm. The parameters are the Greek letters which represent quantities like rate of infection, recovery etc.

After doing some research I've found that SEIR and similar models are considered non-linear least squares problems. Why is this? From what I understand, for a problem to be a linear least-squares problem the model function must be linear in the parameters, which seems to be the case for my ODEs. Or maybe I'm misunderstanding what "linear in the parameters" actually means.

  • 1
    $\begingroup$ Please follow the instructions in How to Ask a Good Question or else your question will be closed. $\endgroup$
    – Kurt G.
    Apr 30, 2022 at 7:19
  • $\begingroup$ Does $X=Y-(n)$ mean there is a quantity $(n)$ satisfying $X+(n)=Y$, or does it mean $X=Y$ is equation $(n)$? $\endgroup$
    – J.G.
    Apr 30, 2022 at 7:47

1 Answer 1


You have a system $\dot x=C(k)T(x)$ where $C(k)$ is a matrix containing the parameters $k$ and $T(x)$ are terms in $x$ without parameters.

If you were able to measure sufficiently fine time series of all the components to then replace the derivatives $\dot x(t_k)$ as difference quotients (or the slope of local linear regression) $v_k$, then the resulting system $v_k=C(k)T(x_k)$ is indeed linear in the parameters.

However, you most likely have only one or two components measured. The parameters in the equation for the other components do only influence the measured components over the non-linear dependence. Thus it is necessary to solve the system numerically for a current approximation of the parameters, compute derivatives/sensitivities, etc. In the time propagation of the solver, the parameters are also propagated through the non-linear dynamics, thus will occur non-linearly in the predicted component values. Even in the easiest case of the scalar equation $\dot x=kx$, the solution $x=Ce^{kt}$ is non-linear. Thus a non-linear problem.

Or you could look at the Euler method as most simple example. While $x_1=x_0+hC(k)T(x_0)$ is still linear, $$ x_2=x_0+hC(k)T(x_0)+hC(k)T(x_0+hC(k)T(x_0)) $$ already contains the parameters in quadratic or higher order. One can observe that $hC(k)$ is always combined, so that a degree $d$ term in $k$ has the coefficient $h^d$, but the number of terms of a given degree will also grow superlinearly.

As sort of a corollary, the shorter the integration time span, the less important will the non-linear terms in the parameters be. Splitting a fitting task into smaller sub-tasks with such nearly linear dependence on the coefficiens can help to improve and stabilize the convergence to useful parameters.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .