findstates(idnlarx) - Estimate initial states of nonlinear ARX model from data

Syntax

X0 = findstates(MODEL,DATA)
X0 = findstates(MODEL,DATA,X0INIT)
X0 = findstates(MODEL,DATA,X0INIT,PRED_OR_SIM)
X0 = findstates(MODEL,DATA,X0INIT,PRED_OR_SIM,PVPairs)
[X0, REPORT] = findstates(...)

Description

X0 = findstates(MODEL,DATA) estimates the initial states of an idnlarx model that minimize the error between the output measurements in DATA and the predicted output of the model. The states of an idnlarx model are defined as the delayed samples of input and output variables. For more information about the definition of states for idnlarx models, see Definition of idnlarx States.

X0 = findstates(MODEL,DATA,X0INIT) specifies an initial guess for estimating the initial states.

X0 = findstates(MODEL,DATA,X0INIT,PRED_OR_SIM) allows switching between prediction-error (default) and simulation-error minimization.

X0 = findstates(MODEL,DATA,X0INIT,PRED_OR_SIM,PVPairs) lets you specify the algorithm properties that control the numerical optimization process as property-value pairs.

[X0, REPORT] = findstates(...) creates a report to summarize results of numerical optimization that is performed to search for the model states.

Input

Input

Examples

Estimating Initial States

In this example, you use sample data z1 to create a nonlinear ARX model. You use findstates to compute the initial states of the model such that the difference between the predicted output of the model and the output data in z2 is minimized.

  1. Load the sample data and create two data objects z1 and z2.

    load twotankdata
    % Create data objects z1 and z2.
    z = iddata(y,u,0.2,'Name','Two tank system');
    z1 = z(1:1000); z2 = z(1001:2000);
    
  2. Estimate the idnlarx model.

    % Estimate a nonlinear ARX model from data in z1.
    mw1 = nlarx(z1,[5 1 3],wavenet('NumberOfUnits',8)); 
    
  3. Estimate the initial states of the model.

    % Find the initial states X0 of mw1 that minimize 
    % the error between the output data of z2 and the 
    % simulated output of mw1.
    X0 = findstates(mw1,z2,[],'sim')
    

    This command computes:

    X0 =
       0.446974971029569
       0.477047330267726
       0.345177563976721
       0.499168535130508
       0.275499832553790
       0.459405075998746
       0.453389709178942
       0.457206483874631
    

Estimating Initial States for Multiple-Experiment Data

In this example, you estimate the initial states for each data set in a multiple-experiment data object.

  1. Create a multi-experiment data set from z1 and z2:

    % Create a multi-experiment data set.
    zm = merge(z1,z2);
    
  2. Estimate the initial states for each experiment in the data set.

    % Estimate initial states for each data set in zm.
    X0 = findstates(mw1,zm)
    
    

    This command computes the following initial states:

    X0 =
    
       0.094132178358474   0.481501876919437
       0.176819996131956   0.421290990844905
       0.147547321715597   0.409770929782377
       0.166554849587273   0.408028392383016
       0.279390454813027   0.311475382142399
       0.075395497688180   0.452622735314260
       0.079227662461156   0.451653009299017
       0.079071040382789   0.451726254742998
    

See Also

data2state(idnlarx) 
getDelayInfo(idnlarx) 
findop(idnlarx) 
findstates(idmodel) 
findstates(idnlhw) 

  


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