# ssest

Estimate state-space model using time-domain or frequency-domain data

## Syntax

``sys = ssest(tt,nx)``
``sys = ssest(u,y,nx,'Ts',Ts)``
``sys = ssest(u,y,nx)``
``sys = ssest(data,nx)``
``sys = ssest(tt,nx)``
``sys = ssest(tt,nx,'OutputName',outputVariables,'InputName',[])``
``sys = ssest([],y,nx,'Ts',Ts)``
``sys = ssest(data,nx)``
``sys = ssest(___,Name,Value)``
``sys = ssest(tt,init_sys)``
``sys = ssest(u,y,init_sys)``
``sys = ssest(data,init_sys)``
``sys = ssest(___,opt)``
``[sys,x0] = ssest(___)``

## Description

### Estimate State-Space Model

example

````sys = ssest(tt,nx)` estimates the continuous-time state-space model `sys` of order `nx`, using all the input and output signals in the timetable `tt`. You can use this syntax for SISO and MISO systems. The function assumes that the last variable in the timetable is the single output signal.`sys` is an `idss` model of the following form: $\begin{array}{l}\stackrel{˙}{x}\left(t\right)=Ax\left(t\right)+Bu\left(t\right)+Ke\left(t\right)\\ y\left(t\right)=Cx\left(t\right)+Du\left(t\right)+e\left(t\right)\end{array}$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 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`).To estimate a discrete-time model, set `'Ts'` to the model sample time using name-value syntax. To estimate MIMO models, use n-v syntax to specify the input and output channels using `'InputName'` and `'OutputName'` to the corresponding timetable variable names. You can also use `'InputName'` and `'OutputName'` to specify specific channels when you do not want to use all the available channels in `tt`. ```
````sys = ssest(u,y,nx,'Ts',Ts)` estimates a discrete-time state-space model using the time-domain input and output signals in the comma-separated matrices `u`,`y` and the model sample time `Ts`. The software assumes that the data sample time is `Ts` seconds. You can use this syntax for SISO, MISO, and MIMO systems.```

example

````sys = ssest(u,y,nx)` estimates a continuous-time state-space model using the signals in the matrices `u`,`y`. The software assumes that the data sample time is 1 second. You cannot change this assumed sample time. If you want to estimate a continuous-time model from data with a sample time other than 1 second, you must first convert your matrix data to a timetable or `iddata` object. Estimating continuous-time models from matrix-based data is not recommended.```

example

````sys = ssest(data,nx)` estimates a continuous-time state-space model using the time-domain or frequency-domain data in the data object `data`. Use this syntax especially when you want to estimate a state-space model using frequency-domain or frequency-response data, or when you want to take advantage of the additional information, such as intersample behavior, data sample time, or experiment labeling, that data objects provide.```

### Estimate Time Series State-Space Model

````sys = ssest(tt,nx)` estimates the continuous time series model `sys` to fit the data in the timetable `tt`. `tt` must contain a single numeric variable. The function interprets the timetable variable data as a time series, which has no inputs and a single output. For a time series model, the `sys` `idss` model has the following form:$\begin{array}{l}\stackrel{˙}{x}\left(t\right)=Ax\left(t\right)+Ke\left(t\right)\\ y\left(t\right)=Cx\left(t\right)+e\left(t\right)\end{array}$```
````sys = ssest(tt,nx,'OutputName',outputVariables,'InputName',[])` estimates a multivariate time series model that uses the timetable output signals that have the variable names specified in `outputVariables`. The function interprets the specified variables as a multivariate time series. If you specify all the variables in `tt` in `'OutputName'`, you can omit the specification of `'InputName'`.```
````sys = ssest([],y,nx,'Ts',Ts)` estimates a discrete time series model with the sample time `Ts` from the output data matrix `y`. `sys` has as many outputs as there are columns in y.```
````sys = ssest(data,nx)` estimates a time series model that uses the data in the `iddata` property `data.OutputData`. The property `data.InputData` must be empty.```

example

````sys = ssest(___,Name,Value)` incorporates additional options specified by one or more name-value pair arguments. For example, specify a discrete-time system from matrix data that has a sample time of 0.1 using `sys = ssest(um,ym,np,'Ts',0.1)`. Specify input and output signal variable names that correspond with the variables to use for MIMO timetable data using ```sys = ssest(data,nx,'InputName',["u1","u2"],'OutputName',["y1","y3"])```. Use the `'Form'`, `'Feedthrough'`, and `'DisturbanceModel'` name-value arguments to modify the default behavior of the A, B, C, D, and K matrices.You can use this syntax with any of the previous input-argument combinations.```

### Configure Initial Parameters

example

````sys = ssest(tt,init_sys)` uses the linear system `init_sys` to configure the initial parameterization of `sys` for estimation using the timetable `tt`.```

example

````sys = ssest(u,y,init_sys)` uses the matrix data `u`,`y` for estimation. If `init_sys` is a continuous-time model, using a timetable instead of matrices is recommended.```

example

````sys = ssest(data,init_sys)` uses the data object `data` for estimation.```

example

````sys = ssest(___,opt)` incorporates an option set `opt` that specifies options such as estimation objective, handling of initial conditions, regularization, and numerical search method used for estimation. You can specify `opt` after any of the previous input-argument combinations.```

### Return Estimated Initial States

example

````[sys,x0] = ssest(___)` returns the value of initial states computed during estimation.```

## Examples

collapse all

Estimate a state-space model and compare its response with the measured output.

Load the input/output data, which is stored in a timetable.

`load sdata1 tt1`

Estimate a fourth-order state-space model.

```nx = 4; sys = ssest(tt1,nx);```

Compare the simulated model response with the measured output.

`compare(tt1,sys)`

The plot shows that the fit percentage between the simulated model and the estimation data is greater than 70%.

You can view more information about the estimation by exploring the `idss` property `sys.Report`.

`sys.Report`
```ans = Status: 'Estimated using SSEST with prediction focus' Method: 'SSEST' InitialState: 'zero' N4Weight: 'CVA' N4Horizon: [6 10 10] Fit: [1x1 struct] Parameters: [1x1 struct] OptionsUsed: [1x1 idoptions.ssest] RandState: [] DataUsed: [1x1 struct] Termination: [1x1 struct] ```

`sys.Report.Termination`
```ans = struct with fields: WhyStop: 'No improvement along the search direction with line search.' Iterations: 7 FirstOrderOptimality: 85.9759 FcnCount: 123 UpdateNorm: 10.0081 LastImprovement: 0 ```

The report includes information on the number of iterations and the reason the estimation stopped iterating.

Load the data, which consists of the input vector `umat1`, the output vector `ymat1`, and the sample time `Ts`.

`load sdata1 umat1 ymat1 Ts`

Combine the data into the single timetable `tt`. View the first two rows of `tt`.

```tt = timetable(umat1,ymat1,'rowtimes',seconds(Ts*(1:size(umat1,1)))); head(tt,2)```
``` Time umat1 ymat1 _______ _____ ________ 0.1 sec 1 -0.58724 0.2 sec -1 1.1082 ```

Use `tt` to estimate a continuous-time state-space model.

`sys = ssest(tt,2);`

Compare the model output with the estimation data.

`compare(tt,sys)`

Load the input-output data `z1`, which is stored in an `iddata` object. This is the same data used to estimate a fourth-order model in State-Space Model.

`load iddata1 z1`

Determine the optimal model order by specifying argument `nx` as a range from `1:10`.

```nx = 1:10; sys = ssest(z1,nx);```

An automatically generated plot shows the Hankel singular values for models of the orders specified by `nx`.

States with relatively small Hankel singular values can be safely discarded. The suggested default order choice is `2`.

Select the model order in the Chosen Order list and click .

`load iddata7 z7;`

Identify a fourth-order state-space model of the data. Specify a known delay of `2` seconds for the first input and `0` seconds for the second input.

```nx = 4; sys = ssest(z7(1:300),nx,'InputDelay',[2;0]);```

Estimate a continuous-time model function by first converting matrix data to a timetable.

Load the data, which includes input matrix `usteam`, output matrix `ysteam`, and sample time `Ts`.

`load sdatasteam.mat usteam ysteam Ts`

Combine `usteam` and `ysteam` into the single timetable `ttsteam`. In order to create a variable for each channel, you must specify each matrix column explicitly.

```tts = timetable(usteam(:,1),usteam(:,2),ysteam(:,1),ysteam(:,2),... 'rowtimes',seconds(Ts*(1:size(usteam,1)))); head(tts,4)```
``` Time Var1 Var2 Var3 Var4 ________ _______ _______ ________ _________ 0.05 sec -1.5283 2.0584 0.57733 -0.12274 0.1 sec 1.4412 -2.005 0.75804 -0.086114 0.15 sec 1.4314 2.0584 -0.76577 -0.19845 0.2 sec 1.4412 -1.9806 0.47721 -0.20577 ```

Estimate a continuous-time state-space model.

```nx = 3; sysc = ssest(tts,nx,'InputName',["Var1" "Var2"],'OutputName',["Var3" "Var4"]);```

Compare the model to the data.

`compare(tts,sysc)`

Modify the canonical form of the A, B, and C matrices, include a feedthrough term in the D matrix, and eliminate disturbance-model estimation in the K matrix.

Load input-output data and estimate a fourth-order system using the `ssest` default options.

```load iddata1 z1 sys1 = ssest(z1,4);```

Specify the companion form and compare the `A` matrix with the default `A` matrix.

```sys2 = ssest(z1,4,'Form','companion'); A1 = sys1.A```
```A1 = 4×4 -0.5155 -3.8483 0.6657 -0.2666 5.8665 -2.7285 1.0649 -1.4694 -0.4487 0.9308 -0.6235 18.8148 -0.4192 0.5595 -16.0688 0.5399 ```
`A2 = sys2.A`
```A2 = 4×4 103 × 0 0 0 -7.1122 0.0010 0 0 -0.9547 0 0.0010 0 -0.3263 0 0 0.0010 -0.0033 ```

Include a feedthrough term and compare `D` matrices.

```sys3 = ssest(z1,4,'Feedthrough',1); D1 = sys1.D```
```D1 = 0 ```
`D3 = sys3.D`
```D3 = 0.0339 ```

Eliminate disturbance modeling and compare `K` matrices.

```sys4 = ssest(z1,4,'DisturbanceModel','none'); K1 = sys1.K```
```K1 = 4×1 0.0520 0.0973 0.0151 0.0270 ```
`K4 = sys4.K`
```K4 = 4×1 0 0 0 0 ```

Specify `ssest` estimate initial states as independent estimation parameters.

`ssest` can handle initial states using one of several methods. By default, `ssest` chooses the method automatically based on your estimation data. You can choose the method yourself by modifying the option set using `ssestOptions`.

Load the input-output data `z1` and estimate a second-order state-space model `sys` using the default options. Use the syntax that returns initial states `x0`.

```load iddata1 z1 [sys,x0] = ssest(z1,2); x0```
```x0 = 2×1 0 0 ```

By default, the estimation is performed using the `'auto'` setting for `InitialState`. Find out which method `ssest` applied by reviewing the value of `InitialState` in `sys.Repor`t.

`sys.Report.InitialState`
```ans = 'zero' ```

The software applied the '`zero'` method, meaning that the software set the initial states to zero instead of estimating them. This selection is consistent with the `0` values returned for `x0`.

