Calculates Impulse Response Function for VAR
res=irf(results,S,arg1,...,argn)
* results = results tlist returned by VAR
* S = scalar for number of periods in IRF
* argi = optional argument which can be:
- 'mres=x' where:
* x = chol1 (cholesky decomposition)
* x = chol2 (triangular factorisation)
* x = original (original residuals)
(default = chol1)
- 'meth=x' where:
. x = asym (asymptotic formula)
. x = bootstrap (Bootstrap simulations using draws from the coefficients)
(default = asym)
- 'niter=x' where x= # iterations for the Monte-Carlo simulations (if any; default=1000)
- 'size=x' where x = significance level for the confidence band (default =0.05)
* res = a results tlist with:
- res('meth') = 'irf'
- res('mres') = decomposition method
- res('T') = # of periods represented
- res('IRF') = ((S+1) x T) impulse response functions
- res('IRF_LOW') = ((S+1) x T) lower range of impulse response confidence band
- res('IRF_UPP') = ((S+1) x T) upper range of impulse response confidence band
- res('PHI') = (N*p x T) matrix of coefficients
- res('resvar') = results tlist of the originating VAR
- res('msg') = message inidicating the nature of the decomposition
- res('size') = size of the confidence band
- res('ans_vari_to_shockj') = answer of variable i to schock j, for i=1:nvariables, j=1:nvariables
load(GROCERDIR+'/data/lutk1.dat') bounds('1960q4','1978q4') results=VAR(2,'endo=delts(log(rfa_inv));delts(log(rfa_inc));delts(log(rfa_cons))') [resirf]=irf(results,10,'mres=chol1','meth=asym') [resirf]=irf(results,10,'mres=original','meth=mc1','niter=1000') // Example taken from function var_d(). In the first one, impulse response is calculated for 10 periods, with shocks calculated from a // Choleski decomposition, with the asymptotic formula. In the second one, impulse response is calulated for 10 periods, with original // unorthogonalized shocks, using 1000 draws from the coefficients estimated law. | ![]() | ![]() |