Name

msvar_irf — impulse response functions (irf) for a Markov-switching VAR model

CALLING SEQUENCE

resirf=msvar_irf(res,hor,arg1,…,argn)

PARAMETERS

Input

• res = a tlist result from a ms var estimation

• hor = a scalar, the horizon of the irf (note that the shocks are supposed to happen at time 0; therefore (hor+1) impulses are calculated)

• mres = optional argument that can be:

 - x = chol1 (cholesky decomposition)

 - x = chol2 (triangular factorisation)

 - x = original (original residuals)

(default = chol1)

Output

• resirf = a result tlist with:

  - resirf('meth') = 'msvar irf'

  - resirf('msvar res') = the input ms var results tlist

  - resirf('# irf') = the horizon of the irf calculations

  - resirf('nb states') = the # of states

  - resirf('nb irf') = the # of different AR parts

  * 1 if they do not switch

  * the # states if they switcch

  - resirf('sigma switch') = the # of switching wariances

  * 1 if they do not switch

  * the # states if they switch

• 1) if both are equal to 1 then

  - resirf('irf') = the only set of impulse repsonse function, a (nvar.hor x nvar) matrix:

• [IRF(t=0)

       .

       .   IRF(t=hor)]

• , with nvar= # of endogenous varaibles in the VAR

• 2) if resirf('nb states') == 1 and resirf('sigma switch') ~= 1

• then:

  - resirf('irf state # 1') until resirf('irf state # ''nstates''')=

• the set of impulse repsonse function, each a (nvar.hor x nvar) matrix:

• [IRF(t=0)

       .   IRF(t=hor)]

• conditional of the state of the shock

• 3) if resirf('nb states') == 1 and resirf('sigma switch') ~= 1

• then:

  - resirf('irf part state # 1') until resirf('irf part state # ''nstates''')= the set of impulse response function, each a (nvar.hor x nvar) matrix:

• [IRF(t=0)

       .

       .

       .

• IRF(t=hor)]

• conditional of the state of the shock and the fact that the state does not switch (not realistic, but useful to the analysis of the VAR associated to each regime)

  - resirf('irf full state # 1') until resirf('irf fulle state # ''nstates''')= the set of full impulse response function, each a (nvar.hor x nvar) matrix:

• [IRF(t=0)

       .

       .

       .

• IRF(t=hor)]

DESCRIPTION

Provides the impulse response functions (irf) from a Markov-switching VAR.

EXAMPLE

load(GROCERDIR+'\data\anas.dat')

bounds('1984m2','2003m1')
nb_states=2;
switch_var=2;
var_opt=3;

// the most interesting case: AR coefficients are swicthing
r1=ms_var('all',2,['delts(log(ipi))' ; 'delts(log(helpwanted))' ; 'delts(log(revu))'],nb_states,switch_var,var_opt)
resirf1=msvar_irf(r1,10)
pltmsirf1(resirf1)

// the case when only constants and variances switch
r2=ms_var('const',2,['delts(log(ipi))' ; 'delts(log(helpwanted))' ; 'delts(log(revu))'],nb_states,switch_var,var_opt)
resirf2=msvar_irf(r2,10)
pltmsirf1(resirf2)

// the case when only constants switch
switch_var=1;
r3=ms_var('const',2,['delts(log(ipi))' ; 'delts(log(helpwanted))' ; 'delts(log(revu))'],nb_states,switch_var,var_opt)
resirf3=msvar_irf(r3,10)
pltmsirf1(resirf3)
               

AUTHOR

Eric Dubois 2011