Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Convert VAR model to VEC model

If any of the time series in a vector autoregression (VAR) model are cointegrated, then the VAR model is nonstationary. You can determine the error-correction coefficient by converting the VAR model to a vector error-correction (VEC) model. The error-correction coefficient matrix determines, on average, how the time series react to deviations from their long-run averages. The rank of the error-correction coefficient determines how many cointegrating relations there exist in the model.

Because `estimate`

is
suitable for estimating VAR models in reduced form, you can convert
an estimated VAR model to its VEC model equivalent using `var2vec`

.

```
[VEC,C]
= var2vec(VAR)
```

`[`

returns the coefficient
matrices (`VEC`

,`C`

]
= var2vec(`VAR`

)`VEC`

) and the error-correction coefficient
matrix (`C`

) of the vector error-correction model
equivalent to the vector autoregressive model with coefficient matrices
(`VAR`

). If the number of lags in the input vector
autoregressive model is *p*, then the number of lags
in the output vector error-correction model is *q* = *p* –
1.

To accommodate structural VAR models, specify the input argument

`VAR`

as a`LagOp`

lag operator polynomial.To access the cell vector of the lag operator polynomial coefficients of the output argument

`VEC`

, enter`toCellArray(VEC)`

.To convert the model coefficients of the output argument from lag operator notation to the model coefficients in difference-equation notation, enter

VECDEN = toCellArray(reflect(VEC));

`VECDEN`

is a cell vector containing*p*coefficients corresponding to the differenced response terms in`VEC.Lags`

in difference-equation notation. The first element is the coefficient of*Δy*, the second element is the coefficient of_{t}*Δy*_{t–1}, and so on.Consider converting a VAR(

*p*) model to a VEC(*q*) model. If the error-correction coefficient matrix (`C`

) has:Rank zero, then the converted VEC model is a stable VAR(

*p*– 1) model in terms of*Δy*._{t}Full rank, then the VAR(

*p*) model is stable (i.e., has no unit roots) [2].Rank

*r*, such that 0 <*r*<*n*, then the stable VEC model has*r*cointegrating relations.

The constant offset of the converted VEC model is the same as the constant offset of the VAR model.

`var2vec`

does not impose stability requirements on the coefficients. To check for stability, use`isStable`

.`isStable`

requires a`LagOp`

lag operator polynomial as an input argument. For example, to check whether`VAR`

, the cell array of-by-`n`

numeric matrices, composes a stable time series, enter`n`

varLagOp = LagOp([eye(

*n*) VAR]); isStable(varLagOp)A

`0`

indicates that the polynomial is not stable.

[1] Hamilton, J. D. *Time Series Analysis*.
Princeton, NJ: Princeton University Press, 1994.

[2] Lutkepohl, H. "New Introduction to Multiple Time Series Analysis." Springer-Verlag, 2007.