Accelerating the pace of engineering and science

# vectovar

Vector error-correction (VEC) to vector autoregression (VAR)

## Syntax

VAR = vectovar(VEC,C)

## Description

Given a vector error-correction (VEC) model, VAR = vectovar(VEC,C) converts VEC to an equivalent vector autoregression (VAR) model. A VEC(q) model of a time series y(t) has the form:

${B}_{0}z\left(t\right)={B}_{1}z\left(t-1\right)+...+{B}_{q}z\left(t-q\right)+Cy\left(t-1\right)+\epsilon \left(t\right)$

where z(t) = y(t) − y(t − 1) and C is the error-correction coefficient. The equivalent VAR(p) model with p = q + 1 has the form:

${A}_{0}y\left(t\right)={A}_{1}y\left(t-1\right)+...+{A}_{p}y\left(t-p\right)+\epsilon \left(t\right)$

## Input Arguments

 VEC The VEC(q) model to be converted to an equivalent VAR(p) model, with p = q + 1. VEC is specified by a (q + 1)-element cell vector of square matrices {B0 B1 ... Bq} associated with coefficients at lags 0, 1, ..., q. To represent a univariate model, VEC may be specified as a double-precision vector. Alternatively, VEC may be specified as a LagOp object or a vgxset object. C The error-correction coefficient. C is a square matrix the same size as the coefficients of the associated VEC.

## Output Arguments

 VAR The VAR representation of the input VEC model. The data type and orientation of VAR is consistent with that of VEC.

## Examples

### Convert a VEC Model to a VAR Model

Specify a VEC(1) model of time series yt:

$\Delta {y}_{t}={B}_{1}\Delta {y}_{t-1}+C{y}_{t-1}+{\epsilon }_{t}$

The first-order lag coefficient is:

${B}_{1}=\left[\begin{array}{cc}0.2& -0.8\\ 0.7& 0.4\end{array}\right]$

The error-correction coefficient is:

$C=\left[\begin{array}{cc}-1.3& 1.1\\ -0.5& -1.5\end{array}\right]$

Enter the coefficients from the difference equation (including the identity for B0) directly into a cell array:

```VEC = {eye(2)  [0.2 -0.8 ; 0.7 0.4]};
C   = [-1.3 1.1 ; -0.5 -1.5];
```

Use vectovar to convert the VEC(1) model to an equivalent VAR(2) model:

```VAR = vectovar(VEC, C);
```

Since the original VEC model was specified as a cell array, the VAR model is also a cell array. The output cell array contains A0, A1, and A2:

```A0 = VAR{1}
A1 = VAR{2}
A2 = VAR{3}
```
```A0 =

1     0
0     1

A1 =

-0.1000    0.3000
0.2000   -0.1000

A2 =

-0.2000    0.8000
-0.7000   -0.4000

```

You can express the same VEC(1) model as a lag operator polynomial:

$\left(I-{B}_{1}L\right)\Delta {y}_{t}=C{y}_{t-1}+{\epsilon }_{t}$

To specify the VEC(1) model as a lag operator, use the LagOp constructor to create a lag operator polynomial object:

```vec = LagOp({eye(2) [-0.2 0.8 ; -0.7 -0.4]});
```

Use vectovar to convert the VEC(1) model to an equivalent VAR(2) model:

```var = vectovar(vec, C);
```

Since the input model is a lag operator polynomial, so is the output model. The output model uses the same sign convention as the input model. Obtain the coefficient associated with the first and second lags of the VAR model by lag-based indexing:

```VARFirstCoeff = var.Coefficients{1}
VARSecondCoeff = var.Coefficients{2}
```
```VARFirstCoeff =

0.1000   -0.3000
-0.2000    0.1000

VARSecondCoeff =

0.2000   -0.8000
0.7000    0.4000

```

See Specify Lag Operator Polynomials for more information on lag operator polynomials.

expand all

### Algorithms

• Written as a polynomial in the lag operator Ly(t) = y(t − 1), a VEC(q) model has the form:

$\left({B}_{0}-{B}_{1}L-...-{B}_{q}{L}^{q}\right)z\left(t\right)=B\left(L\right)z\left(t\right)=Cy\left(t-1\right)+\epsilon \left(t\right)$

The equivalent VAR(p) model has the form:

$\left({A}_{0}-{A}_{1}L-...-{A}_{p}{L}^{p}\right)y\left(t\right)=A\left(L\right)y\left(t\right)=\epsilon \left(t\right)$

Thus, if VEC is specified as a LagOp object B, coefficients of lagged values of z(t) must be represented by the opposite of their values in standard difference-equation form. The output, VAR, will follow a similar sign convention.

• If VEC is specified as a vgxset object, the conversion involves only the AR0, AR, and nAR components of the model. Other model components are unaffected.

## References

[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.