Specify that `ssest` estimate the initial states instead as independent parameters using the `'estimate'` setting. Use `ssestOptions` to create a modified option set and specify that option set to estimate a new model.

```opt = ssestOptions('InitialState','estimate'); [sys1,x0] = ssest(z1,2,opt); x0```
```x0 = 2×1 0.0068 0.0052 ```

`x0` now has estimated parameters with nonzero values.

Obtain a regularized fifth-order state-space model for a second-order system from a narrow bandwidth signal.

`load regularizationExampleData eData;`

Create the 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);`

Estimate an unregularized state-space model.

```opt = ssestOptions('SearchMethod','lm'); m = ssest(eData,5,'form','modal','DisturbanceModel','none','Ts',eData.Ts,opt);```

Estimate a regularized state-space model.

```opt.Regularization.Lambda = 10; mr = ssest(eData,5,'form','modal','DisturbanceModel','none','Ts',eData.Ts,opt);```

Compare the model outputs with the estimation data.

`compare(eData,m,mr);`

Compare the model impulse responses.

```impulse(trueSys,m,mr,50); legend('trueSys','m','mr');```

Estimate a state-space model of measured input-output data. Configure the parameter constraints and initial values for estimation using a state-space model.

Create an `idss` model to specify the initial parameterization for estimation.

```A = blkdiag([-0.1 0.4; -0.4 -0.1],[-1 5; -5 -1]); B = [1; zeros(3,1)]; C = [1 1 1 1]; D = 0; K = zeros(4,1); x0 = [0.1 0.1 0.1 0.1]; Ts = 0; init_sys = idss(A,B,C,D,K,x0,Ts);```

Setting all entries of `K` to `0` creates an `idss` model with no state disturbance element.

Use the `Structure` property to fix the values of some of the model parameters. Configure the model so that `B` and `K` are fixed, and only the nonzero entries of `A` are estimable.

```init_sys.Structure.A.Free = (A~=0); init_sys.Structure.B.Free = false; init_sys.Structure.K.Free = false;```

The entries in `init_sys.Structure.A.Free` determine whether the corresponding entries in `init_sys.A` are free (`true`) or fixed (`false`).

Load the measured data and estimate a state-space model using the parameter constraints and initial values specified by `init_sys`.

```load iddata2 z2; sys = ssest(z2,init_sys);```

The estimated parameters of `sys` satisfy the constraints specified by `init_sys`.

## Input Arguments

collapse all

Estimation data, specified as a uniformly sampled `timetable` that contains variables representing input and output channels or, for multiexperiment data, a cell array of timetables.

#### Use Entire Timetable

If you want to use all the variables in `tt` as input or output channels, and the variables are organized so that the set of input channel variables is followed by the set of output channel variables, then:

• For SISO systems, specify `tt` as an Ns-by-2 timetable, where Ns is the number of samples and the two timetable variables represent the measured input channel and output channel respectively.

• For MIMO systems, specify `tt` as an Ns-by-(Nu+Ny) timetable, where Nu is the number of inputs and Ny is the number of outputs. The first Nu variables must contain the input channels and the remaining Ny variables must contain the output channels.

When you are estimating state space or transfer function models, you must also explicitly specify the input and output channels, as the following section describes.

• For multiexperiment data, specify data as an Ne-by-1 cell array of timetables, where Ne is the number of experiments. The sample times of all the experiments must match.

#### Use Selected Variables from Timetable

If you want to explicitly identify the input and output channels, such as when you want to use only a subset of the available channels, when the input and output channel variables are intermixed, or when you are estimating a MIMO state-space or transfer function model, use the `'InputName'` and `'OutputName'` name-value arguments to specify which variables to use as inputs and outputs.

For example, suppose that `tt` contains six channel variables: `"u1"`, `"u2"`, `"u3"`, and `"y1"`, `"y2"`, `"y3"`. For estimation, you want to use the variables `"u1"` and `"u2"` as the inputs and the variables `"y1"` and `"y3"` as the outputs. Use the following command to perform the estimation:

```sys = ssest(tt,__,'InputName',["u1" "u2"],'OutputName',["y1" "y3"])```

#### Use Timetable to Estimate Time Series Models

If you want to estimate a time series model rather than an input/output model, use only output variables from `tt`. You can either specify `tt` to contain only the output variables that you want, or extract the output variables from `tt` if `tt` also contains input variables. The specification approach is similar to that for input/output model estimation.

• For a single-output system, specify `tt` as an Ns-by-1 timetable.

• For a multivariate system, specify `tt` as an Ns-by-(Ny) timetable. Even if you plan to use all the variables in `tt`, you must specify all of them using the `'OutputName'` name-value argument so that the software does not interpret them as input variables.

For a timetable `tt` that has variables beyond what you want to use, such as input variables or additional output variables, specify both the output variables you want to use and, in `'InputName'`, an empty array.

For example, suppose that `tt` contains six variables: `"u1"`, `"u2"`, `"u3"`, and `"y1"`, `"y2"`, `"y3"`. For time series estimation, you want to use the output variables `"y1"` and `"y3"`. Use the following command to perform the estimation:

```sys = ssest(tt,__,'OutputName',["y1" "y3"],'InputName',[])```

Estimation data, specified for SISO systems as a comma-separated pair of Ns-by-1 real-valued matrices that contain uniformly sampled input and output time-domain signal values. Here, Ns is the number of samples.

For MIMO systems, specify `u`,`y` as an input/output matrix pair with the following dimensions:

• `u`Ns-by-Nu, where Nu is the number of inputs.

• `y`Ns-by-Ny, where Ny is the number of outputs.

For multiexperiment data, specify `u`,`y` as a pair of 1-by-Ne cell arrays, where Ne is the number of experiments. The sample times of all the experiments must match.

For time series data, which contains only outputs and no inputs, specify `y` only.

#### Limitations

Estimation data object, specified as an `iddata` object, an `frd` object, or an `idfrd` object that contains uniformly sampled input and output values. By default, the software sets the sample time of the model to the sample time of the estimation data.

For multiexperiment data, the sample times and intersample behavior of all the experiments must match.

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` (Control System Toolbox) or `idfrd`)

