Merge branch 'obs_test' of git.dynare.org:JohannesPfeifer/dynare

Ref. !2019
mr#2005
Sébastien Villemot 2022-04-12 15:54:10 +02:00
commit 9c8033d99e
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
26 changed files with 121 additions and 123 deletions

View File

@ -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

View File

@ -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'));

View File

@ -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

View File

@ -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'));

View File

@ -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

View File

@ -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

View File

@ -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'));

View File

@ -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'));

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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')

View File

@ -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')

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)')]);