Commit e614227c authored by Stéphane Adjemian (Charybdis)'s avatar Stéphane Adjemian (Charybdis)
Browse files

Added warning message when some of the deep parameters are not initialized.

parent d60c32e6
function list = list_of_parameters_calibrated_as_NaN(M_)
% The name of the function is explicit enough...
%
% INPUTS
% M_ [structure] Description of the (simulated or estimated) model.
%
% OUTPUTS
% list [char] n*p array of characters, each line is the name of parameter without value.
%
% ALGORITHM
% none
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2010 Dynare Team
%
% 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
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
idx = find(isnan(M_.params));
nnn = length(idx);
list = [];
if nnn
list = M_.param_names(idx,:);
end
\ No newline at end of file
function simul
% function simul
% Computes deterministic simulations
%
% INPUTS
% None
%
% OUTPUTS
% ...
% none
%
% ALGORITHM
% ...
%
% SPECIAL REQUIREMENTS
% none
......@@ -31,6 +31,8 @@ function simul
global M_ options_ oo_
test_for_deep_parameters_calibration(M_);
if options_.stack_solve_algo < 0 || options_.stack_solve_algo > 5
error('SIMUL: stack_solve_algo must be between 0 and 5')
end
......@@ -95,4 +97,4 @@ else
end;
end;
dyn2vec;
dyn2vec;
\ No newline at end of file
......@@ -30,6 +30,8 @@ function steady()
global M_ oo_ options_ ys0_
test_for_deep_parameters_calibration(M_);
options_ = set_default_option(options_,'jacobian_flag',1);
options_ = set_default_option(options_,'steadystate_flag',0);
if exist([M_.fname '_steadystate.m'])
......
......@@ -19,6 +19,8 @@ function info=stoch_simul(var_list)
global M_ options_ oo_ it_
test_for_deep_parameters_calibration(M_);
options_old = options_;
if options_.linear
options_.order = 1;
......@@ -64,7 +66,7 @@ if info(1)
options_ = options_old;
print_info(info, options_.noprint);
return
end
end
if ~options_.noprint
disp(' ')
......
function test_for_deep_parameters_calibration(M_)
% Issues a warning is some of the parameters are NaNs.
%
% INPUTS
% M_ [structure] Description of the (simulated or estimated) model.
%
% OUTPUTS
% none
%
% ALGORITHM
% none
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2010 Dynare Team
%
% 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
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
plist = list_of_parameters_calibrated_as_NaN(M_);
if ~isempty(plist)
message = ['Some of the parameters have no value (' ];
for i=1:size(plist,1)
if i<size(plist,1)
message = [message, deblank(plist(i,:)) ', '];
else
message = [message, deblank(plist(i,:)) ')'];
end
end
tmp = dbstack;
message = [message, ' when using ' tmp(2).name '.\n'];
message = [message, 'If these parameters are not initialized in a steadystate file, Dynare may not be able to solve the model...\n\n'];
message_id = 'Dynare:ParameterCalibration:NaNValues';
warning(message_id,message);
end
\ No newline at end of file
Supports Markdown
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