Documentation

vec2var

Convert VEC model to VAR model

计量经济学工具箱™ VAR model functions such assimulate,预报, 和armairf适合矢量自动进度(VAR)模型。模拟,预测或​​产生脉冲响应向量误差校正(VEC)模型使用simulate,预报, 或者armairf, respectively, convert the VEC model to its equivalent VAR model representation.

Syntax

VAR = vec2var(VEC,C)

Description

example

VAR= vec2var(VEC,C)returns the coefficient matrices (VAR)矢量自回旋模型等于具有系数矩阵的向量误差校正模型(VEC)。如果输入矢量误差校正模型中的滞后数为q, then the number of lags in the output vector error-correction model isp=q+ 1。

Examples

collapse all

Consider converting the following VEC(2) model to a VAR(3) model.

Specify the coefficient matrices () of,以及错误校正系数

B1 = [-0.14 0.12 -0.05; -0.14 -0.07 -0.10; -0.07 -0.16 -0.07]; B2 = [-0.14 0.12 -0.05; -0.14 -0.07 -0.10; -0.07 -0.16 -0.07]; C = [-0.32 0.74 -0.38; 1.97 -0.61 0.44; - 2.19 -1.15 2.65];

将矩阵包装到二维细胞载体的单独细胞中。放B1进入第一个单元格和B2into the second cell.

vec = {b1 b2};

Compute the coefficient matrices of the equivalent VAR(3) model.

var = vec2var(vec,c);尺寸(var)
ans = 1 3

The specification of a cell array of matrices for the input argument indicates that the VEC(2) model is in reduced form, andVEC{1}是个coefficient of。随后的元素对应于随后的滞后。

VAR是VEC(2)模型的VAR(3)的3 x-3系数矩阵的1 x-3细胞向量。由于VEC(2)模型的形式还原,因此等效的VAR(3)模型也是如此。那是,var {1}是个coefficient of,随后的元素对应于随后的滞后。方向VARcorresponds to the orientation ofVEC

显示VAR(3)模型系数。

A1 = VAR{1} A2 = VAR{2} A3 = VAR{3}
A1 = 0.5400 0.8600 -0.4300 1.8300 0.3200 0.3400 -2.2600 -1.3100 3.5800 A2 = 0 0 0 0 0 0 0 0 0 A3 = 0.1400 -0.1200 0.0500 0.1400 0.0700 0.1000 0.0700 0.1600 0.0700

由于模型之间的恒定偏移是等效的,因此生成的var(3)模型为

Consider converting the following structural VEC(1) model to a structural VAR(2) model.

Specify the coefficient matrices,以及错误校正系数

B0 = [0.54 -2.26; 1.83 0.86]; B1 = [-0.07 -0.07 0.01 0.02]; C = [-0.15 1.9; -3.15 -0.54];

将矩阵包装到3维细胞载体的单独细胞中。放B0进入第一个单元格和B1into the second cell. Negate the coefficients corresponding to all nonzero differenced lag terms.

VECCoeff = {B0; -B1};

Create a lag operator polynomial that encompasses the autoregressive terms in the VEC(2) model.

vec = lagop(Veccoeff)
VEC = 2-D Lag Operator Polynomial: ----------------------------- Coefficients: [Lag-Indexed Cell Array with 2 Non-Zero Coefficients] Lags: [0 1] Degree: 1 Dimension: 2

VECis aLagOp滞后运算符多项式,并指定此方程中的自回归滞后操作员多项式

是滞后操作员。如果您扩大数量并解决,结果是差分方程表示法中的VAR(2)模型。

Compute the coefficient matrices of the equivalent VAR(2) model.

VAR = vec2var(VEC,C)
VAR = 2-D Lag Operator Polynomial: ----------------------------- Coefficients: [Lag-Indexed Cell Array with 3 Non-Zero Coefficients] Lags: [0 1 2] Degree: 2 Dimension: 2

矢量。Coefficients{0}is,系数矩阵。Subsequent elements invar.ceefficientscorrespond to subsequent lags in矢量。Lags

VAR是VEC(1)模型的VAR(2)。因为VEC(1)模型是结构性的,因此等效var(2)也是。那是,var.ceefficients{0}是个coefficient of, 和subsequent elements correspond to subsequent lags invar.lags

在差异方程式中显示VAR(2)模型系数。

A0 = VAR.Coefficients{0} A1 = -VAR.Coefficients{1} A2 = -VAR.Coefficients{2}
A0 = 0.5400 -2.2600 1.8300 0.8600 A1 = 0.3200 -0.4300 -1.3100 0.3400 A2 = 0.0700 0.0700 0.0700 -0.0100 -0.0200

最终的var(3)模型是

或者,反射滞后运算符多项式VAR在滞后0附近以获得差方程符号系数。

DiffEqnCoeffs = reflect(VAR); A = toCellArray(DiffEqnCoeffs); A{1} == A0 A{2} == A1 A{3} == A2
ans = 2x2 logical array 1 1 1 1 ans = 2x2 logical array 1 1 1 1 ans = 2x2 logical array 1 1 1 1

