From e6944521dd5e0c35e735a9be0923ffb66c9608f6 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
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 92798b4576..091dfc2709 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 7ed7bb9c86..775067c8ec 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 33edf99a1f..9353109a5c 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 191e8c8ea6..0ddcb37426 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 5c0b2b984f..8cf321d725 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 15f487eec4..90a9a76cb7 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 686b0a56d2..ba2f88b731 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 68b44622c3..4cfef3cada 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 ed638c1dd3..b98e24e815 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 86e09466b5..5451c79042 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 bc0eff7422..302c5eb321 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 298d9c8480..9ae1f90bb4 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 d7ada7c7b4..1e617af876 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 a120ee412a..feab481a6d 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 b64d27fddc..2a25030d04 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 764184a602..e6a73210d7 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 19483496d7..f9fc52af24 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 cbec86f6d2..ad67064ffd 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 e9f2c47978..f5da7ef7dc 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 2d49952a8d..01cdb3b312 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 b3c242fd40..ec2bcafdd3 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 16fa8a76d5..59baf74b07 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 4c87f01e6d..cca9d259a0 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 4c5ca5b1a1..dfe56e7efb 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 216741f7dc..63576f4ac0 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 e56da7779e..a2ea9f96d5 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
-- 
GitLab