• `iddata` object with properties specified as follows:

• `InputData` — Fourier transform of the input signal

• `OutputData` — Fourier transform of the output signal

• `Domain``'Frequency'`

#### Limitations

You cannot estimate continuous-time models using discrete-time frequency-domain data.

Order of the estimated model, specified as a nonnegative integer or as a vector containing a range of positive integers.

• If you already know what order you want your estimated model to have, specify `nx` as a scalar.

• If you want to compare a range of potential orders to choose the most effective order for your estimated model, specify the range in `nx`. `ssest` creates a Hankel singular-value plot that shows the relative energy contributions of each state in the system. States with relatively small Hankel singular values contribute little to the accuracy of the model and can be discarded with little impact. The index of the highest state you retain is the model order. The plot window includes a suggestion for the order to use. You can accept this suggestion or enter a different order. For an example, see Determine Optimal Estimated Model Order.

If you do not specify `nx`, or if you specify `nx` as `best`, the software automatically chooses `nx` from the range `1:10`.

• If you are identifying a static system, set `nx` to `0`.

Estimation options, specified as an `ssestOptions` option set. Options specified by `opt` include:

• Estimation objective

• Handling of initial conditions

• Regularization

• Numerical search method used for estimation

• Intersample behavior

For examples showing how to use `opt`, see Estimate Initial States as Independent Parameters and Estimate State-Space Model Using Regularization.

