# System identification

## Overview

LPVcore contains state-of-the-art identification algorithms for several model structures. On this page, a brief overview is given of the classes and functions, including the specific methods, that can be used to perform identification. First, the classes representing model structures with identifiable parameters are given. Then, The available algorithms and corresponding functions for the identification of these model structures are presented. Finally, a table containing references to each algorithm is given.

## Model structures

`LPVcore`

package pre-fixSimilar to the core system representation objects, all system representation objects with identifiable parameters must be prefixed with `LPVcore.`

upon instantiation.

`LPVcore.lpvidpoly`

The `LPVcore.lpvidpoly`

class represents a DT or CT polynomial model structure similar to `idpoly`

of the System Identification Toolbox. More specifically, the following rather general model structure is supported:

with $\xi$ being either differentiation $\frac{d}{dt}$ in CT or backward time-shift $\q^{-1}$ in DT, while $A$, $B$, $C$, $D$, and $F$ are polynomials similar to $A$ and $B$ from `LPVcore.lpvio`

. All polynomials except $B$ are required to be monic. $e$ is a white noise signal with a variance either specified by the user or estiamted from data. Based on the general model structure, ARX, ARMAX, OE, and BJ model structures can be constructed by setting certain polynomials to identity.

- give overview of the various configurations

For example, the following code snippet shows the construction of a DT LPV-OE model structure with a noise variance of 0.1 and a sampling time of 1 second:

`rho = preal('rho', 'dt'); % scheduling variable`

NoiseVariance = 1E-1; % noise variance spec.

Ts = 1; % sampling time in seconds

B = {1 - rho, rho^2}; % Creation of the coefficients of a 2nd order B-polynomial

F = {1, rho, rho^2}; % Creation of the coefficients of a 2nd order F-polynomial

model = LPVcore.lpvidpoly([], B, [], [], F, NoiseVariance, Ts);

Many methods that work with `idpoly`

objects have been extended to function properly for `LPVcore.lpvidpoly`

objects. For example, the `nparams`

function can be used to find the number of (free) model parameters:

`model = LPVcore.lpvidpoly(...);`

nparams(model);

nparams(model, 'free')

For a complete overview of the available functions, type `doc LPVcore.lpvidpoly`

.

The expected format for the polynomials (a cell array of `pmatrix`

objects) differs from the convention used by `idpoly`

. For example, `idpoly`

expects an $N_y$-by-$N_y$ cell array of row vectors for the specification of $A$, where each element of the row vector corresponds to a coefficient. In contrast, `LPVcore.lpvidpoly`

does not expect the size of the cell array to reflect the number of inputs or outputs. Instead, the size of each cell array entry (`pmatrix`

object) should be consistent with the number of inputs or outputs.

`LPVcore.lpvidss`

The `LPVcore.lpvidss`

class represents an LPV-SS representation with innovation noise model similar to the `idss`

class of the System Identification Toolbox:

Furthermore, the following model structure with general noise model is also supported:

where the white noise processes $e$ and $v$ are normally distributed according to a specified variance. The following code snippet constructs a DT `LPVcore.lpvidss`

model structure with innovation noise model with variance 0.1 and sampling time 1 second:

`rho = preal('rho', 'dt');`

NoiseVariance = 1E-1;

Ts = 1; % seconds

A = randn(3) * rho;

B = ones(3, 1) + ones(3, 1) * rho^2;

K = ones(3, 1);

C = ones(1, 3);

D = zeros(1);

model = LPVcore.lpvidss(A, B, C, D, 'innovation', K, [], NoiseVariance, Ts);

`LPVcore.lpvobf`

OBF based model structures involve a fitler bank of orthonormal basis functions generated by a set of pole locations and parameter-varying expansion coefficient blocks preceeding or following the OBF bank or they are in feedback connection with it, see link for detials. In LPVcore only the first two options are implemented currently, called the Wiener and Hammerstein configurations.

- Introduce general form
- Give example

## Data generation

The defined model structures can be also used to define a data-generating system or their predictied or simulated responses with respect to given input trajectories can be easily computed.

- data generation (lsim)
- data set creation, plotting etc. (iddata)

## Algorithms

### Template-based model specification

As in the LPV case, not only the order of the polynomials or state-dimension of various model structure specifications can vary, but also specificaiton of the type of dependency of each coefficent, hence a flexible, yet simple way of specifying orders and coefficent depedencies via templates have been introduce. Hence, all system identification methods in LPVcore rely on the specification of a *model template* object. Such an object specifies involved dimensions, orders, scheduling dependence, and non-free model parameters (for graybox identification). The model template objects are standard `LPVcore.lpvrep`

objects: algorithms estimating IO models often require a template representation in the form of an `LPVcore.lpvidpoly`

object, while algorithms estimating SS models often require an `LPVcore.lpvidss`

object.

The primary function of the templates is to specify structure and the values of the model parameters of the template representation are by default not used in the estiamtion algorithms. However, it can be specified by the user for the algorithm to use the template parameters for (i) intitializaiton or (ii) as fixed parameter values in case of graybox identification. The documentation for a particular algorithm indicates under which conditions the value of the model parameters is considered as an initial guess or kept fixed during estimation.

### Prediction Error Methods (PEM)

Besides of linear least-squares estimation of ARX models, two types of approaches for PEM are available in LPVcore for the estimation of general `LPVcore.lpvidpoly`

models:

- Gradient-based PEM for the identification of LPV-IO and LPV-SS model structures.
- Pseudo-linear least squares PEM for the identification of LPV-IO model structures.

For `LPVcore.lpvidpoly`

model structures, a PEM identification can be invoked using the `lpvpolyest`

command. The estimation is configured through the use of the `lpvpolyestOptions`

object. Both aforementioned commands function in a similar way to `polyest`

and `polyestOptions`

as found in the System Identification Toolbox.

For each specific variant of the general polynomial models there is a specilised estiamtion approach:

ARX

ARMAX

ARMA

OE

BJ

EXAMPLES

For PEM identification of SS model, i.e., `LPVcore.lpvidss`

model structures, the `lpvssest`

command can be used.

- EXAMPLE

### Instrumental Variable Methods (IB)

### Subspace

LPVcore contains a work-in-progress (WIP) version of a subspace algorithm for the estimation of an `LPVcore.lpvidss`

model structure with an innovation noise model. The algorithm is called LPV-PBSIDopt (original paper: link). Compared to the original paper, the version in LPVcore offers more flexibility:

- The output equation (i.e., the $C$ and $D$ matrices) is allowed to be scheduling dependent.
- Each scheduling dependent matrix can have its own number and type of basis functions.

To accomplish the additional flexibility, the implementation requires additional derivations not contained in the original paper. Therefore, a PDF file containing these derivations is included here for the interested reader:

Extensions of LPV-PBSIDopt for LPVcore (PDF)### Local LPV-LFR identification

*This section is still a work-in-progress!*

The local LPV-LFR identification approach is available under the function `hinfid`

. It requires the following inputs:

- A cell array of LTI models.
- A cell array of values of the frozen extended scheduling signal corresponding to the operating points of the provided LTI models.
- An
`LPVcore.lpvlfr`

model object providing the structure of the scheduling dependence and the initial values of the coefficients. - Optionally, an
`hinfstructOptions`

options set, since the`hinfid`

method relies on the`hinfstruct`

command to perform the optimization. This option set is directly passed to the`hinfstruct`

command.

A typical workflow for identifying an LPV-LFR model from local data is as follows:

- Identify the local LTI models using, e.g., the System Identification Toolbox.
- Define the model structure in terms of the scheduling dependence and construct an
`LPVcore.lpvlfr`

model based on this. - Pass the identified local LTI models, along with the operating points and
`LPVcore.lpvlfr`

model, to`hinfid`

.

A model structure for LPV-LFR system representation is not yet available. Thus, setting model parameters non-free is not possible.

## Model (In)Validation

- examplain compare

## References

Model type | Data type | Algoritm | Reference | Status |
---|---|---|---|---|

IO | Global | Gradient-based PEM (ARX, ARMAX, OE, BJ) | link, link | ✔️ |

IO | Global | Pseudo-Linear Least Squares PEM (ARX, ARMAX, OE, BJ) | link | ✔️ |

SS | Global | Gradient-based search for DDLC parametrized LPV-SS identification | link (Algorithm 7.1) | ✔️ |

SS | Global | $\mathrm{LPV-PBSID_{opt}}$ (with kernelization) | link | ✔️ |

LFR | Local | An $H_{\infty}$ optimization based approach for behavioral interpolation | link | ✔️ |