LagOp class


Create lag operator polynomial (LagOp) object


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


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


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.


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.


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


Lag operator polynomial (LagOp) object.



Lag indexed cell array of nonzero polynomial coefficients


Polynomial degree (the highest lag associated with a nonzero coefficient)


Polynomial dimension (the number of time series to which it may be applied)


Polynomial lags associated with nonzero coefficient


filterApply lag operator polynomial to filter time series
isEqLagOpDetermine if two LagOp objects are same mathematical polynomial
isNonZeroFind lags associated with nonzero coefficients of LagOp objects
isStableDetermine stability of lag operator polynomial
minusLag operator polynomial subtraction
mldivideLag operator polynomial left division
mrdivideLag operator polynomial right division
mtimesLag operator polynomial multiplication
plusLag operator polynomial addition
reflectReflect lag operator polynomial coefficients around lag zero
toCellArrayConvert lag operator polynomial object to cell array

Copy Semantics

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


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.


collapse all

Create a LagOp object that represents the lag operator polynomial


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.