Linear system that configures the initial parameterization of `sys`, specified as an `idss` model or as a structure. You obtain `init_sys` by either performing an estimation using measured data or by direct construction.

If `init_sys` is an `idss` model, `ssest` uses the parameter values of `init_sys` as the initial guess for estimating `sys`. For information on how to specify `idss`, see Estimate State-Space Models with Structured Parameterization. `ssest` honors constraints on the parameters of `init_sys`, such as fixed coefficients and minimum/maximum bounds.

Use the `Structure` property of `init_sys` to configure initial parameter values and constraints for the A, B, C, D, and K matrices. For example:

• To specify an initial guess for the A matrix of `init_sys`, set `init_sys.Structure.A.Value` as the initial guess.

• To specify constraints for the B matrix of `init_sys`:

• Set `init_sys.Structure.B.Minimum` to the minimum B matrix value

• Set `init_sys.Structure.B.Maximum` to the maximum B matrix value

• Set `init_sys.Structure.B.Free` to indicate if entries of the B matrix are free parameters for estimation

To set more complex constraints, such as interdependence of coefficients, use grey-box estimation using `greyest` and `idgrey`.

You must assign finite initial values for all matrix parameters.

If `init_sys` is not a state-space (`idss`) model, the software first converts `init_sys` to an `idss` model. `ssest` uses the parameters of the resulting model as the initial guess for estimation.

