Add exogenous variable to VAR model

2 ビュー (過去 30 日間)
Lili Laal
Lili Laal 2017 年 10 月 13 日
編集済み: Lili Laal 2017 年 10 月 16 日
Hi everybody, for my thesis I am using a VAR(2) with n=10 variables (stock market indices) with data covering a period of 2521 days. I use variance decomposition in a generalized VAR Framework. Now I want to add 3 exogenous variables (VIX, etc) to the model to see how it changes. I have again 2521 observations for each exogenous variable. So far I used
spec=vgxset('n', 10, 'nar', 2, 'constant', false);
[estspec,estsdterror,llf,w]=vgxvarx(spec,data);
Now to add exogenous variables I understood that I have to change it the following:
spec=vgxset('n', 10, 'nar', 2, 'constant', false, 'nX', 3);
[estspec,estsdterror,llf,w]=vgxvarx(spec,data, Xdata);
However I don't understand how to size the data on the exogenous variables. I have read that it Needs to be in a block-diagonal structure, but seriously have no clue how to do this, since it is the first time I am using statistical Software.
Online I found the following to set up the Matrix for exogenous data, but I am not sure how to "incorporate" the observations on exogenous variables (xdata) to this:
_T = 10; % Assume a short time series of 10 observations
K = 2; % Assume a simple 2-D (bi-variate) VAR model
x = [(1:T)' (1:T)'.^2]; % Create a linear and quadratic predictors
X = cell(T,1);
for t = 1:T
for n = 1:K
X{t} = blkdiag(x(t,:), X{t});
end
end_
Thank you in advance for any help!

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by