MoM: Testsuite fixes for Octave

time-shift
Willi Mutschler 2021-01-14 10:04:10 +01:00
parent a697002a4e
commit 0a880825a1
No known key found for this signature in database
GPG Key ID: 91E724BF17A73F6D
5 changed files with 30 additions and 3 deletions

View File

@ -256,11 +256,13 @@ dev_Q = AndreasenEtAl.Q@{orderApp} - oo_.mom.Q;
dev_datamoments = str2double(AndreasenEtAl.moments@{orderApp}(:,5)) - oo_.mom.data_moments; dev_datamoments = str2double(AndreasenEtAl.moments@{orderApp}(:,5)) - oo_.mom.data_moments;
dev_modelmoments = str2double(AndreasenEtAl.moments@{orderApp}(:,6)) - oo_.mom.model_moments; dev_modelmoments = str2double(AndreasenEtAl.moments@{orderApp}(:,6)) - oo_.mom.model_moments;
if ~isoctave %there is no table command in Octave
table([AndreasenEtAl.Q@{orderApp} ; str2double(AndreasenEtAl.moments@{orderApp}(:,5)) ; str2double(AndreasenEtAl.moments@{orderApp}(:,6))],... table([AndreasenEtAl.Q@{orderApp} ; str2double(AndreasenEtAl.moments@{orderApp}(:,5)) ; str2double(AndreasenEtAl.moments@{orderApp}(:,6))],...
[oo_.mom.Q ; oo_.mom.data_moments ; oo_.mom.model_moments ],... [oo_.mom.Q ; oo_.mom.data_moments ; oo_.mom.model_moments ],...
[dev_Q ; dev_datamoments ; dev_modelmoments ],... [dev_Q ; dev_datamoments ; dev_modelmoments ],...
'VariableNames', {'Andreasen et al', 'Dynare', 'dev'},... 'VariableNames', {'Andreasen et al', 'Dynare', 'dev'},...
'RowNames', ['Q'; strcat('Data_', M_.matched_moments(:,4)); strcat('Model_', M_.matched_moments(:,4))]) 'RowNames', ['Q'; strcat('Data_', M_.matched_moments(:,4)); strcat('Model_', M_.matched_moments(:,4))])
end
if norm(dev_modelmoments)> 1e-4 if norm(dev_modelmoments)> 1e-4
error('Something wrong in the computation of moments at order @{orderApp}') error('Something wrong in the computation of moments at order @{orderApp}')

View File

@ -257,11 +257,13 @@ dev_Q = AndreasenEtAl.Q@{orderApp} - oo_.mom.Q;
dev_datamoments = str2double(AndreasenEtAl.moments@{orderApp}(:,5)) - oo_.mom.data_moments; dev_datamoments = str2double(AndreasenEtAl.moments@{orderApp}(:,5)) - oo_.mom.data_moments;
dev_modelmoments = str2double(AndreasenEtAl.moments@{orderApp}(:,6)) - oo_.mom.model_moments; dev_modelmoments = str2double(AndreasenEtAl.moments@{orderApp}(:,6)) - oo_.mom.model_moments;
if ~isoctave %there is no table command in Octave
table([AndreasenEtAl.Q@{orderApp} ; str2double(AndreasenEtAl.moments@{orderApp}(:,5)) ; str2double(AndreasenEtAl.moments@{orderApp}(:,6))],... table([AndreasenEtAl.Q@{orderApp} ; str2double(AndreasenEtAl.moments@{orderApp}(:,5)) ; str2double(AndreasenEtAl.moments@{orderApp}(:,6))],...
[oo_.mom.Q ; oo_.mom.data_moments ; oo_.mom.model_moments ],... [oo_.mom.Q ; oo_.mom.data_moments ; oo_.mom.model_moments ],...
[dev_Q ; dev_datamoments ; dev_modelmoments ],... [dev_Q ; dev_datamoments ; dev_modelmoments ],...
'VariableNames', {'Andreasen et al', 'Dynare', 'dev'},... 'VariableNames', {'Andreasen et al', 'Dynare', 'dev'},...
'RowNames', ['Q'; strcat('Data_', M_.matched_moments(:,4)); strcat('Model_', M_.matched_moments(:,4))]) 'RowNames', ['Q'; strcat('Data_', M_.matched_moments(:,4)); strcat('Model_', M_.matched_moments(:,4))])
end
if norm(dev_modelmoments)> 1e-4 if norm(dev_modelmoments)> 1e-4
warning('Something wrong in the computation of moments at order @{orderApp}') warning('Something wrong in the computation of moments at order @{orderApp}')

