Refining Linear Parametric Models

When to Refine Models

There are two situations where you can refine estimates of linear parametric models.

In the first situation, you have already estimated a parametric model and wish to refine the model. However, if your model captures the essential dynamics, it is usually not necessary to continue improving the fit—especially when the improvement is a fraction of a percent.

In the second situation, you might have constructed a model using one of the model constructors described in Commands for Constructing Model Structures. In this case, you built initial parameter guesses into the model structure and wish to refine these parameter values.

What You Specify to Refine a Model

When you refine a model, you must provide two inputs:

How to Refine Linear Parametric Models in the GUI

The following procedure assumes that the model you want to refine is already in the System Identification Tool GUI. You might have estimated this model in the current session or imported the model from the MATLAB workspace. For information about importing models into the GUI, see Importing Models into the GUI.

To refine your model:

  1. In the System Identification Tool GUI, verify that you have the correct data set in the Working Data area for refining your model.

    If you are using a different data set than the one you used to estimate the model, drag the correct data set into the Working Data area. For more information about specifying estimation data, see Specifying Estimation and Validation Data.

  2. Select Estimate > Linear parametric models to open the Linear Parametric Models dialog box, if this dialog box is not already open.

  3. In the Linear Parametric Models dialog box, select By Initial Model from the Structure list.

  4. Enter the model name into the Initial model field, and press Enter.

    The model name must be in the Model Board of the System Identification Tool GUI or a variable in the MATLAB workspace.

    When you enter the model name, algorithm settings in the Linear Parametric Models dialog box override the initial model settings.

  5. Modify the algorithm settings, displayed in the Linear Parametric Models dialog box, if necessary.

  6. Click Estimate to refine the model.

  7. Validate the new model, as described in Model Analysis.

How to Refine Linear Parametric Models at the Command Line

If you are working at the command line, you can use pem to refine parametric model estimates.

The general syntax for refining initial models is as follows:

m = pem(data,init_model)

pem uses the properties of the initial model unless you specify different properties. For more information about specifying model properties directly in the estimator, see Specifying Model Properties for Estimation.

Example – Refining an Initial ARMAX Model at the Command Line

The following example shows to estimate an initial model and try to refine this model using pem:

load iddata8

% Split the data z8 into two parts.
% Create new data object with first hundred samples
z8a = z8(1:100);

% Create new data object with remaining samples
z8b = z8(101:end); 

% Estimate ARMAX model with default Algorithm
% properties, na=4, nb=[3 2 3], nc=2, and nk=[0 0 0]
m1 = armax(z8a,[4 3 2 3 2 0 0 0]);

% Refine the initial model m1 using the data set z8b,
% and stricter algorithm settings with increased number
% of maximum iterations (MaxIter) and smaller tolerance
m2 = pem(z8b,m1,'tol',1e-5,'maxiter',50);

For more information about estimating polynomial models, see Identifying Input-Output Polynomial Models.

Example – Refining an ARMAX Model with Initial Parameter Guesses at the Command Line

The following example shows how to refine models for which you have initial parameter guesses. This example estimates an ARMAX model for the data and requires you to initialize the A, B, and C polynomials.

In this case, you must first create a model object and set the initial parameter values in the model properties. Next, you provide this initial model as input to pem, which refines the initial parameter guesses using the data.

load iddata8
% Define model parameters
A = [1 -1.2 0.7];
B(1,:) = [0 1 0.5 0.1]; % first input
B(2,:) = [0 1.5 -0.5 0]; % second input
B(3,:) = [0 -0.1 0.5 -0.1]; % third input
C = [1 0 0 0 0];
Ts = 1;
% Leading zeros in B matrix indicate input delay (nk),
% which is 1 for each input channel. The trailing zeros
% in B(2,:)) make the number of coefficients equal 
% for all channels.

% Create model object
init_model = idpoly(A,B,C,'Ts',1);

% Use pem to refine initial model
model = pem(z8,init_model)

% Compare the two models
compare(z8,init_model,model)

For more information about estimating polynomial models, see Identifying Input-Output Polynomial Models.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS