Estimate Output-Error polynomial model using time or frequency domain data


sys = oe(data,[nb nf nk])
sys = oe(data,[nb nf nk],Name,Value)
sys = oe(data,init_sys)
sys = oe(data,___,opt)


sys = oe(data,[nb nf nk]) estimates an Output-Error model, sys, represented by:


y(t) is the output, u(t) is the input, and e(t) is the error.

sys is estimated for the time- or frequency-domain, measured input-output data, data. The orders, [nb nf nk], parameterize the estimated polynomial.

sys = oe(data,[nb nf nk],Name,Value) specifies model structure attributes using additional options specified by one or more Name,Value pair arguments.

sys = oe(data,init_sys) uses the Output-Error structure polynomial model (idpoly) init_sys to configure the initial parameterization of sys.

sys = oe(data,___,opt) estimates a polynomial model using the option set, opt, to specify estimation behavior.

Input Arguments


Estimation data.

For time domain estimation, data is an iddata object containing the input and output signal values.

For frequency domain estimation, data can be one of the following:

  • Recorded frequency response data (frd or idfrd)

  • iddata object with its properties specified as follows:

    • InputData — Fourier transform of the input signal

    • OutputData — Fourier transform of the output signal

    • Domain'Frequency'

For multi-experiment data, the sample times and inter-sample behavior of all the experiments must match.

[nb nf nk]

Output error model orders.

For a system represented by:


where y(t) is the output, u(t) is the input and e(t) is the error.

  • nb — Order of the B polynomial + 1. nb is an Ny-by-Nu matrix. Ny is the number of outputs and Nu is the number of inputs.

  • nf — Order of the F polynomial. nf is an Ny-by-Nu matrix. Ny is the number of outputs and Nu is the number of inputs.

  • nk — Input delay, expressed as the number of samples. nk is an Ny-by-Nu matrix. Ny is the number of outputs and Nu is the number of inputs. The delay appears as leading zeros of the B polynomial.

For estimation using continuous-time data, only specify [nb nf] and omit nk.


Polynomial model that configures the initial parameterization of sys.

Specify init_sys as an idpoly model having the Output-Error structure.

Use the Structure property of init_sys to configure initial guesses and constraints for B(q) and F(q).

To specify an initial guess for, say, the F(q) term of init_sys, set init_sys.Structure.f.Value as the initial guess.

To specify constraints for, say, the B(q) term of init_sys:

  • Set init_sys.Structure.b.Minimum to the minimum B(q) coefficient values

  • Set init_sys.Structure.b.Maximum to the maximum B(q) coefficient values

  • Set init_sys.Structure.b.Free to indicate which B(q) coefficients are free for estimation

If opt is not specified, and init_sys was created by estimation, then the estimation options from init_sys.Report.OptionsUsed are used.


Estimation options.

opt is an options set, created using oeOptions, that specifies estimation options including:

  • Estimation objective

  • Handling of initial conditions

  • Numerical search method and the associated options

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.


Input delay for each input channel, specified as a scalar value or numeric vector. For continuous-time systems, specify input delays in the time unit stored in the TimeUnit property. For discrete-time systems, specify input delays in integer multiples of the sample time Ts. For example, InputDelay = 3 means a delay of three sample times.

For a system with Nu inputs, set InputDelay to an Nu-by-1 vector. Each entry of this vector is a numerical value that represents the input delay for the corresponding input channel.

You can also set InputDelay to a scalar value to apply the same delay to all channels.

Default: 0


Transport delays. ioDelay is a numeric array specifying a separate transport delay for each input/output pair.

For continuous-time systems, specify transport delays in the time unit stored in the TimeUnit property. For discrete-time systems, specify transport delays as integers denoting delay of a multiple of the sample time Ts. You can specify ioDelay as an alternative to the nk value. Doing so simplifies the model structure by reducing the number of leading zeros the B polynomial. In particular, you can represent max(nk-1,0) leading zeros as input/output delays using ioDelay instead.

