diff --git a/matlab/estimation/online/online_auxiliary_filter.m b/matlab/estimation/online/online_auxiliary_filter.m index f4945f491f57cf98ff706546f32519b8e976d73f..461cb888e7abc1dd2ab0e3f87d01dbf4694d6a52 100644 --- a/matlab/estimation/online/online_auxiliary_filter.m +++ b/matlab/estimation/online/online_auxiliary_filter.m @@ -31,6 +31,7 @@ function online_auxiliary_filter(xparam1, dataset_, options_, M_, estim_params_, % Set seed for randn(). options_ = set_dynare_seed_local_options(options_,'default'); +options_.verbosity=0; %particularly suppress warning messages during k_order_pert within the loop pruning = options_.particle.pruning; variance_update = true; online_opt = options_.posterior_sampler_options.current_options; @@ -78,10 +79,10 @@ xparam = zeros(number_of_parameters,number_of_particles); Prior = dprior(bayestopt_, options_.prior_trunc); for i=1:number_of_particles info = 12042009; - while info + while info(1) candidate = Prior.draw(); [info] = solve_model_for_online_filter(false, candidate, dataset_, options_, M_, estim_params_, bayestopt_, bounds, oo_.dr , oo_.steady_state, oo_.exo_steady_state, oo_.exo_det_steady_state); - if ~info + if ~info(1) xparam(:,i) = candidate(:); end end diff --git a/tests/estimation/univariate/bayesian.mod b/tests/estimation/univariate/bayesian.mod index d5dcce24f7dc3616e9a69e567acac0f2642dbe07..0a21e59196e6b574a0ad671fb776899ac10c6734 100644 --- a/tests/estimation/univariate/bayesian.mod +++ b/tests/estimation/univariate/bayesian.mod @@ -47,7 +47,7 @@ s2df = 1; // form expression for the joint posterior marginal distribution of β, a Gibbs // sampling algorithm is used (the prior for β and the inverse of σ² are independent). -gibbslength = 1000000; // Set the number of iterations in Gibbs +gibbslength = 300000; // Set the number of iterations in Gibbs burnin = 10000; // Set the number of iterations to be discarded (try to remove the effects of the initial condition). steps = 10; // Do not record all iterations (try to remove the dependence between the draws). diff --git a/tests/estimation/univariate/bayesian_param_names.mod b/tests/estimation/univariate/bayesian_param_names.mod index 54e042a08cb7ec01a604fc3f38a690e3281c8c57..a148754dfce286cb87f1bfc99073c089ba4ebcd8 100644 --- a/tests/estimation/univariate/bayesian_param_names.mod +++ b/tests/estimation/univariate/bayesian_param_names.mod @@ -50,14 +50,14 @@ s2df = 1; // form expression for the joint posterior marginal distribution of β, a Gibbs // sampling algorithm is used (the prior for β and the inverse of σ² are independent). -gibbslength = 1000000; // Set the number of iterations in Gibbs +gibbslength = 100000; // Set the number of iterations in Gibbs burnin = 10000; // Set the number of iterations to be discarded (try to remove the effects of the initial condition). steps = 10; // Do not record all iterations (try to remove the dependence between the draws). ds = olsgibbs(ds, 'eqols', beta0, V0, s2priormean, s2df, gibbslength, burnin, steps, {'eqols', 'eqols_olsgibbs_fit'}, 'olsgibbs_eq',{'b2'; 'b3'}); // Since we use a diffuse prior for β, the posterior mean of β should be close to the OLS estimate. -if max(abs(oo_.ols.ols_eq.beta-oo_.olsgibbs.olsgibbs_eq.posterior.mean.beta))>.1 +if max(abs(oo_.ols.ols_eq.beta-oo_.olsgibbs.olsgibbs_eq.posterior.mean.beta))>.01 error('Something is wrong in the Gibbs sampling routine (univariate model)') end diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_no_prefilt_first_obs_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_no_prefilt_first_obs_MC.mod index 05f602b22c3d48c83cd68eb5dc0957b55acd30bc..1287d2915d12078c3dab25d2e367c181a3a2a37c 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_no_prefilt_first_obs_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_no_prefilt_first_obs_MC.mod @@ -7,7 +7,7 @@ estimation(order=1,datafile='Trend_loglin_no_prefilt_first_obs_MC_Exp_AR1_trend_ mode_compute=4,silent_optimizer,first_obs=1000,loglinear,smoother,forecast=100,prefilter=0, mcmc_jumping_covariance='Trend_loglin_no_prefilt_first_obs_MC_MCMC_jump_covar', filtered_vars, filter_step_ahead = [1,2,4], - mh_nblocks=1,mh_jscale=0.3,no_posterior_kernel_density) P_obs Y_obs junk2; + mh_nblocks=1,mh_jscale=0.3,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_loglin_no_prefilt_first_obs_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_prefilt_first_obs_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_prefilt_first_obs_MC.mod index c50534c9b4e27dfde3091ae5b1e61a16c2abaea7..e68ceef6622d9102fc411aef68a920e451db7d50 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_prefilt_first_obs_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglin_prefilt_first_obs_MC.mod @@ -7,7 +7,7 @@ estimation(order=1,datafile='Trend_loglin_prefilt_first_obs_MC_Exp_AR1_trend_dat mode_compute=4,silent_optimizer,first_obs=1000,loglinear,smoother,forecast=100,prefilter=1, mcmc_jumping_covariance='Trend_loglin_prefilt_first_obs_MC_MCMC_jump_covar_prefilter', filtered_vars, filter_step_ahead = [1,2,4], - mh_nblocks=1,mh_jscale=1e-4,no_posterior_kernel_density) P_obs Y_obs junk2; + mh_nblocks=1,mh_jscale=1e-4,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_loglin_prefilt_first_obs_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_no_prefilter_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_no_prefilter_MC.mod index 03d99442ff86f93993b05016ab6ab7f3cdfe1499..39869dd1e2a43b5078b0a4014309d4d260716685 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_no_prefilter_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_no_prefilter_MC.mod @@ -7,7 +7,7 @@ estimation(order=1,datafile='Trend_loglinear_no_prefilter_MC_Exp_AR1_trend_data_ mode_compute=4,silent_optimizer,first_obs=1,loglinear,diffuse_filter,smoother,forecast=100,prefilter=0, mcmc_jumping_covariance='Trend_loglinear_no_prefilter_MC_MCMC_jump_covar', filtered_vars, filter_step_ahead = [1,2,4], - mh_nblocks=1,mh_jscale=0.3) P_obs Y_obs junk2; + mh_nblocks=1,mh_jscale=0.3,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_loglinear_no_prefilter_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_prefilter_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_prefilter_MC.mod index e74801bf0e2b79cd9e3b7443645411676338d83f..80c0a0a878982e5024f9464fa1c55d81e20141c7 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_prefilter_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_loglinear_prefilter_MC.mod @@ -7,7 +7,7 @@ estimation(order=1,datafile='Trend_loglinear_prefilter_MC_Exp_AR1_trend_data_wit mode_compute=4,silent_optimizer,first_obs=1,loglinear,smoother,forecast=100,prefilter=1, mcmc_jumping_covariance='Trend_loglinear_prefilter_MC_MCMC_jump_covar_prefilter', filtered_vars, filter_step_ahead = [1,2,4], - mh_nblocks=1,mh_jscale=1e-4) P_obs Y_obs junk2; + mh_nblocks=1,mh_jscale=1e-4,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_loglinear_prefilter_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_MC.mod index 9c89cf9e035022b79f9fdf3185aa7b4e9aa2ff9b..07928c9f8ad2aa603cf3cc8eb5cc2522be1c90f0 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_MC.mod @@ -6,7 +6,7 @@ generate_trend_stationary_AR1(M_.fname); estimation(order=1,datafile='Trend_no_prefilter_MC_AR1_trend_data_with_constant',mh_replic=400,silent_optimizer, mode_compute=4,first_obs=1,smoother,mh_nblocks=1,mh_jscale=0.3, filtered_vars, filter_step_ahead = [1,2,4], - mcmc_jumping_covariance='Trend_no_prefilter_MC_MCMC_jump_covar',forecast=100,prefilter=0) P_obs Y_obs junk2; + mcmc_jumping_covariance='Trend_no_prefilter_MC_MCMC_jump_covar',forecast=100,prefilter=0,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_no_prefilter_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_first_obs_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_first_obs_MC.mod index 58fc82ad3757d9eb41a6326e976679717ea876de..b48dbf3639e61b7ddfe2f332a6d178848c281980 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_first_obs_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_no_prefilter_first_obs_MC.mod @@ -7,7 +7,7 @@ estimation(order=1,datafile='Trend_no_prefilter_first_obs_MC_AR1_trend_data_with mh_replic=400,mode_compute=4,silent_optimizer,first_obs=1000,smoother,forecast=100,prefilter=0, mcmc_jumping_covariance='Trend_no_prefilter_first_obs_MC_MCMC_jump_covar', filtered_vars, filter_step_ahead = [1,2,4], - mh_nblocks=1,mh_jscale=0.3,no_posterior_kernel_density) P_obs Y_obs junk2; + mh_nblocks=1,mh_jscale=0.3,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_no_prefilter_first_obs_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_MC.mod index 2153093ce25163e1371f166c9311353435c7af6b..8b6ad28ecc304598a89e9c300c61b74d561fb272 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_MC.mod @@ -7,7 +7,7 @@ estimation(order=1,datafile='Trend_prefilter_MC_AR1_trend_data_with_constant',mh first_obs=1,smoother,prefilter=1, mh_nblocks=1,mh_jscale=1e-4, filtered_vars, filter_step_ahead = [1,2,4], - mcmc_jumping_covariance='Trend_prefilter_MC_MCMC_jump_covar_prefilter',forecast=100) P_obs Y_obs junk2; + mcmc_jumping_covariance='Trend_prefilter_MC_MCMC_jump_covar_prefilter',forecast=100,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_prefilter_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_first_obs_MC.mod b/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_first_obs_MC.mod index 79668c5764396350a261c14bd9b11823aa74b71f..669bf6e7d7bfaee9a943c987ccdfc82fd42334ab 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_first_obs_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_first_obs_MC.mod @@ -7,7 +7,7 @@ estimation(order=1,datafile='Trend_prefilter_first_obs_MC_AR1_trend_data_with_co first_obs=1000,smoother,prefilter=1, mh_nblocks=1,mh_jscale=1e-4, filtered_vars, filter_step_ahead = [1,2,4], - mcmc_jumping_covariance='Trend_prefilter_first_obs_MC_MCMC_jump_covar_prefilter',forecast=100,no_posterior_kernel_density) P_obs Y_obs junk2; + mcmc_jumping_covariance='Trend_prefilter_first_obs_MC_MCMC_jump_covar_prefilter',forecast=100,no_posterior_kernel_density,nograph,sub_draws=100) P_obs Y_obs junk2; load('Trend_prefilter_first_obs_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" diff --git a/tests/particle/dsge_base2.mod b/tests/particle/dsge_base2.mod index 473e9366e750f8426650e30a4ae1544dad7ffa68..93e275ef441b27673420ebeb7322c5f43eb1da4c 100644 --- a/tests/particle/dsge_base2.mod +++ b/tests/particle/dsge_base2.mod @@ -105,7 +105,7 @@ varobs y l i ; %datatomfile('mysample') %return; -data(file='./mysample.m',first_obs=801Y,nobs=200); %no measurement errors added in the simulated data +data(file='./mysample.m',first_obs=801Y,nobs=50); %no measurement errors added in the simulated data @#if LINEAR_KALMAN estimation(nograph,order=1,mode_compute=8,silent_optimizer,mh_replic=0,additional_optimizer_steps=[8 4],mode_check); @@ -155,7 +155,7 @@ estimation(order=3,nograph,filter_algorithm=gf,proposal_approximation=montecarlo % estimation(order=3,nograph,number_of_particles=10000,mode_compute=11,mh_replic=0,particle_filter_options=('liu_west_delta',0.9)); estimation(order=1,posterior_sampling_method='online',posterior_sampler_options=('particles',1000)); estimation(order=2,posterior_sampling_method='online',posterior_sampler_options=('particles',1000)); - estimation(order=3,posterior_sampling_method='online',filter_algorithm=nlkf,proposal_approximation=montecarlo,number_of_particles=500,posterior_sampler_options=('particles',500)); + estimation(order=3,posterior_sampling_method='online',filter_algorithm=nlkf,proposal_approximation=montecarlo,number_of_particles=100,posterior_sampler_options=('particles',100)); @#endif @#if MCMC