@ THIRD PROGRAM IN THE SIMULATION SERIES
  -  IMPULSE RESPONSE FUNCTIONS @

@ ORDERING OF VARIABLES
  S: (MKE-TRANSITION): FIRST STATES THEN SHOCKS
  H: FIRST COSTATES, THEN CONTROLS, THEN EXTRA CONTROLS @

@ CHOOSE SHOCK (ORDERING IS ABOVE), I.E:
  IF YOU WANT TRANSITIONS TO STEADY-STATE, SHOCK THE STATES @
  IF YOU WANT IMPULSE RESPONSES, SHOCK THE SHOCKS @
S=;

@ FORECAST HORIZON @
NIR=;

@ GENERATING IMPULSES @
T=SEQA(1,1,30);
IR=ZEROS(ROWS(MKE)+ROWS(H),NIR);

I=1;
DO UNTIL I>NIR;
IR[1:ROWS(MKE),I]=S;
IR[ROWS(MKE)+1:ROWS(IR),I]=(H*S);
S=MKE*S;
I=I+1;
ENDO;

@ PLOT IMPULSE RESPONSES @
LIBRARY PGRAPH;
GRAPHSET;
TITLE("");
_PLEGCTL={2,3,1.7,4.5};
_PLEGSTR=;            @ PICK OUT THE VARIABLES THAT YOU WANT TO PLOT @
XY(T,);               @ -------------------------------------------- @