View File

@ -256,11 +256,13 @@ dev_Q = AndreasenEtAl.Q@{orderApp} - oo_.mom.Q;
dev_datamoments = str2double(AndreasenEtAl.moments@{orderApp}(:,5)) - oo_.mom.data_moments; dev_datamoments = str2double(AndreasenEtAl.moments@{orderApp}(:,5)) - oo_.mom.data_moments;
dev_modelmoments = str2double(AndreasenEtAl.moments@{orderApp}(:,6)) - oo_.mom.model_moments; dev_modelmoments = str2double(AndreasenEtAl.moments@{orderApp}(:,6)) - oo_.mom.model_moments;
if ~isoctave %there is no table command in Octave
table([AndreasenEtAl.Q@{orderApp} ; str2double(AndreasenEtAl.moments@{orderApp}(:,5)) ; str2double(AndreasenEtAl.moments@{orderApp}(:,6))],... table([AndreasenEtAl.Q@{orderApp} ; str2double(AndreasenEtAl.moments@{orderApp}(:,5)) ; str2double(AndreasenEtAl.moments@{orderApp}(:,6))],...
[oo_.mom.Q ; oo_.mom.data_moments ; oo_.mom.model_moments ],... [oo_.mom.Q ; oo_.mom.data_moments ; oo_.mom.model_moments ],...
[dev_Q ; dev_datamoments ; dev_modelmoments ],... [dev_Q ; dev_datamoments ; dev_modelmoments ],...
'VariableNames', {'Andreasen et al', 'Dynare', 'dev'},... 'VariableNames', {'Andreasen et al', 'Dynare', 'dev'},...
'RowNames', ['Q'; strcat('Data_', M_.matched_moments(:,4)); strcat('Model_', M_.matched_moments(:,4))]) 'RowNames', ['Q'; strcat('Data_', M_.matched_moments(:,4)); strcat('Model_', M_.matched_moments(:,4))])
end
if norm(dev_modelmoments)> 1e-4 if norm(dev_modelmoments)> 1e-4
warning('Something wrong in the computation of moments at order @{orderApp}') warning('Something wrong in the computation of moments at order @{orderApp}')

View File

@ -88,8 +88,13 @@ end;
estimated_params_init(use_calibration); estimated_params_init(use_calibration);
end; end;
%1 3 13
@#for optimizer in [1, 3, 13] @#for optimizer in [1, 3, 13]
@#if estimParams == 2 && optimizer == 13
%skip due to buggy behavior in Octave
if ~isoctave
@#endif
method_of_moments( method_of_moments(
mom_method = GMM % method of moments method; possible values: GMM|SMM mom_method = GMM % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_Andreasen_Data_2.mat' % name of filename with data , datafile = 'RBC_Andreasen_Data_2.mat' % name of filename with data
@ -110,6 +115,11 @@ end;
, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between , silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
, analytic_jacobian , analytic_jacobian
); );
@#if estimParams == 2 && optimizer == 13
%skip due to buggy behavior in Octave
end
@#endif
@#endfor @#endfor
@#endfor @#endfor

View File

@ -118,6 +118,12 @@ options_.solveopt.TolXConstraint=1e-3;
end; end;
@#for optimizer in OPTIMIZERS @#for optimizer in OPTIMIZERS
@#if estimParams == 2 && optimizer == 13
%skip due to buggy behavior in Octave
if ~isoctave
@#endif
method_of_moments( method_of_moments(
mom_method = GMM % method of moments method; possible values: GMM|SMM mom_method = GMM % method of moments method; possible values: GMM|SMM
, datafile = 'RBC_Andreasen_Data_2.mat' % name of filename with data , datafile = 'RBC_Andreasen_Data_2.mat' % name of filename with data
@ -139,6 +145,11 @@ options_.solveopt.TolXConstraint=1e-3;
@#endif @#endif
%, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between %, silent_optimizer % run minimization of moments distance silently without displaying results or saving files in between
); );
@#if estimParams == 2 && optimizer == 13
%skip due to buggy behavior in Octave
end
@#endif
@#endfor @#endfor
@#endfor @#endfor