If you do not specify `opt` and `init_sys` was obtained by estimation, then the software uses estimation options from `init_sys.Report.OptionsUsed`.

For an example, see Estimate Partially Known State-Space Model Using Structured Estimation.

### Name-Value Arguments

Specify optional pairs of arguments as `Name1=Value1,...,NameN=ValueN`, where `Name` is the argument name and `Value` is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose `Name` in quotes.

Example: `sys = ssest(data,nx,'Ts',0.1)`

Input channel names for timetable data, specified as a string, a character vector, or an array or cell array of strings or character vectors. By default, the software interprets all but the last variable in `tt` as input channels. When you want to select a subset of the timetable variables as input channels use `'InputName'` to identify them. For example, ```sys = ssest(tt,__,'InputName',["u1" "u2"])``` selects the variables `u1` and `u2` as the input channels for the estimation.

Output channel names for timetable data, specified as a string, a character vector, or an array or cell array of strings or character vectors. By default, the software interprets the last variable in `tt` as the sole output channel. When you want to select a subset of the timetable variables as output channels, use `'OutputName'` to identify them. For example, ```sys = ssest(tt,__,'OutputName',["y1" "y3"])``` selects the variables `y1` and `y3` as the output channels for the estimation.

Sample time of the estimated model, specified as the comma-separated pair consisting of `'Ts'` and either `0` or a positive scalar.

