Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
e614227c
Commit
e614227c
authored
Nov 17, 2010
by
Stéphane Adjemian (Charybdis)
Browse files
Added warning message when some of the deep parameters are not initialized.
parent
d60c32e6
Changes
5
Hide whitespace changes
Inline
Side-by-side
matlab/list_of_parameters_calibrated_as_NaN.m
0 → 100644
View file @
e614227c
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
matlab/simul.m
View file @
e614227c
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
matlab/steady.m
View file @
e614227c
...
...
@@ -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'
])
...
...
matlab/stoch_simul.m
View file @
e614227c
...
...
@@ -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
(
' '
)
...
...
matlab/test_for_deep_parameters_calibration.m
0 → 100644
View file @
e614227c
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment