Verified Commit 417f038c authored by Johannes Pfeifer 's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

Particle filters: do not compute Kalman smoother

Related to #1757
parent 0b87f664
...@@ -174,16 +174,22 @@ catch % if check fails, provide info on using calibration if present ...@@ -174,16 +174,22 @@ catch % if check fails, provide info on using calibration if present
end end
if isequal(options_.mode_compute,0) && isempty(options_.mode_file) && options_.mh_posterior_mode_estimation==0 if isequal(options_.mode_compute,0) && isempty(options_.mode_file) && options_.mh_posterior_mode_estimation==0
if options_.smoother if options_.order==1 && ~options_.particle.status
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,options_,bayestopt_] = DsgeSmoother(xparam1,gend,transpose(data),data_index,missing_value,M_,oo_,options_,bayestopt_,estim_params_); if options_.smoother
[oo_]=store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty); [atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp,Trend,state_uncertainty,M_,oo_,options_,bayestopt_] = DsgeSmoother(xparam1,gend,transpose(data),data_index,missing_value,M_,oo_,options_,bayestopt_,estim_params_);
if options_.forecast > 0 [oo_]=store_smoother_results(M_,oo_,options_,bayestopt_,dataset_,dataset_info,atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,P,PK,decomp,Trend,state_uncertainty);
oo_.forecast = dyn_forecast(var_list_,M_,options_,oo_,'smoother',dataset_info); if options_.forecast > 0
oo_.forecast = dyn_forecast(var_list_,M_,options_,oo_,'smoother',dataset_info);
end
%reset qz_criterium
options_.qz_criterium=qz_criterium_old;
return
end
else %allow to continue, e.g. with MCMC_jumping_covariance
if options_.smoother
error('Estimation:: Particle Smoothers are not yet implemented.')
end end
end end
%reset qz_criterium
options_.qz_criterium=qz_criterium_old;
return
end end
%% Estimation of the posterior mode or likelihood mode %% Estimation of the posterior mode or likelihood mode
...@@ -536,7 +542,11 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ... ...@@ -536,7 +542,11 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
if error_flag if error_flag
error('Estimation::mcmc: I cannot compute the posterior statistics!') error('Estimation::mcmc: I cannot compute the posterior statistics!')
end end
prior_posterior_statistics('posterior',dataset_,dataset_info); if options_.order==1 && ~options_.particle.status
prior_posterior_statistics('posterior',dataset_,dataset_info); %get smoothed and filtered objects and forecasts
else
error('Estimation::mcmc: Particle Smoothers are not yet implemented.')
end
end end
else else
fprintf('Estimation:mcmc: sub_draws was set to 0. Skipping posterior computations.') fprintf('Estimation:mcmc: sub_draws was set to 0. Skipping posterior computations.')
......
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