For a MIMO system with Ny outputs and Nu inputs, set ioDelay to a Ny-by-Nu array. Each entry of this array is a numerical value that represents the transport delay for the corresponding input/output pair. You can also set ioDelay to a scalar value to apply the same delay to all input/output pairs.

Default: 0 for all input/output pairs

Output Arguments


Identified Output-Error polynomial model.

sys is an idpoly model which encapsulates the identified Output Error model and the associated parameter covariance data.


collapse all

Estimate Continuous-Time Model Using Frequency Response

Obtain the estimation data.

filename = fullfile(matlabroot,'examples','ident','oe_data1.mat');

data, an idfrd object, contains the continuous-time frequency response for the following model:

$$G(s) = \frac{{s + 3}}{{{s^3} + 2{s^2} + s + 1}}$$

Estimate the model.

nb = 2;
nk = 3;
sys = oe(data,[nb nk]);

Evaluate the goodness of the fit.


Estimate Output-Error Model Using Regularization

Estimate a high-order OE model from data collected by simulating a high-order system. Determine the regularization constants by trial and error and use the values for model estimation.

Load data.

load regularizationExampleData.mat m0simdata

Estimate an unregularized OE model of order 30.

m1 = oe(m0simdata, [30 30 1]);

Obtain a regularized OE model by determining Lambda value using trial and error.

opt = oeOptions;
opt.Regularization.Lambda = 1;
m2 = oe(m0simdata,[30 30 1],opt);

Compare the model outputs with the estimation data.

opt = compareOptions('InitialCondition','z');
compare(m0simdata, m1, m2, opt);

The regularized model m2 produces a better fit than the unregularized model m1.

Compare the variance in the model responses.

h = bodeplot(m1,m2);
opt = getoptions(h);
opt.PhaseMatching = 'on';
opt.ConfidenceRegionNumberSD = 3;
opt.PhaseMatching = 'on';

The variance of the regularized model m2 is reduced compared to the unregularized model m1.

Estimate Model Using Band-Limited Discrete-Time Frequency-Domain Data

Obtain the estimation data.

filename = fullfile(matlabroot,'examples','ident','oe_data2.mat');

data, an iddata object, contains the discrete-time frequency response for the following model:

$$G(s) = \frac{{1000}}{{s + 500}}$$

The sample time for data, Ts, is 0.001 seconds.

Treat data as continuous-time data. When you plot data, the input/output signals are band-limited, which allows you to treat data as continuous-time data. You can now obtain a continuous-time model.

data.Ts = 0;

Specify the estimation options.

opt = oeOptions('Focus',[0 0.5*pi/Ts]);

Limiting the 'Focus' option to the [0 0.5*pi/Ts] range directs the software to ignore the response values for frequencies higher than 0.5*pi/Ts rad/s.

Estimate the model.

nb = 1;
nf = 3;
sys = oe(data,[nb nf],opt);


Output-Error models are a special configuration of polynomial models, having only two active polynomials - B and F. For such models, it may be more convenient to use a transfer function (idtf) model and its estimation command, tfest.

Also, tfest is the recommended command for estimating continuous-time models.

More About

collapse all

Output-Error (OE) Model

The general Output-Error model structure is:


The orders of the Output-Error model are:

nb:   B(q)=b1+b2q1+...+bnbqnb+1nf:   F(q)=1+f1q-1+...+fnfq-nf

Continuous-Time, Output-Error Model

If data is continuous-time frequency-domain data, oe estimates a continuous-time model with transfer function:


The orders of the numerator and denominator are nb and nf, similar to the discrete-time case. However, the delay nk has no meaning and you should omit it when specifying model orders for estimation. Use model = oe(data, [nb nf]). Use the ioDelay model property to specify any input-output delays. For example, use model = oe(data, [nb nf], 'ioDelay', iod) instead.


  • To estimate a continuous-time model when data represents continuous-time frequency response data, omit nk.

    For example, use sys = oe(data,[nb nf]).


The estimation algorithm minimizes prediction errors.

See Also

| | | | | | | | | | | |

Was this topic helpful?