Skip to content
Snippets Groups Projects
Commit 49ae89ce authored by Frédéric Karamé's avatar Frédéric Karamé
Browse files

Bug fix: pruning at order 3.

parent 4a92614e
No related branches found
No related tags found
No related merge requests found
Pipeline #11492 passed
......@@ -92,6 +92,8 @@ number_of_state_variables = length(mf0);
number_of_observed_variables = length(mf1);
number_of_structural_innovations = length(ReducedForm.Q);
pruning = ParticleOptions.pruning;
% compute gaussian quadrature nodes and weights on states and shocks
if ParticleOptions.proposal_approximation.montecarlo
nodes = randn(ParticleOptions.number_of_particles,number_of_state_variables+number_of_structural_innovations);
......@@ -145,7 +147,7 @@ for t=1:sample_size
case 2
tmp = local_state_space_iteration_2(yhat,epsilon,ghx,ghu,constant,ghxx,ghuu,ghxu,ThreadsOptions.local_state_space_iteration_2);
case 3
tmp = local_state_space_iteration_3(yhat, epsilon, ghx, ghu, ghxx, ghuu, ghxu, ghs2, ghxxx, ghuuu, ghxxu, ghxuu, ghxss, ghuss, steadystate, ThreadsOptions.local_state_space_iteration_3, pruning);
tmp = local_state_space_iteration_3(yhat, epsilon, ghx, ghu, ghxx, ghuu, ghxu, ghs2, ghxxx, ghuuu, ghxxu, ghxuu, ghxss, ghuss, steadystate, ThreadsOptions.local_state_space_iteration_3,pruning);
otherwise
error('Order > 3: use_k_order_solver should be set to true');
end
......@@ -181,13 +183,12 @@ for t=1:sample_size
lik(t)=-Inf;
return
end
[~, p]= chol(PredictedObservedVariance,'lower');
[PredictedObservedVarianceSquareRoot, p]= chol(PredictedObservedVariance,'lower');
if p
LIK=-Inf;
lik(t)=-Inf;
return
end
PredictedObservedVarianceSquareRoot = chol(PredictedObservedVariance);
end
PredictedObservedInverseVarianceSquareRoot = PredictedObservedVarianceSquareRoot\eye(n); % Inverse of the Cholesky -> inv(PredictedObservedVariance) = A*A'
StandardPredictionError = PredictedObservedInverseVarianceSquareRoot'*PredictionError;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment