2014-05-07 10:49:50 +02:00
function info= test_for_deep_parameters_calibration ( M_)
2010-11-17 17:09:39 +01:00
% Issues a warning is some of the parameters are NaNs.
%
% INPUTS
% M_ [structure] Description of the (simulated or estimated) model.
2017-05-16 15:10:20 +02:00
%
2010-11-17 17:09:39 +01:00
% OUTPUTS
2017-05-16 15:10:20 +02:00
% info [scalar] 0 if no problems detected, 1 otherwise
%
2010-11-17 17:09:39 +01:00
% ALGORITHM
% none
2017-05-16 15:10:20 +02:00
%
2010-11-17 17:09:39 +01:00
% SPECIAL REQUIREMENTS
% none
2017-10-10 10:05:59 +02:00
% Copyright (C) 2010-2018 Dynare Team
2010-11-17 17:09:39 +01:00
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
2017-05-16 15:10:20 +02:00
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
2010-11-17 17:09:39 +01:00
plist = list_of_parameters_calibrated_as_NaN ( M_ ) ;
if ~ isempty ( plist )
2014-05-07 10:49:50 +02:00
info = 1 ;
2010-11-17 17:09:39 +01:00
message = [ ' Some of the parameters have no value (' ] ;
2018-01-10 10:35:17 +01:00
for i = 1 : length ( plist )
if i < length ( plist )
2017-10-10 10:05:59 +02:00
message = [ message , plist { i } ' , ' ] ;
2010-11-17 17:09:39 +01:00
else
2017-10-10 10:05:59 +02:00
message = [ message , plist { i } ' )' ] ;
2010-11-17 17:09:39 +01:00
end
end
tmp = dbstack ;
2010-12-08 11:32:45 +01:00
message = [ message , ' when using ' tmp ( 2 ) . name ' . ' ] ;
2020-12-18 13:59:29 +01:00
message = [ message , ' If these parameters are not initialized in a steadystate file or a steady_state_model-block, Dynare may not be able to solve the model. Note that simul, perfect_foresight_setup, and perfect_foresight_solver do not automatically call the steady state file.' ] ;
2010-11-17 17:09:39 +01:00
message_id = ' Dynare:ParameterCalibration:NaNValues' ;
2015-09-03 18:31:02 +02:00
warning ( ' off' , ' backtrace' )
2010-11-17 17:09:39 +01:00
warning ( message_id , message ) ;
2014-02-10 18:21:56 +01:00
if strmatch ( ' optimal_policy_discount_factor' , plist , ' exact' )
warning ( ' Either you have not correctly initialized planner_discount or you are calling a command like steady or stoch_simul that is not allowed in the context of ramsey_policy' )
end
2015-09-03 18:31:02 +02:00
warning ( ' on' , ' backtrace' )
2014-05-07 10:49:50 +02:00
else
info = 0 ;
2010-11-17 17:09:39 +01:00
end