Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Selma Malmberg
dynare
Commits
ea103ecb
Commit
ea103ecb
authored
14 years ago
by
Stéphane Adjemian
Committed by
Stéphane Adjemian (Scylla)
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Do not compute marginal density (Laplace approximation) if options_.cova_compute==1.
parent
26a4a011
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/dynare_estimation_1.m
+23
-17
23 additions, 17 deletions
matlab/dynare_estimation_1.m
with
23 additions
and
17 deletions
matlab/dynare_estimation_1.m
+
23
−
17
View file @
ea103ecb
...
@@ -569,6 +569,7 @@ if any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
...
@@ -569,6 +569,7 @@ if any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
end
end
end
end
%% Laplace approximation to the marginal log density:
%% Laplace approximation to the marginal log density:
if
options_
.
cova_compute
estim_params_nbr
=
size
(
xparam1
,
1
);
estim_params_nbr
=
size
(
xparam1
,
1
);
scale_factor
=
-
sum
(
log10
(
diag
(
invhess
)));
scale_factor
=
-
sum
(
log10
(
diag
(
invhess
)));
log_det_invhess
=
-
estim_params_nbr
*
log
(
scale_factor
)
+
log
(
det
(
scale_factor
*
invhess
));
log_det_invhess
=
-
estim_params_nbr
*
log
(
scale_factor
)
+
log
(
det
(
scale_factor
*
invhess
));
...
@@ -583,6 +584,7 @@ if any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
...
@@ -583,6 +584,7 @@ if any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
disp
(
' '
)
disp
(
' '
)
disp
(
sprintf
(
'Log data density [Laplace approximation] is %f.'
,
md_Laplace
))
disp
(
sprintf
(
'Log data density [Laplace approximation] is %f.'
,
md_Laplace
))
disp
(
' '
)
disp
(
' '
)
end
elseif
~
any
(
bayestopt_
.
pshape
>
0
)
&&
options_
.
mh_posterior_mode_estimation
elseif
~
any
(
bayestopt_
.
pshape
>
0
)
&&
options_
.
mh_posterior_mode_estimation
disp
(
' '
)
disp
(
' '
)
disp
(
'RESULTS FROM MAXIMUM LIKELIHOOD'
)
disp
(
'RESULTS FROM MAXIMUM LIKELIHOOD'
)
...
@@ -868,12 +870,16 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
...
@@ -868,12 +870,16 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ...
if
options_
.
load_mh_file
&&
options_
.
use_mh_covariance_matrix
if
options_
.
load_mh_file
&&
options_
.
use_mh_covariance_matrix
invhess
=
compute_mh_covariance_matrix
;
invhess
=
compute_mh_covariance_matrix
;
end
end
if
options_
.
cova_compute
if
options_
.
dsge_var
if
options_
.
dsge_var
feval
(
options_
.
posterior_sampling_method
,
'DsgeVarLikelihood'
,
options_
.
proposal_distribution
,
xparam1
,
invhess
,
bounds
,
gend
);
feval
(
options_
.
posterior_sampling_method
,
'DsgeVarLikelihood'
,
options_
.
proposal_distribution
,
xparam1
,
invhess
,
bounds
,
gend
);
else
else
feval
(
options_
.
posterior_sampling_method
,
'DsgeLikelihood'
,
options_
.
proposal_distribution
,
xparam1
,
invhess
,
bounds
,
gend
,
data
,
...
feval
(
options_
.
posterior_sampling_method
,
'DsgeLikelihood'
,
options_
.
proposal_distribution
,
xparam1
,
invhess
,
bounds
,
gend
,
data
,
...
data_index
,
number_of_observations
,
no_more_missing_observations
);
data_index
,
number_of_observations
,
no_more_missing_observations
);
end
end
else
error
(
'I Cannot start the MCMC because the hessian of the posterior kernel at the mode was not computed.'
)
end
end
end
if
options_
.
mh_posterior_mode_estimation
if
options_
.
mh_posterior_mode_estimation
CutSample
(
M_
,
options_
,
estim_params_
);
CutSample
(
M_
,
options_
,
estim_params_
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment