# The log marginal data density in mode\_computer=6

**URL:** <https://forum.dynare.org/t/the-log-marginal-data-density-in-mode-computer-6/4898>\
**Category:** ML/Bayesian estimation\
**Created:** [11 August 2015 08:30 UTC](https://forum.dynare.org/t/the-log-marginal-data-density-in-mode-computer-6/4898 "2015-08-11T08:30:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfking](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/ce7236/32.png) [@sfking](https://forum.dynare.org/u/sfking)\
**Post date:** [11 August 2015 08:30 UTC](https://forum.dynare.org/t/the-log-marginal-data-density-in-mode-computer-6/4898/1 "2015-08-11T08:30:29Z")

</div>

Dear all:

I am now estimating an model using mode\_compute=6, and the results in oo\_.Marginal Density is  
LaplaceApproximation= 588  
ModifiedHarmonicMean=592

the question is which one is the log marginal data density, and could I choose the mode with higher results if I estimate alternative mode specification with the results

```
			LaplaceApproximation= 588 
			ModifiedHarmonicMean=592

```

Thanks

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [11 August 2015 09:13 UTC](https://forum.dynare.org/t/the-log-marginal-data-density-in-mode-computer-6/4898/2 "2015-08-11T09:13:25Z")

</div>

Both the Laplace approximation and the modified harmonic mean estimator are ways to compute the marginal data density. As computing the marginal data density involves solving a complicated integral, these two methods for tackling the issue have been proposed. In theory, they should yield identical results as they measure the same thing. In practice, both involve approximations and may yield differing results. It is hard to tell which one to prefer. Footnote 11 of Smets/Wouters (2007) states:

> [@](#):
>
> As discussed in John Geweke (1998), the Metropolis-Hastings-based sample of the posterior distribution can be used to evaluate the marginal likelihood of the model. Following Geweke (1998), we calculate the modified harmonic mean to evaluate the integral over the posterior sample. An alternative approximation is the Laplace approximation around the posterior mode, which is based on a normal distribution. In our experience, the results of both approximations are very close in the case of our estimated DSGE model. This is not too surprising, given the generally close correspondence between the histograms of the posterior sample and the normal distribution around the estimated mode for the individual parameters. Given the large advantage of the Laplace approximation in terms of computational costs, we will use this approximation for comparing alternative model specifications in the next section.
