This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Estimate state-space model by reduction of regularized ARX model




sys = ssregest(data,nx) estimates a state-space model by reduction of a regularized ARX model.


sys = ssregest(data,nx,Name,Value) specifies additional options using one or more Name,Value pair arguments.


sys = ssregest(___,opt) specifies estimation options that configure the estimation objective, ARX orders, and order reduction options. This syntax can include any of the input argument combinations in the previous syntaxes.


[sys,x0] = ssregest(___) returns the value of initial states computed during estimation. This syntax can include any of the input argument combinations in the previous syntaxes.


collapse all

Load estimation data.

load iddata2 z2;

z2 is an iddata object that contains time-domain system response data.

Identify a third-order state-space model.

sys = ssregest(z2,3);

Load estimation data.

load iddata2 z2

Estimate a third-order state-space model with input delay.

sys = ssregest(z2,3,'InputDelay',2);

Load estimation data.

load iddata2 z2;

Specify the order of the regularized ARX model used by the software during estimation. Also, set the estimation focus to simulation.

opt = ssregestOptions('ARXOrder',[100 100 1],'Focus','simulation');

Identify a third-order state-space model.

sys = ssregest(z2,3,opt);

Load estimation data.

load iddata2 z2;

Obtain the initial state values when identifying a third-order state-space model.

[sys,x0] = ssregest(z2,3);

Load data.

load regularizationExampleData eData;

Create a transfer function model used for generating the estimation data (true system).

trueSys = idtf([0.02008 0.04017 0.02008],[1 -1.561 0.6414],1);

Obtain regularized impulse response (FIR) model.

opt = impulseestOptions('RegulKernel','DC');
m0 = impulseest(eData,70,opt);

Convert the model into a state-space model and reduce the model order.

m1 = balred(idss(m0),15);

Obtain a second state-space model using regularized reduction of an ARX model.

m2 = ssregest(eData,15);

Compare the impulse responses of the true system and the estimated models.


Input Arguments

collapse all

Estimation data, specified as an iddata, idfrd or frd object.

For time-domain estimation, data must be 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'

    The sample time Ts of the iddata object must be nonzero.

Order of the estimated model, specified as a positive scalar or vector.

If nx is a vector, then ssregest creates a plot which you can use to choose a suitable model order. The plot shows the Hankel singular values for models of chosen values in the vector. States with relatively small Hankel singular values can be safely discarded. A default choice is suggested in the plot.

You can also specify nx = 'best', as in ssregest(data,'best'), in which case the optimal order is chosen automatically in the 1:10 range.

Estimation options for ssregest, specified as an options set you create using ssregestOptions.

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.

Example: sys = ssregest(z2,3,'InputDelay',2) specifies a delay of 2 sampling periods.

collapse all

Sample time of the model, specified as 0 or equal to the sample time of data.

For continuous-time models, use Ts = 0. For discrete-time models, specify Ts as a positive scalar whose value is equal to the data sample time.

Input delay for each input channel, specified as a 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 sampling periods.

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.

Type of canonical form of sys, specified as one of the following values:

  • 'modal' — Obtain sys in modal form.

  • 'companion' — Obtain sys in companion form.

  • 'free' — All entries of the A, B and C matrices are treated as free.

  • 'canonical' — Obtain sys in the observability canonical form [1].

Use the Form, Feedthrough and DisturbanceModel name-value pair arguments to modify the default behavior of the A, B, C, D, and K matrices.

Direct feedthrough from input to output, specified as a logical vector of length Nu, where Nu is the number of inputs. If Feedthrough is specified as a logical scalar, it is applied to all the inputs.

Use the Form, Feedthrough and DisturbanceModel name-value pair arguments to modify the default behavior of the A, B, C, D, and K matrices.

Specify whether to estimate the K matrix which specifies the noise component, specified as one of the following values:

  • 'none' — Noise component is not estimated. The value of the K matrix is fixed to zero value.

  • 'estimate' — The K matrix is treated as a free parameter.

DisturbanceModel must be 'none' when using frequency-domain data.

