Page 1 of 1

save VAR coefficients matrix into series

Posted: Thu Nov 01, 2012 12:28 pm
by xswz
Hello,

I want to save the rectangular coefficients matrix of several VAR model in to a series, for example, I want to see coeff(1) denotes the coefficients of VAR(1), coeff(2) denotes the coefficients of VAR(2), etc...

The problem I have is that I can not correctly declare the series number because it will be misunderstood by RATS as part of matrix dimensions


smpl 1960:1 2007:4
do i = 1,30
system(model=m) *how to define the model in series? like m(1), m(2)....m(30)
var pr(i) pers(i)
lags 1
det FFR{0 1} DEF{0 1} PRFI{0 1}
end(system)
ESTIMATE *how to add series for residual var-cov matrix, residuals and coeffs? using "estimate(cvout=v(i), coeffs=coeff(i), model= m(i)) " gave errors, though it works fine if not use loops.
end do i

Re: save VAR coefficients matrix into series

Posted: Thu Nov 01, 2012 8:45 pm
by TomDoan
You could do

Code: Select all

DEC VECT[MODEL] M(30)
DEC VECT[SYMM] V(30)
smpl 1960:1 2007:4
do i = 1,30
   system(model=m(i))
   var pr(i) pers(i) 
   lags 1
   det FFR{0 1} DEF{0 1} PRFI{0 1}
   end(system)
   estimate(CVOUT=V(I))
end do i
which would define 30 models with 30 corresponding covariance matrices. You could then use %MODELGETCOEFFS(M(?)) to get the coefficient vector for any one of the models.