• For continuous-time models, specify `'Ts'` as `0`.

• For discrete-time models, specify `'Ts'` as the data sample time in units defined by the following:

• For timetable-based data — The timetable `Time` column

• For matrix-based data — Seconds

• For data objects, such as `iddata` objects — The `data.TimeUnit` property

To obtain the data sample time for a timetable `tt`, use the timetable property `tt.Properties.Timestep`.

Input delay for each input channel, specified as the comma-separated pair consisting of `'InputDelay'` and a numeric vector.

• For continuous-time models, specify `'InputDelay'` in the time units stored in the timetable, the data object `TimeUnit` property, or, for matrix data, in seconds.

• For discrete-time models, specify `'InputDelay'` in integer multiples of the sample time `Ts`. For example, setting `'InputDelay'` to `3` specifies 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. For an example, see Identify State-Space Model with Input Delay.

To apply the same delay to all channels, specify `InputDelay` as a scalar.

Type of canonical form of `sys`, specified as the comma-separated pair consisting of `'Form'` and one of the following values:

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

• `'modal'` — Obtain `sys` in modal form.

• `'companion'` — Obtain `sys` in companion form.

• `'canonical'` — Obtain `sys` in the observability canonical form.

For definitions of the canonical forms, see State-Space Realizations.

For more information, see Estimate State-Space Models with Canonical Parameterization. For an example, see Modify Form, Feedthrough, and Disturbance-Model Matrices.

Direct feedthrough from input to output, specified as the comma-separated pair consisting of `'Feedthrough'` and a logical vector of length Nu, where Nu is the number of inputs. If you specify `Feedthrough` as a logical scalar, that value is applied to all the inputs. For static systems, the software always assumes `'Feedthrough'` is `1`.

For an example, see Modify Form, Feedthrough, and Disturbance-Model Matrices.

Option to estimate time-domain noise component parameters in the K matrix, specified as the comma-separated pair consisting of `'DisturbanceModel'` and one of the following values:

• `'estimate'` — Estimate the noise component. The K matrix is treated as a free parameter.

• `'none'` — Do not estimate the noise component. The elements of the K matrix are fixed at zero.

For frequency-domain data, the software assumes that `'DisturbanceModel'` is `'none'`.

For an example, see Modify Form, Feedthrough, and Disturbance-Model Matrices.

## Output Arguments

