* * CVMODEL.RPF * RATS Version 8, User's Guide, Example 7.4 * Structural VAR estimation * open data oecdsample.rat calendar(q) 1981 data(format=rats) 1981:1 2006:4 can3mthpcp canexpgdpchs $ canexpgdpds canm1s canusxsr usaexpgdpch * set logcangdp = 100.0*log(canexpgdpchs) set logcandefl = 100.0*log(canexpgdpds) set logcanm1 = 100.0*log(canm1s) set logusagdp = 100.0*log(usaexpgdpch) set logexrate = 100.0*log(canusxsr) * system(model=canmodel) variables logusagdp logcangdp can3mthpcp logexrate logcandefl logcanm1 lags 1 to 4 det constant end(system) * estimate(noprint) * dec frml[rect] afrml bfrml nonlin uf1 cr1 cf1 rf2 mf1 mm2 frml bfrml = ||1.0,0.0,uf1,0.0,0.0,0.0|$ cr1,1.0,cf1,0.0,0.0,0.0|$ 0.0,0.0,1.0,rf2,0.0,0.0|$ 0.0,0.0,0.0,1.0,0.0,0.0|$ mf1,0.0,0.0,0.0,1.0,mm2|$ 0.0,0.0,0.0,0.0,0.0,1.0|| compute uf1=cr1=cf1=rf2=mf1=mm2=pm2=0.0 * * This is estimated by using the genetic method first, then polishing the * estimates with bfgs. In practice, you might want to repeat this * several times to test whether there are global identification problems. * cvmodel(b=bfrml,method=bfgs,pmethod=genetic,piters=50,factor=bfactor) %sigma * * Because the shocks don't really correspond one-to-one with the * variables, the labels option is used on ERRORS to give them the * desired labels. * errors(model=canmodel,factor=bfactor,steps=28,window="BModel",$ labels=||"Real 1","Real 2","Fin 1","Fin 2","Nom 1","Nom 2"||) nonlin rx ur cu cr pc pr mp mc mr frml afrml = ||1.0,0.0,ur ,0.0,0.0,0.0|$ cu ,1.0,cr ,0.0,0.0,0.0|$ 0.0,0.0,1.0,rx ,0.0,0.0|$ 0.0,0.0,0.0,1.0,0.0,0.0|$ 0.0,mc ,mr ,0.0,1.0,mp |$ 0.0,pc ,pr ,0.0,0.0,1.0|| compute ur=cu=cr=rx=mc=mr=mp=pc=pr=0.0 cvmodel(a=afrml,method=bfgs,pmethod=genetic,piters=50,factor=afactor) %sigma errors(model=canmodel,factor=afactor,steps=28,window="AModel")