' compare analytic and monte-carlo impulse response s.e.
' plots the two standard error bands in one graph
' version 4 beta
' 1/31/2000 h
' last checked 10/27/2000 h

' include subroutine
include sub_irfgraph.prg

'change path to program path
%path = @runpath
cd "{%path}"

' load workfile
load lut1

' estimate VAR 
smpl 1960:1 1978:4 
var1.ls 1 2 y1 y2 y3 @ c 

!hrz = 10			' response periods
!rep = 500			' monte carlo replications

' get analytic impulse response standard errors
var1.impulse(m,imp=chol,se=a,matbyr=analyt) 

' get monte carlo impulse response standard errors
var1.impulse(m,imp=chol,se=mc,rep=!rep,matbyr=mcarlo) 

' plot in one graph
%gname = "fig1"
call sub_irfgraph(analyt, analyt_se, mcarlo_se, %gname)
' add zero line to all graphs
{%gname}.draw(line,left) 0
' add title to graph
{%gname}.addtext(t) Comparison of Impulse Response Standard Errors (Analytic---Red vs Monte Carlo---Green)

show {%gname}

