From e6944521dd5e0c35e735a9be0923ffb66c9608f6 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 11 Apr 2022 17:03:43 +0200 Subject: [PATCH] testsuite: use file-specific names to prevent overwriting while reading --- .../Trend_loglin_no_prefilt_first_obs_MC.mod | 10 ++++----- .../Trend_loglin_prefilt_first_obs_MC.mod | 12 +++++----- .../MCMC/Trend_loglinear_no_prefilter_MC.mod | 10 ++++----- .../MCMC/Trend_loglinear_prefilter_MC.mod | 12 +++++----- .../MCMC/Trend_no_prefilter_MC.mod | 10 ++++----- .../MCMC/Trend_no_prefilter_first_obs_MC.mod | 10 ++++----- .../MCMC/Trend_prefilter_MC.mod | 12 +++++----- .../MCMC/Trend_prefilter_first_obs_MC.mod | 12 +++++----- .../ML/Trend_loglinear_no_prefilter.mod | 8 +++---- ...Trend_loglinear_no_prefilter_first_obs.mod | 8 +++---- .../ML/Trend_loglinear_prefilter.mod | 8 +++---- .../Trend_loglinear_prefilter_first_obs.mod | 8 +++---- .../ML/Trend_no_prefilter.mod | 8 +++---- .../ML/Trend_no_prefilter_first_obs.mod | 8 +++---- .../ML/Trend_no_prefilter_selected_var.mod | 6 ++--- .../ML/Trend_prefilter.mod | 8 +++---- .../ML/Trend_prefilter_first_obs.mod | 8 +++---- ...Tr_no_prefil_f_obs_loglin_cal_smoother.mod | 8 +++---- .../Tr_no_prefilt_first_obs_cal_smooth.mod | 8 +++---- .../Tr_no_prefilter_calib_smoother.mod | 8 +++---- .../Tr_no_prefilter_loglin_calib_smoother.mod | 8 +++---- .../Tr_prefil_f_obs_loglin_cal_smoother.mod | 8 +++---- .../Tr_prefilt_first_obs_cal_smooth.mod | 8 +++---- .../Tr_prefilter_calib_smoother.mod | 8 +++---- .../Tr_prefilter_loglin_calib_smoother.mod | 8 +++---- .../generate_trend_stationary_AR1.m | 22 +++++++++---------- 26 files changed, 121 insertions(+), 123 deletions(-) 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 92798b457..091dfc270 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 @@ -1,17 +1,17 @@ @#include "../Trend_exp_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=400, +estimation(order=1,datafile='Trend_loglin_no_prefilt_first_obs_MC_Exp_AR1_trend_data_with_constant',mh_replic=400, mode_compute=4,first_obs=1000,loglinear,smoother,forecast=100,prefilter=0, - mcmc_jumping_covariance='MCMC_jump_covar', + 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; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglin_no_prefilt_first_obs_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_loglin_no_prefilt_first_obs_MC_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end 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 7ed7bb9c8..775067c8e 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 @@ -1,23 +1,23 @@ @#include "../Trend_exp_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=400, +estimation(order=1,datafile='Trend_loglin_prefilt_first_obs_MC_Exp_AR1_trend_data_with_constant',mh_replic=400, mode_compute=4,first_obs=1000,loglinear,smoother,forecast=100,prefilter=1, - mcmc_jumping_covariance='MCMC_jump_covar_prefilter', + 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; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglin_prefilt_first_obs_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params_prefilter'); +loaded_par=load('Trend_loglin_prefilt_first_obs_MC_orig_params_prefilter'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end -loaded_par_full=load('orig_params'); +loaded_par_full=load('Trend_loglin_prefilt_first_obs_MC_orig_params'); y_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_y',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_y',loaded_par_full.param_names,'exact')); p_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_p',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_p',loaded_par_full.param_names,'exact')); 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 33edf99a1..9353109a5 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 @@ -1,17 +1,17 @@ @#include "../Trend_exp_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=400, +estimation(order=1,datafile='Trend_loglinear_no_prefilter_MC_Exp_AR1_trend_data_with_constant',mh_replic=400, mode_compute=4,first_obs=1,loglinear,diffuse_filter,smoother,forecast=100,prefilter=0, - mcmc_jumping_covariance='MCMC_jump_covar', + 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; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglinear_no_prefilter_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_loglinear_no_prefilter_MC_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end 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 191e8c8ea..0ddcb3742 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 @@ -1,23 +1,23 @@ @#include "../Trend_exp_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=400, +estimation(order=1,datafile='Trend_loglinear_prefilter_MC_Exp_AR1_trend_data_with_constant',mh_replic=400, mode_compute=4,first_obs=1,loglinear,smoother,forecast=100,prefilter=1, - mcmc_jumping_covariance='MCMC_jump_covar_prefilter', + 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; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglinear_prefilter_MC_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params_prefilter'); +loaded_par=load('Trend_loglinear_prefilter_MC_orig_params_prefilter'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end -loaded_par_full=load('orig_params'); +loaded_par_full=load('Trend_loglinear_prefilter_MC_orig_params'); y_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_y',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_y',loaded_par_full.param_names,'exact')); p_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_p',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_p',loaded_par_full.param_names,'exact')); 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 5c0b2b984..8cf321d72 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 @@ -1,17 +1,17 @@ @#include "../Trend_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=400, +estimation(order=1,datafile='Trend_no_prefilter_MC_AR1_trend_data_with_constant',mh_replic=400, 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='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) P_obs Y_obs junk2; -load('AR1_trend_data_with_constant'); +load('Trend_no_prefilter_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_no_prefilter_MC_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end 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 15f487eec..90a9a76cb 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 @@ -1,18 +1,18 @@ @#include "../Trend_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant', +estimation(order=1,datafile='Trend_no_prefilter_first_obs_MC_AR1_trend_data_with_constant', mh_replic=400,mode_compute=4,first_obs=1000,smoother,forecast=100,prefilter=0, - mcmc_jumping_covariance='MCMC_jump_covar', + 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; -load('AR1_trend_data_with_constant'); +load('Trend_no_prefilter_first_obs_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_no_prefilter_first_obs_MC_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end 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 686b0a56d..ba2f88b73 100644 --- a/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_MC.mod +++ b/tests/observation_trends_and_prefiltering/MCMC/Trend_prefilter_MC.mod @@ -1,23 +1,23 @@ @#include "../Trend_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=400,mode_compute=4, +estimation(order=1,datafile='Trend_prefilter_MC_AR1_trend_data_with_constant',mh_replic=400,mode_compute=4, first_obs=1,smoother,prefilter=1, mh_nblocks=1,mh_jscale=1e-4, filtered_vars, filter_step_ahead = [1,2,4], - mcmc_jumping_covariance='MCMC_jump_covar_prefilter',forecast=100) P_obs Y_obs junk2; + mcmc_jumping_covariance='Trend_prefilter_MC_MCMC_jump_covar_prefilter',forecast=100) P_obs Y_obs junk2; -load('AR1_trend_data_with_constant'); +load('Trend_prefilter_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params_prefilter'); +loaded_par=load('Trend_prefilter_MC_orig_params_prefilter'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end -loaded_par_full=load('orig_params'); +loaded_par_full=load('Trend_prefilter_MC_orig_params'); y_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_y',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_y',loaded_par_full.param_names,'exact')); p_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_p',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_p',loaded_par_full.param_names,'exact')); 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 68b44622c..4cfef3cad 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 @@ -1,23 +1,23 @@ @#include "../Trend_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=400,mode_compute=4, +estimation(order=1,datafile='Trend_prefilter_first_obs_MC_AR1_trend_data_with_constant',mh_replic=400,mode_compute=4, first_obs=1000,smoother,prefilter=1, mh_nblocks=1,mh_jscale=1e-4, filtered_vars, filter_step_ahead = [1,2,4], - mcmc_jumping_covariance='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) P_obs Y_obs junk2; -load('AR1_trend_data_with_constant'); +load('Trend_prefilter_first_obs_MC_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params_prefilter'); +loaded_par=load('Trend_prefilter_first_obs_MC_orig_params_prefilter'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end -loaded_par_full=load('orig_params'); +loaded_par_full=load('Trend_prefilter_first_obs_MC_orig_params'); y_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_y',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_y',loaded_par_full.param_names,'exact')); p_forecast_100_periods=loaded_par_full.orig_params(strmatch('const_p',loaded_par_full.param_names,'exact'))+(options_.first_obs+options_.nobs-1+options_.forecast)*loaded_par_full.orig_params(strmatch('g_p',loaded_par_full.param_names,'exact')); diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter.mod b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter.mod index ed638c1dd..b98e24e81 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter.mod @@ -1,17 +1,17 @@ @#include "../Trend_exp_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=0, +estimation(order=1,datafile='Trend_loglinear_no_prefilter_Exp_AR1_trend_data_with_constant',mh_replic=0, mode_compute=4,first_obs=1, filtered_vars, filter_step_ahead = [1,2,4], loglinear,smoother,forecast=100,prefilter=0) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglinear_no_prefilter_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_loglinear_no_prefilter_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter_first_obs.mod b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter_first_obs.mod index 86e09466b..5451c7904 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter_first_obs.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_no_prefilter_first_obs.mod @@ -1,17 +1,17 @@ @#include "../Trend_exp_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=0, +estimation(order=1,datafile='Trend_loglinear_no_prefilter_first_obs_Exp_AR1_trend_data_with_constant',mh_replic=0, mode_compute=4,first_obs=1000, filtered_vars, filter_step_ahead = [1,2,4], loglinear,smoother,forecast=100,prefilter=0) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglinear_no_prefilter_first_obs_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_loglinear_no_prefilter_first_obs_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter.mod b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter.mod index bc0eff742..302c5eb32 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter.mod @@ -1,17 +1,17 @@ @#include "../Trend_exp_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=0,mode_compute=4, +estimation(order=1,datafile='Trend_loglinear_prefilter_Exp_AR1_trend_data_with_constant',mh_replic=0,mode_compute=4, first_obs=1,smoother,loglinear, filtered_vars, filter_step_ahead = [1,2,4], forecast=100,prefilter=1) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglinear_prefilter_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_loglinear_prefilter_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameter estimates do not match') diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter_first_obs.mod b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter_first_obs.mod index 298d9c848..9ae1f90bb 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter_first_obs.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_loglinear_prefilter_first_obs.mod @@ -1,17 +1,17 @@ @#include "../Trend_exp_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='Exp_AR1_trend_data_with_constant',mh_replic=0,mode_compute=4, +estimation(order=1,datafile='Trend_loglinear_prefilter_first_obs_Exp_AR1_trend_data_with_constant',mh_replic=0,mode_compute=4, first_obs=1000,smoother,loglinear, filtered_vars, filter_step_ahead = [1,2,4], forecast=100,prefilter=1) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Trend_loglinear_prefilter_first_obs_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_loglinear_prefilter_first_obs_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameter estimates do not match') diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter.mod b/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter.mod index d7ada7c7b..1e617af87 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter.mod @@ -1,16 +1,16 @@ @#include "../Trend_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=0, +estimation(order=1,datafile='Trend_no_prefilter_AR1_trend_data_with_constant',mh_replic=0, mode_compute=4,first_obs=1, filtered_vars, filter_step_ahead = [1,2,4], diffuse_filter,smoother,forecast=100,prefilter=0) P_obs Y_obs junk2; -load('AR1_trend_data_with_constant'); +load('Trend_no_prefilter_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_no_prefilter_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameter estimates do not match') end diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_first_obs.mod b/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_first_obs.mod index a120ee412..feab481a6 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_first_obs.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_first_obs.mod @@ -1,17 +1,17 @@ @#include "../Trend_model_no_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=0, +estimation(order=1,datafile='Trend_no_prefilter_first_obs_AR1_trend_data_with_constant',mh_replic=0, mode_compute=4,first_obs=1000, filtered_vars, filter_step_ahead = [1,2,4], smoother,forecast=100,prefilter=0) P_obs Y_obs junk2; -load('AR1_trend_data_with_constant'); +load('Trend_no_prefilter_first_obs_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_no_prefilter_first_obs_orig_params'); if max(abs(M_.params-loaded_par.orig_params)./loaded_par.orig_params)>0.03 error('Parameter estimates do not match') end diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_selected_var.mod b/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_selected_var.mod index b64d27fdd..2a25030d0 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_selected_var.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_no_prefilter_selected_var.mod @@ -63,9 +63,9 @@ estimated_params_init(use_calibration); end; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=0, +estimation(order=1,datafile='Trend_no_prefilter_selected_var_AR1_trend_data_with_constant',mh_replic=0, mode_compute=4,first_obs=1,nobs=1000, filtered_vars, filter_step_ahead = [1,2,4], diffuse_filter,filter_covariance,smoother,forecast=0,prefilter=0,filter_decomposition) P_obs Y_obs junk2; @@ -82,7 +82,7 @@ oo_.UpdatedVariables = []; oo_.SmoothedShocks = []; set_dynare_seed('default'); -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=0, +estimation(order=1,datafile='Trend_no_prefilter_selected_var_AR1_trend_data_with_constant',mh_replic=0, mode_compute=4,first_obs=1,nobs=1000, filtered_vars, filter_step_ahead = [1,2,4], diffuse_filter,smoother,forecast=0,filter_covariance,prefilter=0,filter_decomposition,selected_variables_only) P_obs Y_obs junk2; diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_prefilter.mod b/tests/observation_trends_and_prefiltering/ML/Trend_prefilter.mod index 764184a60..e6a73210d 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_prefilter.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_prefilter.mod @@ -1,17 +1,17 @@ @#include "../Trend_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname) -estimation(order=1,datafile='AR1_trend_data_with_constant',mh_replic=0,mode_compute=4, +estimation(order=1,datafile='Trend_prefilter_AR1_trend_data_with_constant',mh_replic=0,mode_compute=4, first_obs=1, filtered_vars, filter_step_ahead = [1,2,4], smoother,forecast=100,prefilter=1) P_obs Y_obs junk2; -load('AR1_trend_data_with_constant'); +load('Trend_prefilter_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_prefilter_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameter estimates do not match') diff --git a/tests/observation_trends_and_prefiltering/ML/Trend_prefilter_first_obs.mod b/tests/observation_trends_and_prefiltering/ML/Trend_prefilter_first_obs.mod index 19483496d..f9fc52af2 100644 --- a/tests/observation_trends_and_prefiltering/ML/Trend_prefilter_first_obs.mod +++ b/tests/observation_trends_and_prefiltering/ML/Trend_prefilter_first_obs.mod @@ -1,18 +1,18 @@ @#include "../Trend_model_prefilter_common.inc" addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -estimation(order=1,datafile='AR1_trend_data_with_constant', +estimation(order=1,datafile='Trend_prefilter_first_obs_AR1_trend_data_with_constant', mh_replic=0,mode_compute=4, filtered_vars, filter_step_ahead = [1,2,4], first_obs=1000,diffuse_filter,smoother,forecast=100,prefilter=1) P_obs Y_obs junk2; -load('AR1_trend_data_with_constant'); +load('Trend_prefilter_first_obs_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Trend_prefilter_first_obs_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameter estimates do not match') diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefil_f_obs_loglin_cal_smoother.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefil_f_obs_loglin_cal_smoother.mod index cbec86f6d..ad67064ff 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefil_f_obs_loglin_cal_smoother.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefil_f_obs_loglin_cal_smoother.mod @@ -2,15 +2,15 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='Exp_AR1_trend_data_with_constant',prefilter=0,loglinear,first_obs=1000, +calib_smoother(datafile='Tr_no_prefil_f_obs_loglin_cal_smoother_Exp_AR1_trend_data_with_constant',prefilter=0,loglinear,first_obs=1000, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Tr_no_prefil_f_obs_loglin_cal_smoother_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_no_prefil_f_obs_loglin_cal_smoother_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilt_first_obs_cal_smooth.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilt_first_obs_cal_smooth.mod index e9f2c4797..f5da7ef7d 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilt_first_obs_cal_smooth.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilt_first_obs_cal_smooth.mod @@ -2,16 +2,16 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='AR1_trend_data_with_constant',prefilter=0,first_obs=1000, +calib_smoother(datafile='Tr_no_prefilt_first_obs_cal_smooth_AR1_trend_data_with_constant',prefilter=0,first_obs=1000, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs; -load('AR1_trend_data_with_constant'); +load('Tr_no_prefilt_first_obs_cal_smooth_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_no_prefilt_first_obs_cal_smooth_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_calib_smoother.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_calib_smoother.mod index 2d49952a8..01cdb3b31 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_calib_smoother.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_calib_smoother.mod @@ -2,15 +2,15 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='AR1_trend_data_with_constant',prefilter=0, +calib_smoother(datafile='Tr_no_prefilter_calib_smoother_AR1_trend_data_with_constant',prefilter=0, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs; -load('AR1_trend_data_with_constant'); +load('Tr_no_prefilter_calib_smoother_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_no_prefilter_calib_smoother_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_loglin_calib_smoother.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_loglin_calib_smoother.mod index b3c242fd4..ec2bcafdd 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_loglin_calib_smoother.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_no_prefilter_loglin_calib_smoother.mod @@ -2,16 +2,16 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='Exp_AR1_trend_data_with_constant',prefilter=0,loglinear, +calib_smoother(datafile='Tr_no_prefilter_loglin_calib_smoother_Exp_AR1_trend_data_with_constant',prefilter=0,loglinear, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Tr_no_prefilter_loglin_calib_smoother_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_no_prefilter_loglin_calib_smoother_orig_params'); if max(abs((M_.params-loaded_par.orig_params)./loaded_par.orig_params))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefil_f_obs_loglin_cal_smoother.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefil_f_obs_loglin_cal_smoother.mod index 16fa8a76d..59baf74b0 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefil_f_obs_loglin_cal_smoother.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefil_f_obs_loglin_cal_smoother.mod @@ -2,15 +2,15 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='Exp_AR1_trend_data_with_constant',prefilter=1,loglinear,first_obs=1000, +calib_smoother(datafile='Tr_prefil_f_obs_loglin_cal_smoother_Exp_AR1_trend_data_with_constant',prefilter=1,loglinear,first_obs=1000, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Tr_prefil_f_obs_loglin_cal_smoother_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_prefil_f_obs_loglin_cal_smoother_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilt_first_obs_cal_smooth.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilt_first_obs_cal_smooth.mod index 4c87f01e6..cca9d259a 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilt_first_obs_cal_smooth.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilt_first_obs_cal_smooth.mod @@ -2,15 +2,15 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='AR1_trend_data_with_constant',prefilter=1,first_obs=1000, +calib_smoother(datafile='Tr_prefilt_first_obs_cal_smooth_AR1_trend_data_with_constant',prefilter=1,first_obs=1000, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs; -load('AR1_trend_data_with_constant'); +load('Tr_prefilt_first_obs_cal_smooth_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_prefilt_first_obs_cal_smooth_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_calib_smoother.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_calib_smoother.mod index 4c5ca5b1a..dfe56e7ef 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_calib_smoother.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_calib_smoother.mod @@ -2,15 +2,15 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='AR1_trend_data_with_constant',prefilter=1, +calib_smoother(datafile='Tr_prefilter_calib_smoother_AR1_trend_data_with_constant',prefilter=1, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs; -load('AR1_trend_data_with_constant'); +load('Tr_prefilter_calib_smoother_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_prefilter_calib_smoother_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_loglin_calib_smoother.mod b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_loglin_calib_smoother.mod index 216741f7d..63576f4ac 100644 --- a/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_loglin_calib_smoother.mod +++ b/tests/observation_trends_and_prefiltering/calib_smoother/Tr_prefilter_loglin_calib_smoother.mod @@ -2,15 +2,15 @@ options_.filter_decomposition=1; addpath('..'); -generate_trend_stationary_AR1; +generate_trend_stationary_AR1(M_.fname); -calib_smoother(datafile='Exp_AR1_trend_data_with_constant',prefilter=1,loglinear, +calib_smoother(datafile='Tr_prefilter_loglin_calib_smoother_Exp_AR1_trend_data_with_constant',prefilter=1,loglinear, // filter_decomposition, filtered_vars, filter_step_ahead = [1,2,4]) P_obs Y_obs junk2; -load('Exp_AR1_trend_data_with_constant'); +load('Tr_prefilter_loglin_calib_smoother_Exp_AR1_trend_data_with_constant'); @#include "../Trend_load_data_common.inc" -loaded_par=load('orig_params'); +loaded_par=load('Tr_prefilter_loglin_calib_smoother_orig_params'); if max(abs((M_.params-loaded_par.orig_params([1:4,7:8]))./loaded_par.orig_params([1:4,7:8])))>0.03 error('Parameters do not match') end diff --git a/tests/observation_trends_and_prefiltering/generate_trend_stationary_AR1.m b/tests/observation_trends_and_prefiltering/generate_trend_stationary_AR1.m index e56da7779..a2ea9f96d 100644 --- a/tests/observation_trends_and_prefiltering/generate_trend_stationary_AR1.m +++ b/tests/observation_trends_and_prefiltering/generate_trend_stationary_AR1.m @@ -1,4 +1,4 @@ -function generate_trend_stationary_AR1 +function generate_trend_stationary_AR1(fname) n_periods=10000; rho_y=0.5; rho_p=0.5; @@ -12,17 +12,17 @@ sigma_p=0.001; orig_params=[rho_y rho_p g_y g_p sigma_y sigma_p]'; param_names={'rho_y'; 'rho_p'; 'g_y'; 'g_p'; 'sigma_y'; 'sigma_p'}; -save orig_params_prefilter.mat orig_params param_names +save([fname '_orig_params_prefilter.mat'],'orig_params','param_names') orig_params = [rho_y rho_p g_y g_p const_y const_p sigma_y sigma_p]'; param_names = {'rho_y'; 'rho_p'; 'g_y'; 'g_p'; 'const_y'; 'const_p'; 'sigma_y'; 'sigma_p'}; -save orig_params.mat orig_params param_names +save([fname '_orig_params.mat'],'orig_params','param_names') jumping_covariance=diag([1e-8; 1e-8; 1e-16; 1e-16; 1e-8; 1e-8; 1e-12; 1e-12;])^-1; -save MCMC_jump_covar.mat jumping_covariance +save([fname '_MCMC_jump_covar.mat'],'jumping_covariance'); jumping_covariance=diag([1e-8; 1e-8; 1e-16; 1e-16; 1e-12; 1e-12;])^-1; -save MCMC_jump_covar_prefilter.mat jumping_covariance +save([fname '_MCMC_jump_covar_prefilter.mat'],'jumping_covariance'); %% data without constant log_P=zeros(1,n_periods); @@ -40,7 +40,7 @@ log_Y=log_Y+g_y*(1:n_periods); Y_obs=exp(log_Y); P_obs=exp(log_P); junk2=exp(junk2_orig); -save Exp_AR1_trend_data_no_constant.mat Y_obs P_obs junk2 +save([fname '_Exp_AR1_trend_data_no_constant.mat'],'Y_obs','P_obs','junk2') % % [b_p,~,~,~,stats_p] = regress(log(P_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' log(P_obs(1:end-1)')]); % [b_y,~,~,~,stats_y] = regress(log(Y_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' log(Y_obs(1:end-1)')]); @@ -48,7 +48,7 @@ save Exp_AR1_trend_data_no_constant.mat Y_obs P_obs junk2 Y_obs=log_Y; P_obs=log_P; junk2=junk2_orig; -save AR1_trend_data_no_constant.mat Y_obs P_obs junk2 +save([fname '_AR1_trend_data_no_constant.mat'],'Y_obs','P_obs','junk2') % [b_p,~,~,~,stats_p] = regress((P_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' (P_obs(1:end-1)')]); % [b_y,~,~,~,stats_y] = regress((Y_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' (Y_obs(1:end-1)')]); @@ -69,7 +69,7 @@ log_Y=log_Y+g_y*(1:n_periods); Y_obs=exp(log_Y); P_obs=exp(log_P); junk2=exp(junk2_orig); -save Exp_AR1_trend_data_with_constant.mat Y_obs P_obs junk2 +save([fname '_Exp_AR1_trend_data_with_constant.mat'],'Y_obs','P_obs','junk2') % [b,bint,r,rint,stats] = regress(log(P_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' log(P_obs(1:end-1)')]); % [b,bint,r,rint,stats] = regress(log(Y_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' log(Y_obs(1:end-1)')]); @@ -77,9 +77,7 @@ save Exp_AR1_trend_data_with_constant.mat Y_obs P_obs junk2 Y_obs=log_Y; P_obs=log_P; junk2=junk2_orig; -save AR1_trend_data_with_constant.mat Y_obs P_obs junk2 +save([fname '_AR1_trend_data_with_constant.mat'],'Y_obs','P_obs','junk2') % [b_p,~,~,~,stats_p] = regress((P_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' (P_obs(1:end-1)')]); -% [b_y,~,~,~,stats_y] = regress((Y_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' (Y_obs(1:end-1)')]); - - +% [b_y,~,~,~,stats_y] = regress((Y_obs(2:end))',[ones(n_periods-1,1) (2:n_periods)' (Y_obs(1:end-1)')]); \ No newline at end of file