Skip to content
Snippets Groups Projects
Commit 6c7f3f19 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added input to pass sequence of shocks.

parent 7d1d860a
No related branches found
No related tags found
No related merge requests found
function DynareOutput = simul_backward_nonlinear_model(initial_conditions, sample_size, DynareOptions, DynareModel, DynareOutput) function DynareOutput = simul_backward_nonlinear_model(initial_conditions, sample_size, DynareOptions, DynareModel, DynareOutput, innovations)
%@info: %@info:
%! @deftypefn {Function File} {@var{DynareOutput} =} simul_backward_nonlinear_model (@var{sample_size},@var{DynareOptions}, @var{DynareModel}, @var{DynareOutput}) %! @deftypefn {Function File} {@var{DynareOutput} =} simul_backward_nonlinear_model (@var{sample_size},@var{DynareOptions}, @var{DynareModel}, @var{DynareOutput})
...@@ -55,6 +55,7 @@ if DynareModel.maximum_lead ...@@ -55,6 +55,7 @@ if DynareModel.maximum_lead
error(['simul_backward_nonlinear_model:: The specified model is not backward looking!']) error(['simul_backward_nonlinear_model:: The specified model is not backward looking!'])
end end
if nargin<6
% Set the covariance matrix of the structural innovations. % Set the covariance matrix of the structural innovations.
variances = diag(DynareModel.Sigma_e); variances = diag(DynareModel.Sigma_e);
number_of_shocks = length(DynareModel.Sigma_e); number_of_shocks = length(DynareModel.Sigma_e);
...@@ -80,6 +81,9 @@ end ...@@ -80,6 +81,9 @@ end
DynareOutput.exo_simul = zeros(sample_size,number_of_shocks); DynareOutput.exo_simul = zeros(sample_size,number_of_shocks);
DynareOutput.exo_simul(:,positive_var_indx) = DynareOutput.bnlms.shocks; DynareOutput.exo_simul(:,positive_var_indx) = DynareOutput.bnlms.shocks;
DynareOutput.exo_simul = [zeros(1,number_of_shocks); DynareOutput.exo_simul]; DynareOutput.exo_simul = [zeros(1,number_of_shocks); DynareOutput.exo_simul];
else
DynareOutput.exo_simul = innovations;
end
% Get usefull vector of indices. % Get usefull vector of indices.
ny0 = nnz(DynareModel.lead_lag_incidence(2,:)); ny0 = nnz(DynareModel.lead_lag_incidence(2,:));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment