Step 8: Running optimization

 

Comparing the model with observed data

When a model of a 'real' system has been developed it is important to assess how well it is working by comparing the model's predictions with experimental data. We shall overlay some experimental data to a graph of our model's predictions, and then use optimization to improve the fit between the two sets of data.

To follow this example reload the model "tutor2.mod"

In ModelMaker, input experimental data are called model data and are configured in the Model Data view.

  • Select View|Model Data

The Model Data view is created and activated with an empty sheet (Page 1). You need to enter the data.

  • Enter the following experimental data:
Time (days) Pollutant Levels (kg)
Lake1 Lake2
10 300 530
20 230 540
30 140 495
40 115 340
50 120 280
60 130 190
70 150 290
80 170 300
90 195 310
100 215 320

Each column of data must be configured and associated with a model component. One column must represent the independent variable (t) - this is assumed to be the first column by default.

  • Click the Series icon on the Model Data toolbar

The Model Data Series Definition dialog box opens.

  • Select the second series in the Series list box
  • Change the series type to Data Value and select Lake1 in the Available Components list box
  • Click Define to complete the series definition
  • Select the third series in the Series list box
  • Change the series type to Data Value and select Lake2 in the Available Components list box
  • Click OK to complete the series definition and close the dialog

The model data values we have just configured are automatically added to the graph of Lake1 and Lake2 (unless otherwise configured in the Graph Series dialog box).

Error bars have also been calculated for the model data, based on the default optimization error which is configured in the Weighting tab of the Optimization Settings dialog box. We shall change the default error value to a more appropriate fractional error value of 0.25.

  • Select Model|Configure>Optimization

The Optimization Settings dialog box opens.

  • Select the Weighting tab
  • Check that Fractional is selected as the Data Error and enter 0.25 in the edit box
  • Click OK

The graph of Lake1 and Lake2 is updated to reflect the new default error settings

.

The completed model up to this point is "tutor8.mod"

Optimization

Once experimental data are associated with a model, it is possible to improve the model so that it fits the experimental data more accurately. This is achieved by optimization, where selected model parameters are systematically adjusted to reduce the deviation between the model and experimental data.

To follow this example load the model "tutor8.mod"

We are now in a position to optimize our example model with respect to the configured experimental data. We shall optimize the parameters river_rate and estuary_rate using the default optimization settings of Marquardt optimization and Ordinary least squares weighting.

  • Activate the Parameters view by selecting it in the Model Explorer
  • Select the Optimize check boxes for river_rate and estuary_rate

Optimization is now enabled.

  • Click the Integrate icon arrow and select Optimize from the drop-down menu

The Optimization Run dialog box opens. Use this dialog to confirm the optimization method and parameter selection, and start the calculation.

  • Click OK to run the optimization

The optimization eventually converges on the new parameter values of river_rate = 0.0968 and estuary_rate = 0.0431. The new parameter values are shown in the Parameter Results view which is a sub-view of Results. The Marquardt default optimization method also produces an estimate of the standard error associated with each optimized parameter value.

A summary of the optimization statistics is written to the Optimization Statistics view, which is also a sub-view of Results. The optimization process produces an excellent fit between the model and the experimental data, with an r2 value of almost 0.9.

Updating the parameters

Now we can update the model with the optimized values of river_rate and estuary_rate.

  • Activate the Parameter Results view
  • Select river_rate and select RMB|Update parameter
  • Repeat for estuary_rate

Now re-run the model with the optimized parameters to inspect the improved fit of the model to the experimental data.

The completed model for this step is "tutor9.mod"

Return to the main tutorial page
  
ModelKinetix is a trade name of FamilyGenetix, managed by AP Benson.
© FamilyGenetix 2001-2003