
3.9 Fitting ODE’s to Data 199
rsi 1.0000000 -0.9255568
ria -0.9255568 1.0000000
The plot generated by ODEFitEx2.r is almost identical with Figure 3.14b, with a
(very) slightly improved R
2
value of 0.995 (compared to 0.994 in the figure). Looking
at the confidence intervals, you see that r
ia
is estimated more precisely compared
to r
si
. r
si
’s confidence interval is substantially larger compared to the one obtained
above using
ODEFitEx1.r. Remember from our discussion in Section 2.4 that the
precision of the parameter estimates that can be achieved using
nls depends on a
number of factors. As it was said there, high correlations between your estimated
parameters may indicate a bad experimental design, that is, your data may not
provide the information that would be necessary to get sharp estimates of all
parameters. In the above
nls output, you see that there is indeed a high correlation
between r
si
and r
ia
. It makes sense to assume a bad experimental design here since
both parameters refer to the dynamics of T
i
that has not been measured.
When you are solving your own parameter estimation problems over ODEs using
the above procedure, it may happen that the convergence regions of the parameters are
quite small, that is, it may happen that the numerical method converges only when
you provide initial estimates of the parameters that are very close to the solution
of the estimation problem. This is related to the fact that our above procedure is
an initial value approach in the sense that all evaluations of the nonlinear function
dfn1 by the numerical procedure in R’s nls function require the solution of an
initial value problem over the entire period under consideration. If you provide
initial parameter estimates far away from the solution of the problem, this initial
value problem may become unsolvable as discussed in [41]. From a practical point
of view, we would of course prefer large convergence regions where the parameter
estimates are obtained based on rough initial estimates of the parameters. So you
should note that there are numerical methods which provide larger convergence
regions, such as the boundary value approach developed by Bock [41, 113].
3.9.1.4 Estimating Initial Values
Our last example regarding the alarm clock model is ODEFitEx3.r, which estimates
the following parameters of the alarm clock model: r
ia
, T
a
,andT
i0
. The new aspect
here is the fact that one of the parameters is an initial value of a state variable: T
i0
.
Initial values are treated a little bit different. They are not a part of the definition of
dfn, which means they do not appear in the list of arguments of dfn.Inparticular,
they do not need to be listed within
dfn as in 3.256. It is obvious that it would
not make sense to use initial values as arguments of
dfn since dfn just gives the
right-hand side of the ODE system, which does not depend on initial values of the
state variables. However, estimated initial values must of course appear in the list
of arguments of
dfn1, that is, of the nonlinear function used by nls.Incontrast
to 3.255, the definition of
dfn1 in this example, thus, looks as follows (again, all
comments have been skipped):
1: dfn1 <- function(tt,ria,Ta,Ti0)