After optimization or parameter estimation (using e.g. Optim),
you may ask how accurate the estimation of the parameters were.
With other words you want confidence intervals around your
parameter estimates. This can be achieved by using ParmVar on
a stochastic version of the model used for the
optimization or parameter estimation.
WARNING: This requires that the expected value of the
objective function of the stochastic model is the same as
the value of that from the deterministic model (and that the
parameters of the two models have the same values).
ParmVar fits a DETERMINISTIC MODEL to a STOCHASTIC MODEL
a specified number of times. The Model file should be written
in StochSD according to a certain layout. An example of
such a Model File is shown
here.
To use ParmVar you have to:
1. Select the file of the StochSD Model.
2. Specify each Parameter and Add it:
a. Type Name of the Parameter of the DETERMINISTIC MODEL.
b. Type Start value of the parameter.
c. Type Init.Step of the parameter.
d. Press the Add button.
3. Enter the Name of the Objective Function.
4. Enter Requested Accuracy (e.g. 0.01).
[ 5. Enter Max Iterations (Default=200). ]
[ 6. Enter Requested Estimates (Default=100). ]
7. Press the Run button.
[ 8. When DONE, the procedure may continue after change of Requested Estimates. ]
[ You can also Halt and/or Reset the procedure. ]
Before using ParmVar, the parameters of a DETERMINISTIC MODEL are usually
fitted to the OUTPUT of a SYSTEM UNDER STUDY, e.g. described by a table.
(This could have been done with Optim).Then a corresponding STOCHASTIC MODEL
is created, and the estimated parameter values are assigned to the parameters
of this model. The results from the STOCHASTIC MODEL will hen vary.
The task of the DETERMINISTIC MODEL is now to estimate the parameters
for different behaviours of the STOCHASTIC MODEL and present
these estimates as statistical results.
The MODEL FILE must consist of the following parts (See figure below):
A) A STOCHASTIC MODEL with the same structure and corresponding parameters
(here X0_s and T_s) as for the DETERMINISTIC MODEL earlier used for the
parameter estimation with Optim.
B) The DETERMINISTIC MODEL with parameters (here X0 and T) will now be
fitted to the STOCHASTIC MODEL.
C) An OBJECTIVE FUNCTION (here V) to compare the DETERMINISTIC MODEL to
STOCHASTIC MODEL. V is initiated to zero and will accumulate the squared
difference: Δt·(X_s-X)² for each time-step. V is to be minimized with
respect to the parameters, just as with Optim. (But here it is performed
many times to allow the stochastic model to display its varying behaviour.)