Both methods produce the same coefficients.

Approximate the coefficients of the structural VMA model that represents the structural VEC(8) model

在哪里,,并且,因为j= 1,2, and 3,

创建一个包含VEC(8)模型系数矩阵的单元向量。从系数开始, 和then enter the rest in order by lag. Construct a vector that indicates the degree of the lag term for the corresponding coefficients.

vec0 = {[1 0.2 -0.1;0.03 1 -0.15;0.9 -0.25 1],...[0.5 -0.2 -0.1; -0.3 -0.1 0.1; 0.4 -0.2 -0.05],...[0.05 -0.02 -0.01; -0.1 -0.01 -0.001; 0.04 -0.02 -0.005]}; vec0Lags = [0 4 8]; C = [-0.02 0.03 0.3; 0.05 0.1 0.01; 0.3 0.01 0.01];

vec2varrequires aLagOp滞后算子多项式的输入参数comprises a structural VEC(8) model. Construct aLagOp描述VEC(8)模型自回归系数矩阵组件的滞后运算符多项式(即,和its lags).

VECLag = LagOp(VEC0,“滞后”,vec0Lags);

VECLagis aLagOp滞后运算符多项式描述了VEC(8)模型的自回旋组件。

Compute the coefficients of the VAR(9) model equivalent to the VEC(8) model.

var = vec2var(veclag,c)
VAR = 3-D Lag Operator Polynomial: ----------------------------- Coefficients: [Lag-Indexed Cell Array with 6 Non-Zero Coefficients] Lags: [0 1 4 5 8 9] Degree: 9 Dimension: 3

VARis aLagOp滞后操作员多项式。除与滞后0、1、4、5、8和9相对应的所有系数都是零的3 x矩阵。系数中VAR包括稳定的结构VAR(9)模型,等效于原始VEC(8)模型。该模型是稳定的,因为误差系数具有完整的等级。

计算VMA模型近似值的系数与所得VAR(9)模型。放numlags最多返回12个滞后。

numlags = 12;vma = arma2ma(var,[],numlags);

VMAis aLagOplag operator polynomial containing the coefficient matrices of the resulting VMA(12) model inVMA.CoefficientsVMA{0}是个coefficient of,VMA{1}是个coefficient of, 和so on.

Input Arguments

collapse all

VEC(q)模型的响应差异系数, specified as a numeric vector, a cell vector ofn-by-nnumeric matrices, or aLagOp滞后运算符多项式对象。

  • For a numeric vector specification:

    • The VEC(q) is a univariate time series.

    • VEC一定是a lengthq数字向量。

    • vec(j)contains the scalarBj, the coefficient of the lagged differenceΔytj

    • The coefficient ofΔyt(B0) is1

  • 对于单元向量规范:

    • VECmust have lengthq, 和each cell contains ann-by-n数字矩阵(n> 1)。

    • VEC{j}必须包含Bj,滞后项的系数矩阵Δytj

    • vec2varassumes that the coefficient ofΔyt(B0) is then-by-n身份。

  • For aLagOplag operator polynomial specification:

    • 矢量。Degree一定是q

    • 矢量。Coefficients{0}isB0, the coefficient ofΔyt。所有其他元素对应于随后滞后的,差异的术语的系数。例如,矢量。Coefficients{j}是个系数矩阵Δytj矢量。Lagsstores all nonzero lags.

    • To construct a model in reduced form, set矢量。Coefficients{0}toeye(VEC.Dimension)

例如,考虑转换

[ 1 0 0 1 ] Δ y t = [ 0.1 0.2 1 0.1 ] Δ y t - 1 + [ - 0.1 0.01 0.2 - 0.3 ] Δ y t - 2 + [ 0.5 0 - 0.1 1 ] y t - 1 + ε t

to a VAR(3) model. The model is in差异方程式表示法。您可以通过输入转换模型
VAR = vec2var({[0.1 0.2; 1 0.1],...-[-0.1 0.01; 0.2 -0.3]},[0.5 0; -0.1 1]);
The VEC(2) model inlag operator notationis

( [ 1 0 0 1 ] - [ 0.1 0.2 1 0.1 ] L - [ - 0.1 0.01 0.2 - 0.3 ] L 2 ) Δ y t = [ 0.5 0 - 0.1 1 ] y t - 1 + ε t

的AR系数矩阵lagged responses appear negated compared to the corresponding coefficients in difference-equation notation. To obtain the same result usingLagOPlag operator polynomials, enter
VEC = LagOp({eye(2), -[0.1 0.2; 1 0.1], -[-0.1 0.01; 0.2 -0.3]}); C = [0.5 0; -0.1 1]; VAR = vec2var(VEC,C);

Error-correction coefficient, specified as ann-by-nnumeric matrix.n是个number of time series in the VEC model. The dimensions ofC和the matrices composingVEC一定是equivalent.