Use the Form, Feedthrough and DisturbanceModel name-value pair arguments to modify the default behavior of the A, B, C, D, and K matrices.

Output Arguments

collapse all

Estimated state-space model of order nx, returned as an idss model object. The model represents:


A, B, C, D, and K are state-space matrices. u(t) is the input, y(t) is the output, e(t) is the disturbance and x(t) is the vector of nx states.

All the entries of A, B, C, and K are free estimable parameters by default. D is fixed to zero by default, meaning that there is no feedthrough, except for static systems (nx=0).

Information about the estimation results and options used is stored in the Report property of the model. Report has the following fields:

Report FieldDescription

Summary of the model status, which indicates whether the model was created by construction or obtained by estimation.


Estimation command used.


Handling of initial states during estimation, returned as one of the following values:

  • 'zero' — The initial state was set to zero.

  • 'estimate' — The initial state was treated as an independent estimation parameter.

This field is especially useful when the InitialState option in the estimation option set is 'auto'.


ARX model orders, returned as a matrix of nonnegative integers [na nb nk].


Quantitative assessment of the estimation, returned as a structure. See Loss Function and Model Quality Metrics for more information on these quality metrics. The structure has the following fields:


Normalized root mean squared error (NRMSE) measure of how well the response of the model fits the estimation data, expressed as a percentage.


Value of the loss function when the estimation completes.


Mean squared error (MSE) measure of how well the response of the model fits the estimation data.


Final prediction error for the model.


Raw Akaike Information Criteria (AIC) measure of model quality.


Small sample-size corrected AIC.


Normalized AIC.


Bayesian Information Criteria (BIC).


Estimated values of model parameters.


Option set used for estimation. If no custom options were configured, this is a set of default options. See ssregestOptions for more information.


State of the random number stream at the start of estimation. Empty, [], if randomization was not used during estimation. For more information, see rng in the MATLAB® documentation.


Attributes of the data used for estimation, returned as a structure with the following fields:


Name of the data set.


Data type.


Number of data samples.


Sample time.


Input intersample behavior, returned as one of the following values:

  • 'zoh' — Zero-order hold maintains a piecewise-constant input signal between samples.

  • 'foh' — First-order hold maintains a piecewise-linear input signal between samples.

  • 'bl' — Band-limited behavior specifies that the continuous-time input signal has zero power above the Nyquist frequency.


Offset removed from time-domain input data during estimation. For nonlinear models, it is [].


Offset removed from time-domain output data during estimation. For nonlinear models, it is [].

For more information on using Report, see Estimation Report.

Initial states computed during estimation, returned as a scalar. If data contains multiple experiments, then x0 is a matrix with each column corresponding to an experiment.

This value is also stored in the Parameters field of the model's Report property.

More About

collapse all

Modal Form

In modal form, A is a block-diagonal matrix. The block size is typically 1-by-1 for real eigenvalues and 2-by-2 for complex eigenvalues. However, if there are repeated eigenvalues or clusters of nearby eigenvalues, the block size can be larger.

For example, for a system with eigenvalues (λ1,σ±jω,λ2), the modal A matrix is of the form


Companion Form

In the companion realization, the characteristic polynomial of the system appears explicitly in the right-most column of the A matrix. For a system with characteristic polynomial


the corresponding companion A matrix is


The companion transformation requires that the system be controllable from the first input. The companion form is poorly conditioned for most state-space computations; avoid using it when possible.


  • ssregest function provides improved accuracy than n4sid for short, noisy data sets.

  • For some problems, the quality of fit using n4sid is sensitive to options, such as N4Horizon, whose values can be difficult to determine. In comparison, the quality of fit with ssregest is less sensitive to its options, which makes ssregest simpler to use.


ssregest estimates a regularized ARX model and converts the ARX model to a state-space model. The software then uses balanced model reduction techniques to reduce the state-space model to the specified order.


[1] Ljung, L. System Identification: Theory For the User, Second Edition, Appendix 4A, pp 132-134, Upper Saddle River, N.J: Prentice Hall, 1999.

Introduced in R2014a

Was this topic helpful?