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
Marco Ratto
dynare
Commits
59a1c1c8
Commit
59a1c1c8
authored
Jan 25, 2022
by
Marco Ratto
Browse files
new option maximize_using_mh_bounds for slice
parent
7a834901
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/check_posterior_sampler_options.m
View file @
59a1c1c8
...
...
@@ -304,6 +304,10 @@ if init
case
'maximize'
posterior_sampler_options
.
maximize
=
options_list
{
i
,
2
};
case
'maximize_using_mh_bounds'
posterior_sampler_options
.
maximize_using_mh_bounds
=
options_list
{
i
,
2
};
case
'mode_compute'
posterior_sampler_options
.
mode_compute
=
options_list
{
i
,
2
};
...
...
@@ -431,6 +435,22 @@ if strcmp(posterior_sampler_options.posterior_sampling_method,'slice')
posterior_sampler_options
.
invhess
=
[];
end
end
if
posterior_sampler_options
.
maximize_using_mh_bounds
&&
options_
.
load_mh_file
&&
not
(
options_
.
mh_recover
)
global
M_
bayestopt_
[
~
,
params0
]
=
get_posterior_sample
(
'param'
,
[],
M_
,
bayestopt_
);
% loads posterior params in params0
mh_replic
=
size
(
params0
,
1
)/
options_
.
mh_nblck
;
retain
=
[];
for
k
=
1
:
options_
.
mh_nblck
retain
=
[
retain
;
[
options_
.
mh_drop
*
mh_replic
+
1
+
(
k
-
1
)
*
mh_replic
:
k
*
mh_replic
]
'
];
end
params1
=
params0
(
retain
,:);
opt_bounds
.
lb
=
min
(
params1
)
'
;
opt_bounds
.
ub
=
max
(
params1
)
'
;
opt_bounds
.
lb
=
max
(
min
(
opt_bounds
.
lb
.*
0.99
,
opt_bounds
.
lb
-
1.e-6
),
0.5
*
(
opt_bounds
.
lb
+
posterior_sampler_options
.
bounds
.
lb
));
opt_bounds
.
ub
=
min
(
max
(
opt_bounds
.
ub
.*
1.01
,
opt_bounds
.
ub
+
1.e-6
),
0.5
*
(
opt_bounds
.
ub
+
posterior_sampler_options
.
bounds
.
ub
));
posterior_sampler_options
.
bounds
=
opt_bounds
;
end
% needs to be re-set to zero otherwise posterior analysis is filtered
% out in dynare_estimation_1.m
options_
.
mh_posterior_mode_estimation
=
false
;
...
...
matlab/default_option_values.m
View file @
59a1c1c8
...
...
@@ -465,6 +465,7 @@ options_.posterior_sampler_options.slice.WR=[];
options_
.
posterior_sampler_options
.
slice
.
mode_files
=
[];
options_
.
posterior_sampler_options
.
slice
.
mode
=
[];
options_
.
posterior_sampler_options
.
slice
.
maximize
=
0
;
options_
.
posterior_sampler_options
.
slice
.
maximize_using_mh_bounds
=
0
;
options_
.
posterior_sampler_options
.
slice
.
mode_compute
=
5
;
options_
.
posterior_sampler_options
.
slice
.
initial_step_size
=
0.8
;
options_
.
posterior_sampler_options
.
slice
.
save_tmp_file
=
1
;
...
...
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