Commit 87e8cda6 authored by michel's avatar michel
Browse files

v4.1: corrected bug in shock_decomposition.m when lags on more than one period

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2989 ac1d8469-bf42-47a9-8791-bf33cf982152
parent ab512a39
......@@ -65,11 +65,11 @@ function oo_ = shock_decomposition(M_,oo_,options_,varlist)
maximum_lag = M_.maximum_lag;
lead_lag_incidence = M_.lead_lag_incidence;
k2 = dr.kstate(find(dr.kstate(:,2) <= maximum_lag+1),[1 2]);
i_state = order_var(k2(:,1))+(min(i,maximum_lag)+1-k2(:,2))*M_.endo_nbr;
for i=1:gend
if i > 1 & i <= maximum_lag+1
lags = min(i-1,maximum_lag):-1:1;
k2 = dr.kstate(find(dr.kstate(:,2) <= min(i,maximum_lag)+1),[1 2]);
i_state = order_var(k2(:,1))+(min(i,maximum_lag)+1-k2(:,2))*M_.endo_nbr;
end
if i > 1
......@@ -91,4 +91,4 @@ function oo_ = shock_decomposition(M_,oo_,options_,varlist)
options_.initial_date.period = 1;
options_.initial_date.sub_period = 0;
graph_decomp(z,M_.exo_names,varlist,options_.initial_date)
\ No newline at end of file
graph_decomp(z,M_.exo_names,varlist,options_.initial_date)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment