Statistics Toolbox    

Example: Nonlinear Modeling

The Hougen-Watson model (Bates and Watts, [2]) for reaction kinetics is one specific example of this type. The form of the model is

where 12, ...,5 are the unknown parameters, and x1, x2, and x3 are the three input variables. The three inputs are hydrogen, n-pentane, and isopentane. It is easy to see that the parameters do not enter the model linearly.

The file reaction.mat contains simulated data from this reaction.

The variables are as follows:

The data and model are explored further in the following sections:

Fitting the Hougen-Watson Model

The Statistics Toolbox provides the function nlinfit for finding parameter estimates in nonlinear modeling. nlinfit returns the least squares parameter estimates. That is, it finds the parameters that minimize the sum of the squared differences between the observed responses and their fitted values. It uses the Gauss-Newton algorithm with Levenberg-Marquardt modifications for global convergence.

nlinfit requires the input data, the responses, and an initial guess of the unknown parameters. You must also supply the name of a function that takes the input data and the current parameter estimate and returns the predicted responses. In MATLAB terminology, nlinfit is called a "function" function.

Here is the hougen function.

To fit the reaction data, call the function nlinfit.

nlinfit has two optional outputs. They are the residuals and Jacobian matrix at the solution. The residuals are the differences between the observed and fitted responses. The Jacobian matrix is the direct analog of the matrix X in the standard linear regression model.

These outputs are useful for obtaining confidence intervals on the parameter estimates and predicted responses.

Confidence Intervals on the Parameter Estimates

Using nlparci, form 95% confidence intervals on the parameter estimates, betahat, from the reaction kinetics example.

Confidence Intervals on the Predicted Responses

Using nlpredci, form 95% confidence intervals on the predicted responses from the reaction kinetics example.

Matrix opd has the observed rates in column 1 and the predictions in column 2. The 95% confidence interval is column 2±column 3. These are simultaneous confidence intervals for the estimated function at each input value. They are not intervals for new response observations at those inputs, even though most of the confidence intervals do contain the original observations.


  Nonlinear Least Squares An Interactive GUI for Nonlinear Fitting and Prediction