Data Types:double

Output Arguments

collapse all

var(p) model coefficients, returned as a a numeric vector, cell vector ofn-by-nnumeric matrices, or aLagOp滞后运算符多项式对象。n是个number of time series in the VEC model.

VECVAR共享相同的数据类型和方向。

vec2varconverts VEC(q) models to VAR(q+ 1) models. That is:

  • IfVECis a cell or numeric vector, thennumel(VAR)isnumel(VEC) + 1

  • IfVECis aLagOplag operator polynomial, thenVAR.Degreeis矢量。度+ 1

More About

collapse all

差异方程式表示法

一个var(p) or VEC(q) model written in差异方程式表示法isolates the present value of the response vector and its structural coefficient matrix on the left side of the equation. The right side of the equation contains the sum of the lagged responses, their coefficient matrices, the present innovation vector, and, for VEC models, the error-correction term.

也就是说,var(p)用差异方程式符号编写的模型是

A 0 y t = a + A 1 y t - 1 + A 2 y t - 2 + ... + A p y t - p + ε t

A VEC(q) model written in difference equation notation is

B 0 Δ y t = b + B 1 Δ y t - 1 + B 2 Δ y t - 2 + ... + B q Δ y t - q + C y t - 1 + ε t

For the variable and parameter definitions, seevar(p) ModelVEC(q) Model

滞后操作员符号

一个var(p) or VEC(q) model written inlag-operator notationpositions all response terms to the left side of the equation. The right side of the equation contains the model constant offset vector, the present innovation, and, for VEC models, the error-correction term.

也就是说,var(p) model written in lag-operator notation is

A ( L ) y t = a + ε t

在哪里 A ( L ) = A 0 - A 1 L - A 2 L 2 - ... - A p L p L j y t = y t - j

A VEC(q) model written in difference equation notation is

B ( L ) Δ y t = b + C y t - 1 + ε t

在哪里 B ( L ) = B 0 - B 1 L - B 2 L 2 - ... - B q L q

For the variable and parameter definitions, seevar(p) ModelVEC(q) Model

When comparing lag operator notation to差异方程式表示法, the signs of the lag terms are opposites. For more details, see滞后操作员符号

var(p) Model

Avar(p) modelis a multivariate, autoregressive time series model that has this general form:

A 0 y t = a + A 1 y t - 1 + A 2 y t - 2 + ... + A p y t - p + ε t

  • ytis ann- 维时间序列。

  • A0是个n-by-ninvertible structural coefficient matrix. For models inreduced form,A0=In, 哪一个是n-dimensional identity matrix.

  • ais ann-dimensional vector of constant offsets.

  • Aj是个n-by-n系数矩阵yT – J,j= 1,...,p

  • εtis ann-dimensional innovations series. The innovations are serially uncorrelated, and have a multivariate normal distribution with mean 0 andn-by-n协方差矩阵Σ

VEC(q) Model

AVEC(q) modelis a multivariate, autoregressive time series model that has this general form:

B 0 Δ y t = b + B 1 Δ y t - 1 + B 2 Δ y t - 2 + ... + B q Δ y t - q + C y t - 1 + ε t

  • ytis ann- 维时间序列。

  • Δ是第一个差异操作员,即Δyt=ytyt–1

  • B0是个n-by-ninvertible structural coefficient matrix. For models inreduced form,B0=In, 哪一个是n-dimensional identity matrix.

  • bis ann-dimensional vector of constant offsets.

  • Bj是个n-by-n系数矩阵ΔyT – J,j= 1,...,q

  • εtis ann-dimensional innovations series. The innovations are serially uncorrelated, and have a multivariate normal distribution with mean 0 andn-by-n协方差矩阵Σ

  • C是个n-by-nerror-correction or impact coefficient matrix.

Tips

  • 要适应结构VEC模型,请指定输入参数VECas aLagOp滞后操作员多项式。

  • To access the cell vector of the lag operator polynomial coefficients of the output argumentVAR, 进入toCellArray(VAR)

  • 将输出参数的模型系数从lag operator notationto the model coefficients in差异方程式表示法, 进入

    瓦尔登= toCellArray(reflect(VAR));
    瓦尔登是包含单元向量的q+ 1个系数对应于响应项var.lagsin difference-equation notation. The first element is the coefficient ofyt, the second element is the coefficient ofyt–1, 和so on.

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

算法

  • vec2vardoes not impose stability requirements on the coefficients. To check for stability, useisStable

    isStablerequires aLagOp滞后运算符多项式作为输入。例如,检查是否VAR,细胞阵列n-byn数字矩阵,组成一个稳定的时间序列,输入

    varLagOp = LagOp([eye(n) var]); isStable(varLagOp)

    A0indicates that the polynomial is not stable. IfVARis aLagOplag operator polynomial, then pass it toisStable

References

[1] Hamilton, J. D.时间序列分析。Princeton, NJ: Princeton University Press, 1994.

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

在R2015B中引入

这个话题有帮助吗?