Verified Commit f19decf2 authored by Johannes Pfeifer 's avatar Johannes Pfeifer Committed by Stéphane Adjemian

non_linear_dsge_likelihood.m: consistently use options_.particles.pruning

Closes #1756
parent ec691741
Pipeline #4779 passed with stages
in 111 minutes and 52 seconds
......@@ -66,6 +66,9 @@ if DynareOptions.order>1
if DynareOptions.order>2 && DynareOptions.particle.pruning==1
error('initial_estimation_checks:: the particle filter with order>2 does not support pruning')
if DynareOptions.particle.pruning~=DynareOptions.pruning
fprintf('initial_estimation_checks:: the pruning settings differ between the particle filter and the one used for IRFs/simulations. Make sure this is intended.\n')
......@@ -143,10 +143,13 @@ switch DynareOptions.particle.initialization
StateVectorMean = ReducedForm.constant(mf0);
old_DynareOptionsperiods = DynareOptions.periods;
DynareOptions.periods = 5000;
old_DynareOptionspruning = DynareOptions.pruning;
DynareOptions.pruning = DynareOptions.particle.pruning;
y_ = simult(DynareResults.steady_state, dr,Model,DynareOptions,DynareResults);
y_ = y_(dr.order_var(state_variables_idx),2001:5000); %state_variables_idx is in dr-order while simult_ is in declaration order
StateVectorVariance = cov(y_');
DynareOptions.periods = old_DynareOptionsperiods;
DynareOptions.pruning = old_DynareOptionspruning;
case 3% Initial state vector covariance is a diagonal matrix (to be used
% if model has stochastic trends).
Markdown is supported
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