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
Mark Song
dynare
Commits
bcd9fe40
Commit
bcd9fe40
authored
Oct 09, 2017
by
Marco Ratto
Committed by
Stéphane Adjemian
Oct 10, 2017
Browse files
bug fix in optimizer 5 [newrat] for dsge_var_likelihood objective function. Fixes
#1494
(cherry picked from commit
da063b2e
)
parent
107a5d6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/dynare_estimation_1.m
View file @
bcd9fe40
...
...
@@ -235,7 +235,7 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
[
junk1
,
junk2
,
junk3
,
junk4
,
hh
]
=
feval
(
objective_function
,
xparam1
,
...
dataset_
,
dataset_info
,
options_
,
M_
,
estim_params_
,
bayestopt_
,
bounds
,
oo_
);
options_
.
analytic_derivation
=
ana_deriv_old
;
elseif
~
isnumeric
(
options_
.
mode_compute
)
||
~
(
isequal
(
options_
.
mode_compute
,
5
)
&&
newratflag
~=
1
)
elseif
~
isnumeric
(
options_
.
mode_compute
)
||
~
(
isequal
(
options_
.
mode_compute
,
5
)
&&
newratflag
~=
1
&&
strcmp
(
func2str
(
objective_function
),
'dsge_likelihood'
))
% with flag==0, we force to use the hessian from outer product gradient of optimizer 5
if
options_
.
hessian
.
use_penalized_objective
penalized_objective_function
=
str2func
(
'penalty_objective_function'
);
...
...
matlab/optimization/newrat.m
View file @
bcd9fe40
...
...
@@ -154,7 +154,7 @@ while norm(gg)>gtol && check==0 && jit<nit
if
length
(
find
(
ig
))
<
nx
ggx
=
ggx
*
0
;
ggx
(
find
(
ig
))
=
gg
(
find
(
ig
));
if
analytic_derivation
if
analytic_derivation
||
~
outer_product_gradient
,
hhx
=
hh
;
else
hhx
=
reshape
(
dum
,
nx
,
nx
);
...
...
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