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
e0439669
Commit
e0439669
authored
Sep 30, 2013
by
Sébastien Villemot
Browse files
Merge pull request #486 from JohannesPfeifer/prior_check
Check initial values for violation of inverse gamma prior
parents
1f8b4d9a
ad73d1fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/dynare_estimation_1.m
View file @
e0439669
...
...
@@ -502,7 +502,7 @@ if ~options_.mh_posterior_mode_estimation && options_.cova_compute
params_at_bound
=
find
(
xparam1
==
ub
|
xparam1
==
lb
);
if
~
isempty
(
params_at_bound
)
for
ii
=
1
:
length
(
params_at_bound
)
params_at_bound_name
{
ii
,
1
}
=
get_the_name
(
ii
,
0
,
M_
,
estim_params_
,
options_
);
params_at_bound_name
{
ii
,
1
}
=
get_the_name
(
params_at_bound
(
ii
)
,
0
,
M_
,
estim_params_
,
options_
);
end
disp_string
=
[
params_at_bound_name
{
1
,:}];
for
ii
=
2
:
size
(
params_at_bound_name
,
1
)
...
...
matlab/dynare_estimation_init.m
View file @
e0439669
...
...
@@ -253,6 +253,18 @@ if ~isempty(estim_params_)
end
error
([
'Initial value(s) of '
,
disp_string
,
' are outside parameter bounds. Potentially, you should set prior_trunc=0. If you used the mode_file-option, check whether your mode-file is consistent with the priors.'
])
end
inadmissible_inverse_gamma_values
=
find
(
bayestopt_
.
pshape
==
4
&
xparam1
==
0
);
if
~
isempty
(
inadmissible_inverse_gamma_values
)
for
ii
=
1
:
length
(
inadmissible_inverse_gamma_values
)
inadmissible_inverse_gamma_par_names
{
ii
,
1
}
=
get_the_name
(
inadmissible_inverse_gamma_values
(
ii
),
0
,
M_
,
estim_params_
,
options_
);
end
disp_string
=
[
inadmissible_inverse_gamma_par_names
{
1
,:}];
for
ii
=
2
:
size
(
inadmissible_inverse_gamma_par_names
,
1
)
disp_string
=
[
disp_string
,
', '
,
inadmissible_inverse_gamma_par_names
{
ii
,:}];
end
error
([
'Initial value(s) of '
,
disp_string
,
' is zero. This is not allowed when using an inverse gamma prior.\n'
])
end
lb
=
bounds
(:,
1
);
ub
=
bounds
(:,
2
);
bayestopt_
.
lb
=
lb
;
...
...
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