# ssest

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

## Syntax

## Description

### Estimate State-Space Model

estimates the continuous-time state-space model `sys`

= ssest(`tt`

,`nx`

)`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}\dot{x}(t)=Ax(t)+Bu(t)+Ke(t)\\ y(t)=Cx(t)+Du(t)+e(t)\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`

.

estimates a discrete-time state-space model using the time-domain input and output signals
in the comma-separated matrices `sys`

= ssest(`u`

,`y`

,`nx`

,`'Ts'`

,`Ts`

)`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.

estimates a continuous-time state-space model using the signals in the matrices
`sys`

= ssest(`u`

,`y`

,`nx`

)`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.

estimates a continuous-time state-space model using the time-domain or frequency-domain
data in the data object `sys`

= ssest(`data`

,`nx`

)`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

estimates the continuous time series model `sys`

= ssest(`tt`

,`nx`

)`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}\dot{x}(t)=Ax(t)+Ke(t)\\ y(t)=Cx(t)+e(t)\end{array}$$

estimates a multivariate time series model that uses the timetable output signals that
have the variable names specified in `sys`

= ssest(`tt`

,`nx`

,`'OutputName'`

,outputVariables,`'InputName'`

,[])`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'`

.

### Specify Additional Model Options

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(___,`Name,Value`

)`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

### Specify Additional Estimation Options

## Examples

## Input Arguments

## Output Arguments

## 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**

## See Also

### Functions

`ssestOptions`

|`ssregest`

|`idss`

|`n4sid`

|`tfest`

|`procest`

|`polyest`

|`iddata`

|`idfrd`

|`canon`

|`idgrey`

|`pem`

### Live Editor Tasks

### Topics

- Estimate State-Space Models at the Command Line
- Estimate State-Space Models with Free-Parameterization
- Estimate State-Space Models with Canonical Parameterization
- Estimate State-Space Models with Structured Parameterization
- Use State-Space Estimation to Reduce Model Order
- What Are State-Space Models?
- Supported State-Space Parameterizations
- State-Space Model Estimation Methods
- Regularized Estimates of Model Parameters
- Estimating Models Using Frequency-Domain Data