Main Content

mldivide, \

Apply left division to lag operator polynomials

Description

The mldivide function applies left division to input lag operator polynomials, which are specified by LagOp model objects (see Lag Operator Polynomial Left Division). To solve systems of linear equations by applying left division to matrices, see mldivide.

B = A\C or B = mldivide(A,C) returns the quotient B, the LagOp lag operator polynomial resulting from the left division of the lag operator polynomials A and C.

example

B = mldivide(A,C,Name=Value) specifies options using one or more name-value arguments. For example, mldivide(A,C,Degree=10,Window=5) returns a quotient lag operator polynomial with a maximum degree of 10 and terminates the division algorithm when 5 consecutive lag coefficients satisfy the termination tolerances.

example

Examples

collapse all

Consider the lag operator polynomials

A(L)=1-0.6L+0.08L2C(L)=1-0.5L.

Represent A(L) and C(L) in MATLAB®.

A = LagOp({1 -0.6 0.08});
C = LagOp({1 -0.5});

A and C are LagOp lag operator polynomial objects.

Left-divide C(L) by A(L).

B = A\C
B = 
    1-D Lag Operator Polynomial:
    -----------------------------
        Coefficients: [1 0.1 -0.02 -0.02 -0.0104]
                Lags: [0 1 2 3 4]
              Degree: 4
           Dimension: 1

B is a LagOp lag operator polynomial object representing the quotient polynomial B(L)=1+0.1L-0.02L2-0.02L3-0.0104L4.

Consider the lag operator polynomial

A(L)=1-0.6L+0.08L2

Represent A(L) in MATLAB®.

A = LagOp({1 -0.6 0.08});

Compute the left inverse A(L) by Left dividing 1 by A(L).

Ainv = A\1
Ainv = 
    1-D Lag Operator Polynomial:
    -----------------------------
        Coefficients: [1 0.6 0.28 0.12 0.0496 0.02016]
                Lags: [0 1 2 3 4 5]
              Degree: 5
           Dimension: 1

Ainv is a LagOp lag operator polynomial representing the inverse polynomial of A(L).

Verify that AL-1(L) is the left inverse of A(L), up to the precision implied by the specified tolerances.

Ainv*A
ans = 
    1-D Lag Operator Polynomial:
    -----------------------------
        Coefficients: [1 -0.008128 0.0016128]
                Lags: [0 6 7]
              Degree: 7
           Dimension: 1

The result is not exactly the identity. For more precision, adjust the tolerances.

Consider the lag operator polynomials

A(L)=[1001]+[0.9000.4]L4C(L)=[1001]+[0.8-0.3-0.50.2]L2.

Represent the 2-D lag operator polynomials A(L) and C(L) in MATLAB®.

A = LagOp({eye(2) [0.9 0; 0 0.4]},Lags=[0 4]);
C = LagOp({eye(2) [0.8 -0.3; -0.5 0.2]},Lags=[0 2]);

Left-divide C(L) by A(L).

B = A\C
B = 
    2-D Lag Operator Polynomial:
    -----------------------------
        Coefficients: [Lag-Indexed Cell Array with 87 Non-Zero Coefficients]
                Lags: [Lags Associated with 87 Non-Zero Coefficients]
              Degree: 172
           Dimension: 2
BLag0 = B.Coefficients{0}
BLag0 = 2×2

     1     0
     0     1

BLag1 = B.Coefficients{1}
BLag1 = 2×2

     0     0
     0     0

BLag2 = B.Coefficients{2}
BLag2 = 2×2

    0.8000   -0.3000
   -0.5000    0.2000

BLag3 = B.Coefficients{3}
BLag3 = 2×2

     0     0
     0     0

BLag4 = B.Coefficients{4}
BLag4 = 2×2

   -0.9000         0
         0   -0.4000

BLag5 = B.Coefficients{5}
BLag5 = 2×2

     0     0
     0     0

BLag6 = B.Coefficients{6}
BLag6 = 2×2

   -0.7200    0.2700
    0.2000   -0.0800

B is a LagOp lag operator polynomial object approximating the quotient polynomial

B(L)=[1001]+[0.8-0.3-0.50.2]L2+[0.9000.4]L4+[-0.720.270.2-0.08]L6+.

B(L) is likely an infinite sum, whereas B is a 172-degree approximation of B(L), truncated according to the numerical tolerances.

Consider the lag operator polynomial

A(L)=1-0.6L+0.08L2

Represent A(L) in MATLAB®. Compute its left inverse. Adjust the tolerances:

  • Set the absolute tolerance to 1e-14.

  • Set the relative tolerance to 1e-4.

  • Ensure tolerances are achieved within a window of 50 lags.

A = LagOp({1 -0.6 0.08});
Ainv = mldivide(A,1,AbsTol=1e-14,RelTol=1e-4,Window=50)
Ainv = 
    1-D Lag Operator Polynomial:
    -----------------------------
        Coefficients: [1 0.6 0.28 0.12 0.0496 0.02016 0.008128 0.003264 0.00130816 0.000523776 0.000209613]
                Lags: [0 1 2 3 4 5 6 7 8 9 10]
              Degree: 10
           Dimension: 1

Verify that AL-1(L) is the left inverse of A(L), up to the precision implied by the specified tolerances.

Ainv*A
ans = 
    1-D Lag Operator Polynomial:
    -----------------------------
        Coefficients: [1 -8.38656e-05 1.6769e-05]
                Lags: [0 11 12]
              Degree: 12
           Dimension: 1

