Commit 19b7d202 authored by Willi Mutschler's avatar Willi Mutschler Committed by Johannes Pfeifer

testsuite: Add test cases

parent b273a279
Pipeline #4027 passed with stages
in 125 minutes and 21 seconds
......@@ -50,6 +50,8 @@ wsOct
!/ep/mean_preserving_spread.m
!/ep/rbcii_steady_state.m
!/estimation/fsdat_simul.m
!/estimation/method_of_moments/RBC_MoM_steady_helper.m
!/estimation/method_of_moments/RBC_Andreasen_Data_2.mat
!/expectations/expectation_ss_old_steadystate.m
!/external_function/extFunDeriv.m
!/external_function/extFunNoDerivs.m
......
......@@ -25,8 +25,6 @@ MODFILES = \
measurement_errors/fs2000_corr_me_ml_mcmc/fs2000_corr_ME.mod \
TeX/fs2000_corr_ME.mod \
estimation/MH_recover/fs2000_recover_tarb.mod \
estimation/method_of_moments/RBC_MoM.mod \
estimation/method_of_moments/RBC_MoM_SMM_ME.mod \
estimation/fs2000.mod \
gsa/ls2003a.mod \
optimizers/fs2000_8.mod \
......@@ -50,7 +48,9 @@ MODFILES = \
estimation/t_proposal/fs2000_student.mod \
estimation/tune_mh_jscale/fs2000.mod \
estimation/method_of_moments/AnScho_MoM.mod \
estimation/method_of_moments/RBCmodel_MoM.mod \
estimation/method_of_moments/RBC_MoM_Andreasen.mod \
estimation/method_of_moments/RBC_MoM_SMM_ME.mod \
estimation/method_of_moments/RBC_MoM_prefilter.mod \
moments/example1_var_decomp.mod \
moments/example1_bp_test.mod \
moments/test_AR1_spectral_density.mod \
......
......@@ -194,7 +194,7 @@ matched_moments_ = {
% , penalized_estimator % use penalized optimization
, pruning % use pruned state space system at higher-order
% , verbose % display and store intermediate estimation results
, weighting_matrix = OPTIMAL % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
, weighting_matrix = ['optimal'] % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
, additional_optimizer_steps = [4] % vector of numbers for the iterations in the 2-step feasible method of moments
% , prefilter=0 % demean each data series by its empirical mean and use centered moments
%
......
......@@ -16,11 +16,11 @@
% =========================================================================
% Define testscenario
@#define orderApp = 2
@#define orderApp = 1
@#define estimParams = 0
% Note that we will set the numerical optimization tolerance levels very large to speed up the testsuite
@#define optimizer = 13
@#define optimizer = 5
@#include "RBC_MoM_common.inc"
......@@ -33,14 +33,14 @@ varobs n c iv;
@#if estimParams == 0
estimated_params;
DELTA, 0.02;
BETTA, 0.9;
B, 0.4;
DELTA, 0.025;
BETTA, 0.984;
B, 0.5;
%ETAl, 1;
ETAc, 1.5;
ALFA, 0.6;
RHOA, 0.9;
stderr u_a, 0.010;
ETAc, 1;
ALFA, 0.667;
RHOA, 0.979;
stderr u_a, 0.0072;
%THETA, 3.48;
stderr n, 0.01;
......@@ -76,7 +76,7 @@ end;
@#endif
% Simulate data
stoch_simul(order=@{orderApp},pruning,nodisplay,nomoments,periods=750,drop=500);
stoch_simul(order=@{orderApp},pruning,nodisplay,nomoments,periods=250);
save('RBC_MoM_data_@{orderApp}.mat', options_.varobs{:} );
pause(1);
......@@ -128,8 +128,10 @@ matched_moments_ = {
% , penalized_estimator % use penalized optimization
, pruning % use pruned state space system at higher-order
% , verbose % display and store intermediate estimation results
, weighting_matrix = OPTIMAL % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
, additional_optimizer_steps = [4] % vector of additional mode-finders run after mode_compute
, weighting_matrix = ['identity_matrix'] % weighting matrix in moments distance objective function; possible values: OPTIMAL|IDENTITY_MATRIX|DIAGONAL|filename
, weighting_matrix_scaling_factor = 10
, burnin=250
%, additional_optimizer_steps = [4] % vector of additional mode-finders run after mode_compute
% , prefilter=0 % demean each data series by its empirical mean and use centered moments
%
% Options for SMM
......
......@@ -87,7 +87,7 @@ matched_moments_ = {
% [iiv iiv] [0 -1], [1 1];
};
weighting_matrix=diag([1000;ones(6,1)]);
weighting_matrix=diag([1000;ones(8,1)]);
save('test_matrix.mat','weighting_matrix')
@#for mommethod in ["GMM", "SMM"]
......
function N = RBC_MoM_steady_helper(THETA,ETAl,ETAc,BETTA,B,C_O_N,W)
if ETAc == 1 && ETAl == 1
N = (1-BETTA*B)*(C_O_N*(1-B))^-1*W/THETA/(1+(1-BETTA*B)*(C_O_N*(1-B))^-1*W/THETA);
else
% No closed-form solution use a fixed-point algorithm
N0 = 1/3;
N = fsolve(@(N) THETA*(1-N)^(-ETAl)*N^ETAc - (1-BETTA*B)*(C_O_N*(1-B))^(-ETAc)*W, N0,optimset('Display','off','TolX',1e-12,'TolFun',1e-12));
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment