-
Notifications
You must be signed in to change notification settings - Fork 9
/
Sirf.m
28 lines (23 loc) · 1.07 KB
/
Sirf.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function SIRFres = Sirf(K,N,PHI,Impact,eslct)
%**************************************************************************
% PURPOSE: Computing STRUCTURAL impulse response functions
%--------------------------------------------------------------------------
% INPUT:
% - K: total number of endogenous variables in the VAR
% - N: forecast horizon
% - PHI: three-dim matrix (K x K x (N+1)) containing dynamic multipliers of
% the VAR
% - Impact: K x K matrix containing impact coefficients of the VAR
% (contemporaneous IRF to all variable/shocks)
% - eslct: K x 1 array, selection vector for the shock to simulate
%--------------------------------------------------------------------------
% OUTPUT:
% - SIRFres: K x (N+1) matrix containing the STRUCTURAL impulse response
% functions
%--------------------------------------------------------------------------
%**************************************************************************
% preallocate matrix containing GIRFs
SIRFres = zeros(K,N+1);
for i=1:N+1
SIRFres(:,i) = (PHI(:,:,i)*Impact*eslct);
end