The result is closer to the identity than the result using the default, less stringent tolerance settings.

Input Arguments

collapse all

Denominator (divisor) in the expression A(L)\C(L), specified as a LagOp lag operator polynomial object returned by LagOp, a cDim-by-cDim numeric matrix, or a cell vector of cDim-by-cDim numeric matrices, where cDim = C.Dimension.

The lag 0 coefficient matrix must be invertible.

When you specify a numeric matrix or a cell vector of numeric matrices, these conditions apply:

  • mldivide creates a degree 0 lag operator polynomial and sets the lag 0 coefficient to the input numeric matrix.

  • mldivide dispatches the input cell vector of numeric matrices to LagOp to create a lag operator polynomial.

  • C must be a LagOp object.

Numerator (dividend) in the expression A(L)\C(L), specified as a LagOp lag operator polynomial object returned by LagOp or an aDim-by-aDim numeric matrix, or a cell vector of aDim-by-aDim numeric matrices, where aDim = A.Dimension.

When you specify a numeric matrix, these conditions apply:

  • mldivide creates a degree 0 lag operator polynomial and sets the lag 0 coefficient to the input numeric matrix.

  • mldivide dispatches the input cell vector of numeric matrices to LagOp to create a lag operator polynomial.

  • A must be a LagOp object.

Name-Value Arguments

collapse all

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.

Example: mldivide(A,C,Degree=10,Window=5) returns a quotient lag operator polynomial with a maximum degree of 10 and terminates the division algorithm when 5 consecutive lag coefficients satisfy the termination tolerances.

Absolute tolerance to determine which lag coefficients to include in quotient, specified as a nonnegative scalar.

AbsTol is a termination criterion of the calculation of quotient coefficients. mldivide uses AbsTol to exclude polynomial lags with near-zero coefficients; mldivide excludes a coefficient matrix for a given lag when the magnitudes of all elements of the matrix are less than or equal to AbsTol.

Example: AbsTol=1e-10

Data Types: double

Relative tolerance to determine which lag coefficients to include in quotient, specified as a nonnegative scalar.

RelTol is a termination criterion of the calculation of quotient coefficients. At each lag, mldivide calculates a coefficient matrix, and then mldivide compares the coefficient's 2-norm to the largest coefficient 2-norm. If the ratio of the current norm to the largest norm is less than or equal to RelTol, the relative termination criterion is satisfied.

Example: RelTol=0.005

Data Types: double

Window size used to check termination tolerances, specified as a positive integer. Window represents the number of consecutive lags for which coefficients must satisfy the tolerance-based termination criteria AbsTol and RelTol, in order to terminate the calculation of the quotient coefficients. If coefficients in Window consecutive lags are below the specified tolerance, the coefficients died out sufficiently enough to terminate the algorithm.

Example: Window=10 terminates the algorithm when 10 consecutive lags satisfy the specified tolerances.

Data Types: double

Maximum degree of the quotient polynomial, specified as a nonegative integer.

By default, mldivide returns a quotient polynomial with degree of at most 1000. The degree of the quotient might be less than 1000 under the following conditions:

  • When the denominator A is stable, the default is the power to which the magnitude of the largest eigenvalue of the denominator must be raised to equal RelTol.

  • Otherwise, the default is the power to which the magnitude of the largest eigenvalue must be raised to equal the largest positive floating point number (see realmax).

Example: Degree=500 returns a quotient polynomial of degree 500.

Data Types: double

Output Arguments

collapse all

Quotient in the equation B(L) = A(L)\C(L), returned as a LagOp lag operator polynomial object.

More About

collapse all

Tips

To left-invert a stable lag operator polynomial A(L), specify the input A as A(L) and C as eye(A.Dimension).

Algorithms

Lag operator polynomial division can result in infinite-degree polynomials. mldivide imposes a termination criterion to truncate the degree of the quotient polynomial.

By default, the maximum degree of the quotient is determined by the stability of the denominator (see Degree). Stable denominator polynomials usually result in quotients whose coefficients exhibit geometric decay in absolute value. (When coefficients change sign, the coefficient envelope decays geometrically.) Unstable denominators usually result in quotients whose coefficients exhibit geometric growth in absolute value. In either case, Degree specifies the maximum degree of the quotient.

To control truncation error by terminating the coefficient sequence too early, the termination criterion involves three steps:

  1. At each lag in the quotient polynomial, mldivide calculates a coefficient matrix and tests it against both the specified relative and absolute tolerances, specified by the RelTol and AbsTol arguments.

  2. If the current coefficient matrix is below either tolerance, mldivide opens a tolerance window and ensures all subsequent coefficients remain below the tolerances for a number of lags specified by the Window argument.

  3. If any subsequent coefficient matrix within the window is above both tolerances, mldivide closes the tolerance window and calculates additional coefficients, iterating the process until a subsequent coefficient matrix is below either tolerance, causing a new tolerance window to open.

mldivide repeats the process until a coefficient is below tolerance and subsequent coefficients remain below tolerance for Window lags, until mldivide produces Degree coefficients, or until a coefficient becomes numerically unstable (has value NaN or +/-Inf).

References

[1] Box, George E. P., Gwilym M. Jenkins, and Gregory C. Reinsel. Time Series Analysis: Forecasting and Control. 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.

[2] Hamilton, James D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.

[3] Hayashi, Fumio. Econometrics. Princeton, NJ: Princeton University Press, 2000.

Version History

Introduced in R2010a