From 488ab7a979a91a3cddbcfa8c789d41316d3a4751 Mon Sep 17 00:00:00 2001 From: Willi Mutschler <willi@mutschler.eu> Date: Fri, 12 Nov 2021 16:22:22 +0100 Subject: [PATCH] Update testsuite Kalman Smoother name of data file gen_data.mod creates a datafile called "data.mat" test_compute_Pinf_Pstar_data.mod creates a datafile called "Data.mat" There could be a race condition on systems that don't distinguish between upper and lower cases. --- tests/Makefile.am | 3 ++- tests/kalman_filter_smoother/algo1.mod | 6 +++--- tests/kalman_filter_smoother/algo2.mod | 4 ++-- tests/kalman_filter_smoother/algo3.mod | 4 ++-- tests/kalman_filter_smoother/algo4.mod | 4 ++-- tests/kalman_filter_smoother/algo4a.mod | 6 +++--- tests/kalman_filter_smoother/algo4b.mod | 6 +++--- tests/kalman_filter_smoother/algoH1.mod | 4 ++-- tests/kalman_filter_smoother/algoH2.mod | 6 +++--- tests/kalman_filter_smoother/algoH3.mod | 4 ++-- tests/kalman_filter_smoother/gen_data.mod | 2 +- tests/kalman_filter_smoother/test_compute_Pinf_Pstar.mod | 2 +- .../kalman_filter_smoother/test_compute_Pinf_Pstar_data.mod | 2 +- 13 files changed, 27 insertions(+), 26 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index f4f2ec1637..527d4cdd22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1470,7 +1470,8 @@ clean-local: rm -f arima/data1.m arima/data2.m \ k_order_perturbation/*.jnl \ k_order_perturbation/*.mat \ - kalman_filter_smoother/data.mat + kalman_filter_smoother/data_algo.mat \ + kalman_filter_smoother/data_Pinf_Pstar.mat rm -f data_ca1_csv.csv diff --git a/tests/kalman_filter_smoother/algo1.mod b/tests/kalman_filter_smoother/algo1.mod index 95e34daf1d..7cbaf4eb89 100644 --- a/tests/kalman_filter_smoother/algo1.mod +++ b/tests/kalman_filter_smoother/algo1.mod @@ -32,7 +32,7 @@ end; varobs dw dx dy z; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,filtered_vars,smoothed_state_uncertainty); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,filtered_vars,smoothed_state_uncertainty); //checking smoother consistency X = oo_.SmoothedVariables; @@ -49,8 +49,8 @@ if max(max(abs(err))) > 1e-10; error('Test fails') end; -d=load('data'); +d=load('data_algo'); dat = [d.dw d.dx d.dy d.z]; if max(max(abs(dat(1000:1199,:)-S(:,[2:4 1])))) > 1e-10; error('Test fails'); -end; \ No newline at end of file +end; diff --git a/tests/kalman_filter_smoother/algo2.mod b/tests/kalman_filter_smoother/algo2.mod index b18eeb42a1..63fb74c442 100644 --- a/tests/kalman_filter_smoother/algo2.mod +++ b/tests/kalman_filter_smoother/algo2.mod @@ -32,7 +32,7 @@ end; varobs dw dx dy z; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo1/Output/algo1_mode',kalman_algo=2,filtered_vars,smoothed_state_uncertainty); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo1/Output/algo1_mode',kalman_algo=2,filtered_vars,smoothed_state_uncertainty); //checking smoother consistency X = oo_.SmoothedVariables; @@ -49,7 +49,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.dw d.dx d.dy d.z]; if max(max(abs(dat(1000:1199,:)-S(:,[2:4 1])))) > 1e-10; error('Test fails'); diff --git a/tests/kalman_filter_smoother/algo3.mod b/tests/kalman_filter_smoother/algo3.mod index 4a7b0c668c..9aa866252e 100644 --- a/tests/kalman_filter_smoother/algo3.mod +++ b/tests/kalman_filter_smoother/algo3.mod @@ -35,7 +35,7 @@ end; varobs w x y; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,filtered_vars,smoothed_state_uncertainty); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,filtered_vars,smoothed_state_uncertainty); //checking smoother consistency X = oo_.SmoothedVariables; @@ -52,7 +52,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.w d.x d.y]; if max(max(abs(dat(1000:1199,:)-S(:,[7:9])))) > 1e-10; error('Test fails'); diff --git a/tests/kalman_filter_smoother/algo4.mod b/tests/kalman_filter_smoother/algo4.mod index 7d26340ce7..4ebd8bd459 100644 --- a/tests/kalman_filter_smoother/algo4.mod +++ b/tests/kalman_filter_smoother/algo4.mod @@ -35,7 +35,7 @@ end; varobs w x y; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter,kalman_algo=4,filtered_vars,smoothed_state_uncertainty); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter,kalman_algo=4,filtered_vars,smoothed_state_uncertainty); //checking smoother consistency X = oo_.SmoothedVariables; @@ -52,7 +52,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.w d.x d.y]; if max(max(abs(dat(1000:1199,:)-S(:,[7:9])))) > 1e-10; error('Test fails'); diff --git a/tests/kalman_filter_smoother/algo4a.mod b/tests/kalman_filter_smoother/algo4a.mod index 28c8b65114..0ee94e30f6 100644 --- a/tests/kalman_filter_smoother/algo4a.mod +++ b/tests/kalman_filter_smoother/algo4a.mod @@ -33,8 +33,8 @@ end; varobs dw dx y z; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter); -//estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter); +//estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter); //checking smoother consistency X = oo_.SmoothedVariables; @@ -51,7 +51,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.dw d.dx d.y d.z]; if max(max(abs(dat(1000:1199,:)-S(:,[2 3 7 1])))) > 1e-10; error('Test fails'); diff --git a/tests/kalman_filter_smoother/algo4b.mod b/tests/kalman_filter_smoother/algo4b.mod index 0e6c6da925..568484afe0 100644 --- a/tests/kalman_filter_smoother/algo4b.mod +++ b/tests/kalman_filter_smoother/algo4b.mod @@ -33,8 +33,8 @@ end; varobs dw dx y z; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,smoothed_state_uncertainty); -//estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,smoothed_state_uncertainty); +//estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algo3/Output/algo3_mode',diffuse_filter); //checking smoother consistency X = oo_.SmoothedVariables; @@ -51,7 +51,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.dw d.dx d.y d.z]; if max(max(abs(dat(1000:1199,:)-S(:,[2 3 7 1])))) > 1e-10; error('Test fails'); diff --git a/tests/kalman_filter_smoother/algoH1.mod b/tests/kalman_filter_smoother/algoH1.mod index 200dec37f2..7a852b9791 100644 --- a/tests/kalman_filter_smoother/algoH1.mod +++ b/tests/kalman_filter_smoother/algoH1.mod @@ -34,7 +34,7 @@ end; varobs dw dx dy z; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,filtered_vars,smoothed_state_uncertainty); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,filtered_vars,smoothed_state_uncertainty); //checking smoother consistency X = oo_.SmoothedVariables; @@ -51,7 +51,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.dw d.dx d.dy d.z]; X = oo_.SmoothedMeasurementErrors; ME = [X.dw X.dx X.dy X.z]; diff --git a/tests/kalman_filter_smoother/algoH2.mod b/tests/kalman_filter_smoother/algoH2.mod index 39f750995b..e25801ba39 100644 --- a/tests/kalman_filter_smoother/algoH2.mod +++ b/tests/kalman_filter_smoother/algoH2.mod @@ -34,8 +34,8 @@ end; varobs dw dx dy z; -//estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,kalman_algo=2); -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algoH1/Output/algoH1_mode',kalman_algo=2,filtered_vars,smoothed_state_uncertainty); +//estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,kalman_algo=2); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file='algoH1/Output/algoH1_mode',kalman_algo=2,filtered_vars,smoothed_state_uncertainty); //checking smoother consistency X = oo_.SmoothedVariables; @@ -52,7 +52,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.dw d.dx d.dy d.z]; X = oo_.SmoothedMeasurementErrors; ME = [X.dw X.dx X.dy X.z]; diff --git a/tests/kalman_filter_smoother/algoH3.mod b/tests/kalman_filter_smoother/algoH3.mod index bc4d77436f..b25dce072d 100644 --- a/tests/kalman_filter_smoother/algoH3.mod +++ b/tests/kalman_filter_smoother/algoH3.mod @@ -37,7 +37,7 @@ end; varobs w x y; -estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,smoothed_state_uncertainty); +estimation(datafile=data_algo,first_obs=1000,nobs=200,mh_replic=0,diffuse_filter,smoothed_state_uncertainty); stoch_simul(irf=0); @@ -56,7 +56,7 @@ if max(max(abs(err))) > 1e-10; error('Test fails'); end; -d=load('data'); +d=load('data_algo'); dat = [d.w d.x d.y]; X = oo_.SmoothedMeasurementErrors; ME = [X.w X.x X.y]; diff --git a/tests/kalman_filter_smoother/gen_data.mod b/tests/kalman_filter_smoother/gen_data.mod index e8afaad769..1c44380a0f 100644 --- a/tests/kalman_filter_smoother/gen_data.mod +++ b/tests/kalman_filter_smoother/gen_data.mod @@ -35,4 +35,4 @@ stoch_simul(periods=2000,irf=0); plot([w x y z]); -save data.mat w x y z dw dx dy; \ No newline at end of file +save data_algo.mat w x y z dw dx dy; diff --git a/tests/kalman_filter_smoother/test_compute_Pinf_Pstar.mod b/tests/kalman_filter_smoother/test_compute_Pinf_Pstar.mod index 3836769c7a..24f2db6151 100644 --- a/tests/kalman_filter_smoother/test_compute_Pinf_Pstar.mod +++ b/tests/kalman_filter_smoother/test_compute_Pinf_Pstar.mod @@ -91,7 +91,7 @@ varobs v1, v2, v3; options_.qz_criterium = 1+1e-6; -calib_smoother(datafile=Data,diffuse_filter); +calib_smoother(datafile=data_Pinf_Pstar,diffuse_filter); mf = bayestopt_.smoother_var_list(bayestopt_.smoother_mf); Q = M_.Sigma_e; diff --git a/tests/kalman_filter_smoother/test_compute_Pinf_Pstar_data.mod b/tests/kalman_filter_smoother/test_compute_Pinf_Pstar_data.mod index 5652b7a280..e3032458d9 100644 --- a/tests/kalman_filter_smoother/test_compute_Pinf_Pstar_data.mod +++ b/tests/kalman_filter_smoother/test_compute_Pinf_Pstar_data.mod @@ -86,4 +86,4 @@ end; stoch_simul(order=1,irf=20,periods=500); -save Data.mat v1 v2 v3; +save data_Pinf_Pstar.mat v1 v2 v3; -- GitLab