From de576398c42d36702d400e45559a23cd2c80070c Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Tue, 4 Feb 2025 09:40:53 +0100 Subject: [PATCH] Speed up testsuite (manually cherry picked from commit 01e3f513d583827083ffd12557d13894ed07b811) --- tests/estimation/univariate/bayesian.mod | 2 +- tests/estimation/univariate/bayesian_param_names.mod | 4 ++-- .../MCMC/Trend_loglin_no_prefilt_first_obs_MC.mod | 2 +- .../MCMC/Trend_loglin_prefilt_first_obs_MC.mod | 2 +- .../MCMC/Trend_loglinear_no_prefilter_MC.mod | 2 +- .../MCMC/Trend_loglinear_prefilter_MC.mod | 2 +- .../MCMC/Trend_no_prefilter_MC.mod | 2 +- .../MCMC/Trend_no_prefilter_first_obs_MC.mod | 2 +- .../MCMC/Trend_prefilter_MC.mod | 2 +- .../MCMC/Trend_prefilter_first_obs_MC.mod | 2 +- tests/particle/dsge_base2.mod | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/estimation/univariate/bayesian.mod b/tests/estimation/univariate/bayesian.mod index d5dcce24f7..0a21e59196 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 54e042a08c..a148754dfc 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 05f602b22c..1287d2915d 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 c50534c9b4..e68ceef662 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 03d99442ff..39869dd1e2 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 e74801bf0e..80c0a0a878 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 9c89cf9e03..07928c9f8a 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 58fc82ad37..b48dbf3639 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 2153093ce2..8b6ad28ecc 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 79668c5764..669bf6e7d7 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 eb5a0c8f6a..baeee8557c 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); -- GitLab