Description Usage Arguments Details Value Author(s) References See Also

View source: R/LaplaceMetropolis_gaussian.R

As pointed out by Raftery (1996), the Laplace-Metropolis estimator performs well in calculating log marginal likelihood among other methods considered.

1 2 | ```
LaplaceMetropolis_gaussian(theta, data = NULL, data_y, prior_p, prior_st,
method = c("likelihood","L1center","median"))
``` |

`theta` |
MCMC output |

`data` |
Regressors |

`data_y` |
Response |

`prior_p` |
Hyperparameter of the inverse-gamma prior |

`prior_st` |
Hyperparameter of the inverse-gamma prior |

`method` |
Computing method. |

The idea of the Laplace-Metropolis estimator is to avoid the limitations of the Laplace method by using
posterior simulation to estimate the quantities it needs. The Laplace method for integrals is based on
a Taylor series expansion of the real-valued function *f(u)* of the *d*-dimensional vector
*u*, and yields the approximation *P(D)\approx (2*pi)^(d/2)|A|^(1/2)P(D|θ)P(θ)*,
where *θ* is the posterior mode of *h(θ)=log(P(D|θ)P(θ))*, *A* is minus
the inverse Hessian of *h(θ)* evaluated at *theta*, and *d* is the dimension of *θ*.

The simplest way to estimate *θ* from posterior simulation output, and probably the most accurate,
is to compute *h(θ^(t))* for each *t=1,…,T* and take the value for which it is largest.

Log marginal likelihood

Han Lin Shang

I. Ntzoufras (2009) Bayesian Modeling Using WinBUGS. John Wiley and Sons, Inc. New Jersey.

A. E. Raftery (1996) Hypothesis testing and model selection, in Markov Chain Monte Carlo In Practice by W. R. Gilks, S. Richardson and D. J. Spiegelhalter, Chapman and Hall, London.

`logdensity_gaussian`

, `logpriors_gaussian`

, `loglikelihood_gaussian`

, `mcmcrecord_gaussian`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.