Page 1 of 1

Sampling variances in MSVAR

Posted: Wed Apr 03, 2013 1:46 pm
by chauhal
Dear Tom,

I run MSVAR and try to do sampling variances (covariance matrix). However, I got the following problem and sincerely reply on your advice

MAT15. Subscripts Too Large or Non-Positive
The Error Occurred At Location 65, Line 11 of MSVARRESIDS

The codes and data are as follows:

SOURCE MSVARSETUP.SRC
open data PI.xls
cal(W) 2003 1 8
data(for=xls,org=columns) 2003:1:8 2011:12:28 TL ID PH ML KR SG HK US EU
compute gstart=2004:1:7, gend=2011:12:28
@msvarsetup(lags=1,states=2,switch=mh)
# TL ID PH ML KR SG HK US EU

@msvarinitial gstart gend
nonlin(parmset=varparms) mu phi sigmav
nonlin(parmset=msparms) p
frml msvarf = log(%MSVARProb(t))
maximize(parmset=varparms+msparms,start= (pstar=%MSVARInit()),reject = %msvarinittransition()==0.0,pmethod=simplex, piters=5, method=bfgs,iters=600) msvarf gstart gend

@msvarresids(regime=msregime) msvaru gstart gend

Thank you so much!

Re: Sampling variances in MSVAR

Posted: Wed Apr 03, 2013 3:49 pm
by TomDoan
I'm not sure what you're trying to do. @MSVARResids is designed to be used as a step in Gibbs sampling. It evaluates the residuals at a precise set of (sampled) regimes. When you estimate the model using MAXIMIZE, you don't generate those.