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 ...@@ -66,6 +66,9 @@ if DynareOptions.order>1
if DynareOptions.order>2 && DynareOptions.particle.pruning==1 if DynareOptions.order>2 && DynareOptions.particle.pruning==1
error('initial_estimation_checks:: the particle filter with order>2 does not support pruning') error('initial_estimation_checks:: the particle filter with order>2 does not support pruning')
end end
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')
end
end end
non_zero_ME=length(EstimatedParameters.H_entries_to_check_for_positive_definiteness); non_zero_ME=length(EstimatedParameters.H_entries_to_check_for_positive_definiteness);
......
...@@ -143,10 +143,13 @@ switch DynareOptions.particle.initialization ...@@ -143,10 +143,13 @@ switch DynareOptions.particle.initialization
StateVectorMean = ReducedForm.constant(mf0); StateVectorMean = ReducedForm.constant(mf0);
old_DynareOptionsperiods = DynareOptions.periods; old_DynareOptionsperiods = DynareOptions.periods;
DynareOptions.periods = 5000; DynareOptions.periods = 5000;
old_DynareOptionspruning = DynareOptions.pruning;
DynareOptions.pruning = DynareOptions.particle.pruning;
y_ = simult(DynareResults.steady_state, dr,Model,DynareOptions,DynareResults); 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 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_'); StateVectorVariance = cov(y_');
DynareOptions.periods = old_DynareOptionsperiods; DynareOptions.periods = old_DynareOptionsperiods;
DynareOptions.pruning = old_DynareOptionspruning;
clear('old_DynareOptionsperiods','y_'); clear('old_DynareOptionsperiods','y_');
case 3% Initial state vector covariance is a diagonal matrix (to be used case 3% Initial state vector covariance is a diagonal matrix (to be used
% if model has stochastic trends). % 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