collapse all

Identified state-space model, returned as an `idss` model. This model is created using the specified model orders, delays, and estimation options.

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

Report FieldDescription
`Status`

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

`Method`

Estimation command used.

`InitialState`

How initial states were handled during estimation, returned as one of the following values:

• `'zero'` — The initial state is set to zero.

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

• `'backcast'` — The initial state is estimated using the best least squares fit.

• Column vector of length Nx, where Nx is the number of states. For multi-experiment data, a matrix with Ne columns, where Ne is the number of experiments.

• Parametric initial condition object (`x0obj`) created using `idpar`. Only for discrete-time state-space models.

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

`N4Weight`

Weighting scheme used for singular-value decomposition by the N4SID algorithm, returned as one of the following values:

• `'MOESP'` — Uses the MOESP algorithm.

• `'CVA'` — Uses the Canonical Variate Algorithm.

• `'SSARX'` — A subspace identification method that uses an ARX estimation-based algorithm to compute the weighting.

This option is especially useful when the `N4Weight` option in the estimation option set is `'auto'`.

`N4Horizon`

Forward and backward prediction horizons used by the N4SID algorithm, returned as a row vector with three elements — ` [r sy su]`, where `r` is the maximum forward prediction horizon. `sy` is the number of past outputs, and `su` is the number of past inputs that are used for the predictions.

`Fit`

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:

FieldDescription
`FitPercent`

Normalized root mean squared error (NRMSE) measure of how well the response of the model fits the estimation data, expressed as the percentage fitpercent = 100(1-NRMSE).

`LossFcn`

Value of the loss function when the estimation completes.

`MSE`

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

`FPE`

Final prediction error for the model.

`AIC`

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

`AICc`

Small-sample-size corrected AIC.

`nAIC`

Normalized AIC.

`BIC`

Bayesian Information Criteria (BIC).

`Parameters`

Estimated values of model parameters.

`OptionsUsed`

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

`RandState`

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

`DataUsed`

Attributes of the data used for estimation. Structure with the following fields:

FieldDescription
`Name`

Name of the data set.

`Type`

Data type.

`Length`

Number of data samples.

`Ts`

Sample time. This is equivalent to `Data.Ts`.

`InterSample`

Input intersample behavior. 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.

The value of `Intersample` has no effect on estimation results for discrete-time models.

`InputOffset`

Offset removed from time-domain input data during estimation.

`OutputOffset`

Offset removed from time-domain output data during estimation.

`Termination`

Termination conditions for the iterative search used for prediction error minimization, returned as a structure with the following fields:

FieldDescription
`WhyStop`

Reason for terminating the numerical search.

`Iterations`

Number of search iterations performed by the estimation algorithm.

`FirstOrderOptimality`

$\infty$-norm of the gradient search vector when the search algorithm terminates.

`FcnCount`

Number of times the objective function was called.

`UpdateNorm`

Norm of the gradient search vector in the last iteration. Omitted when the search method is `'lsqnonlin'` or `'fmincon'`.

`LastImprovement`

Criterion improvement in the last iteration, expressed as a percentage. Omitted when the search method is `'lsqnonlin'` or `'fmincon'`.

`Algorithm`

Algorithm used by `'lsqnonlin'` or `'fmincon'` search method. Omitted when other search methods are used.

For estimation methods that do not require numerical search optimization, the `Termination` field is omitted.

For more information on using `Report`, see Estimation Report.

Initial states computed during the estimation, returned as an array containing a column vector corresponding to each experiment.

This array is also stored in the `Parameters` field of the model `Report` property.

For an example, see Estimate Initial States as Independent Parameters.

## Algorithms

`ssest` initializes the parameter estimates using either a noniterative subspace approach or an iterative rational function estimation approach. It then refines the parameter values using the prediction error minimization approach. For more information, see `pem` and `ssestOptions`.

## References

[1] Ljung, L. System Identification: Theory for the User, Second Edition. Upper Saddle River, NJ: Prentice Hall PTR, 1999.

## Version History

Introduced in R2012a

expand all