# LagOp class

Superclasses:

Create lag operator polynomial (LagOp) object

## Description

Create a lag operator polynomial A(L), by specifying the coefficients and, optionally, the corresponding lags.

## Construction

```A = LagOp(coefficients)```

`A = LagOp(coefficients,Name,Value)` creates a lag operator polynomial with additional options specified by one or more `Name,Value` pair arguments. `Name` can also be a property name and `Value` is the corresponding value. `Name` must appear inside single quotes (`''`). You can specify several name-value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

### Input Arguments

 `coefficients` The coefficients of the lag operator polynomial. Generally, `coefficients` is a cell array of square matrices. For convenience, coefficients may also be specified in other ways: As a vector, representing a univariate time series polynomial with multiple lags.As a matrix, representing a multivariate time series polynomial with a single lag.As an existing `LagOp` object, to be updated according to the optional inputs.

#### 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 quotes. You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

 `'Lags'` Vector of integer lags associated with the polynomial coefficients. If specified, the number of lags must be the same as the number of coefficients.Default: Coefficients are associated with lags 0, 1,..., `numCoefficients`–1. `'Tolerance'` Nonnegative scalar tolerance used to determine which lags are included in the object. Specifying a tolerance greater than the default (`1e–12`) excludes lags with near-zero coefficients. A lag is excluded if the magnitudes of all elements of the coefficient matrix are less than or equal to the specified tolerance. Default: `1e–12`

## Output Arguments

 `A` Lag operator polynomial (`LagOp`) object.

## Properties

 `Coefficients` Lag indexed cell array of nonzero polynomial coefficients `Degree` Polynomial degree (the highest lag associated with a nonzero coefficient) `Dimension` Polynomial dimension (the number of time series to which it may be applied) `Lags` Polynomial lags associated with nonzero coefficient

## Methods

 filter Apply lag operator polynomial to filter time series isEqLagOp Determine if two `LagOp` objects are same mathematical polynomial isNonZero Find lags associated with nonzero coefficients of `LagOp` objects isStable Determine stability of lag operator polynomial minus Lag operator polynomial subtraction mldivide Lag operator polynomial left division mrdivide Lag operator polynomial right division mtimes Lag operator polynomial multiplication plus Lag operator polynomial addition reflect Reflect lag operator polynomial coefficients around lag zero toCellArray Convert lag operator polynomial object to cell array

## Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects (MATLAB).

## Indexing

The coefficients of lag operator polynomials are accessible by lag-based indexing; that is, by specifying nonnegative integer lags associated with the coefficients of interest.

## Examples

collapse all

Create a `LagOp` object that represents the lag operator polynomial

`$A\left(L\right)=1-0.6L+0.08{L}^{2}.$`

`A = LagOp([1 -0.6 0.08])`
```A = 1-D Lag Operator Polynomial: ----------------------------- Coefficients: [1 -0.6 0.08] Lags: [0 1 2] Degree: 2 Dimension: 1 ```

Display the coefficient of lag 0.

`a0 = A.Coefficients{0}`
```a0 = 1 ```

Assign a nonzero coefficient to the 3rd lag:

`A.Coefficients{3} = 0.5`
```A = 1-D Lag Operator Polynomial: ----------------------------- Coefficients: [1 -0.6 0.08 0.5] Lags: [0 1 2 3] Degree: 3 Dimension: 1 ```

The polynomial degree increases to `3`.