* * Example of variance GIRF from multivariate GARCH model * open data g10xrate.xls data(format=xls,org=columns) 1 6237 usxjpn usxfra usxsui * set xjpn = 100.0*log(usxjpn/usxjpn{1}) set xfra = 100.0*log(usxfra/usxfra{1}) set xsui = 100.0*log(usxsui/usxsui{1}) * * Examples with the different choices for the MV option * garch(p=1,q=1,pmethod=simplex,piters=10) / xjpn xfra xsui * compute n=%nvar *compute b=%xsubvec(%beta,1,n) @MVGARCHToVECH(mv=standard) compute vcs=%vectosymm(%xsubvec(%beta,n+1,n+%symmpos(n,n)),n) compute vas=%vectosymm(%xsubvec(%beta,n+1+1*%symmpos(n,n),n+2*%symmpos(n,n)),n) compute vbs=%vectosymm(%xsubvec(%beta,n+1+2*%symmpos(n,n),n+3*%symmpos(n,n)),n) dec symm h0(n,n) ewise h0(i,j)=vcs(i,j)/(1-vas(i,j)-vbs(i,j)) * compute nstep=20 dec rect[series] girfs(n,n) do j=1,n do i=1,n set girfs(i,j) 1 nstep = 0.0 end do j * * Compute the mean of eps given H0 covariance matrix and unit shock * to variable j. * compute delta=sqrt(h0(j,j)) compute varirf=%outerxx(%xcol(h0,j)*delta/h0(j,j)) * * There is no immediate response to the variance, since the shock * enters with a lag. * do step=2,nstep if step==2 compute varirf=vas.*varirf else compute varirf=vbs.*varirf do i=1,n compute girfs(i,j)(step)=varirf(i,i) end do i end do step end do j * spgraph(vfields=n,hfields=n,header="Variance Responses in GARCH Model",\$ xlabels=||"Japan","France","Switzerland"||,ylabels=||"Japan","France","Switzerland"||) dec vect[series] resp(n) do i=1,n compute minlower=maxupper=0.0 do j=1,n set resp(j) 1 nstep = girfs(i,j) end do j table(noprint) 1 nstep resp compute maxupper=%max(0.0,%maximum) compute minlower=%min(0.0,%minimum) do j=1,n graph(row=i,col=j,max=maxupper,min=minlower) # girfs(i,j) end do j end do i spgraph(done)