* * Martin, Hurn, Harris, "Econometric Modelling with Time Series" * Application 14.6.2, from pp 537-538 * A Portfolio SVAR Model of Australia * open data portfolio_data.dat cal(q) 1980:1 data(format=prn,nolabels,org=columns) 1980:01 2005:02 usshares usausexrate cpi nomgdp realgdp ausshares rate * set ipd = nomgdp/realgdp set r3 = rate/100.0 set lipd = log(ipd) set lcpi = 100.0*log(cpi) set lrao = 100.0*log(ausshares/ipd) set lr3 = 100.0*log(r3) set lrgdp = 100.0*log(realgdp) * * US shares converted to real AUS\$ * set lrdj = 100.0*log(usshares/(usausexrate*ipd)) set inf = lipd-lipd{4} * * D87 is a stock market crash dummy * D2000 is a dummy for the introduction of GSP in 2000:3 * set d87 = t==1987:4 set d2000 = t==2000:3 * set dlrgdp = lrgdp-lrgdp{1} set dlr3 = lr3-lr3{1} set dlrao = lrao-lrao{1} set dlcpi = lcpi-lcpi{1} set dlrdj = lrdj-lrdj{1} * system(model=portfolio) variables dlrgdp dlr3 dlrao dlcpi dlrdj lags 1 2 det constant d87 d2000 end(system) estimate * dec rect lr(5,5) input lr . 0 0 0 0 . . . 0 0 . . . 0 . . . . . 0 0 0 0 0 . * * Let @shortandlong handle the standard exclusion restrictions * compute masums=inv(%varlagsums) @shortandlong(lr=lr,masums=masums,noestimate,rperp=rp) %sigma compute r=%perp(rp) * * Add the constraint that the LR response at 2,2 + 3,2 = 0 * compute bv=tr((%xrow(masums,2)+%xrow(masums,3)))*tr(%unitv(%nvar,2)) compute r=r~%vec(bv) compute rp=%perp(r) * dec vect theta(%cols(rp)) dec frml[rect] lrfrml * frml lrfrml = %vectorect(rp*theta,%nvar) compute [vect] theta=%ginv(rp)*%vec(%decomp(%sigma)) * nonlin theta cvmodel(b=lrfrml,factor=f,dmatrix=identity) %sigma disp "Impact responses with long-run restrictions" f disp "Long run responses" masums*f