Vector auto-regressive model with 1 dependent variable that does not has lags
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I would like to estimate the following VAR model: z(t)=a+Bx(t-1)+e(t)
with z(t)'=[ r(t) , x(t) ] and x(t) = [ NPY(t), TB(t), DEF(t) ]' e(t)~ iid N(0,sig)
Note that r(t) lags does not appear in the system of equations. I would like to output the matrix of coefficients B and the variance co-variance matrix of errors. How can I do that?
Here is my data:
if true
date t MKTrf NPY TB DEF L1_NPY L1_TB L1_DEF
31mar1953 1 -1.52 -1.99486 2.36 .42
30apr1953 2 -2.91 -1.9914 2.48 .44 -1.99486 2.36 .42
31may1953 3 .54 -1.98652 2.45 .46 -1.9914 2.48 .44
30jun1953 4 -1.85 -1.97217 2.38 .58 -1.98652 2.45 .46
31jul1953 5 2.38 -1.97788 2.28 .61 -1.97217 2.38 .58
31aug1953 6 -4.58 -1.96153 2.2 .59 -1.97788 2.28 .61
30sep1953 7 .15 -1.95691 1.79 .66 -1.96153 2.2 .59
31oct1953 8 4.58 -1.96923 1.67 .64 -1.95691 1.79 .66
30nov1953 9 2.75 -1.96342 1.66 .61 -1.96923 1.67 .64
31dec1953 10 -.05 -1.99034 1.41 .65 -1.96342 1.66 .61
31jan1954 11 5.14 -2.00099 1.14 .66 -1.99034 1.41 .65
28feb1954 12 1.68 -2.00127 1.13 .65 -2.00099 1.14 .66
31mar1954 13 3.65 -2.00536 .96 .62 -2.00127 1.13 .65
30apr1954 14 4.2 -2.01369 .85 .59 -2.00536 .96 .62
31may1954 15 3.11 -2.01669 .82 .59 -2.01369 .85 .59
30jun1954 16 1.09 -2.01725 .84 .61 -2.01669 .82 .59
31jul1954 17 4.99 -2.03005 .88 .62 -2.01725 .84 .61
31aug1954 18 -2.3 -2.01893 1.03 .58 -2.03005 .88 .62
30sep1954 19 6.34 -2.03151 1.17 .59 -2.01893 1.03 .58
31oct1954 20 -1.69 -2.0246 1.14 .56 -2.03151 1.17 .59
30nov1954 21 9.47 -2.03259 1.21 .55 -2.0246 1.14 .56
31dec1954 22 5.45 -2.11241 1.39 .52 -2.03259 1.21 .55
31jan1955 23 .62 -2.11376 1.57 .54 -2.11241 1.39 .52
28feb1955 24 3.04 -2.13234 1.59 .46 -2.11376 1.57 .54
31mar1955 25 -.21 -2.12995 1.75 .48 -2.13234 1.59 .46
30apr1955 26 3.13 -2.1314 1.9 .46 -2.12995 1.75 .48
31may1955 27 1.05 -2.12635 1.91 .46 -2.1314 1.9 .46
30jun1955 28 6.48 -2.13513 2.02 .46 -2.12635 1.91 .46
31jul1955 29 1.93 -2.1639 2.37 .45 -2.13513 2.02 .46
31aug1955 30 .27 -2.15558 2.36 .46 -2.1639 2.37 .45
30sep1955 31 -.36 -2.15148 2.39 .49 -2.15558 2.36 .46
31oct1955 32 -2.75 -2.14876 2.48 .48 -2.15148 2.39 .49
30nov1955 33 6.99 -2.14527 2.73 .47 -2.14876 2.48 .48
31dec1955 34 1.46 -2.16469 2.58 .49 -2.14527 2.73 .47
31jan1956 35 -3.02 -2.15226 2.49 .5 -2.16469 2.58 .49
end
Thanks!
0 Kommentare
Antworten (1)
Harry Vancao
am 30 Jun. 2017
Bearbeitet: Harry Vancao
am 30 Jun. 2017
It doesn't look like MATLAB supports generating auto-regressive models that have some lags of 0. It does support any number or combination of positive lags. If you think about it, it doesnt make much sense to perform an auto-regression without lags either.
It looks like you are trying to estimate some 3 factor model. And it looks like x(t) are your factors and r(t) is your returns. Please correct me if I am wrong. I think it would be simpler to just generate two separate models. One normal regression for r(t) and one auto-regressive one for x(t). I will show you how to generate the VAR for x(t). Of course, I am assuming that x(t) is not dependent on r(t).
MATLAB has a neat function called varm in the econometrics toolbox. To generate the auto-regressive model, you would use the following commands. (change your data to be comma separated and this should work)
data = importdata('data.txt')
data = data.data;
x = data(:, 3:5);
model = varm(3, 1);
[model, EstSE,logL,E] = estimate(model, x)
The first line generates a skeleton vector auto-regressive model that is modeling 3 time series with one lag at t-1. The second line takes that model and your training data and then populates the model. the member AR is a cell that holds a matrix for each time lag which in this case, is B. The model also contains your covariance matrix and EstSE stands for estimate standard error.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Vector Autoregression Models finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!