# \#marginal-likelihood

**URL:** https://discourse.mc-stan.org/tag/marginal-likelihood/131.md

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

---

## [How can I compute marginal likelihood in stan to get marginal WAIC?](https://discourse.mc-stan.org/t/how-can-i-compute-marginal-likelihood-in-stan-to-get-marginal-waic/32002)

<div class="topic-metadata">

**Author:** [@YueLiu](https://discourse.mc-stan.org/u/YueLiu)\
**Replies:** 2\
**Last updated:** [July 28, 2023, 1:02pm UTC](https://discourse.mc-stan.org/t/how-can-i-compute-marginal-likelihood-in-stan-to-get-marginal-waic/32002 "2023-07-28T13:02:06Z")

</div>

Hi! I’m fitting models using brms package. I know that WAIC and LOO can be computed by it. Are these fit indices based on conditional likelihood or marginal likelihood? How can I compute marginal likelihood in stan? And…

---

## [Marginal predictions and cross-validation with latent variable model](https://discourse.mc-stan.org/t/marginal-predictions-and-cross-validation-with-latent-variable-model/25027)

<div class="topic-metadata">

**Author:** [@prototaxites](https://discourse.mc-stan.org/u/prototaxites)\
**Replies:** 17\
**Last updated:** [April 27, 2022, 9:52am UTC](https://discourse.mc-stan.org/t/marginal-predictions-and-cross-validation-with-latent-variable-model/25027 "2022-04-27T09:52:06Z")

</div>

Hi all, I am working on a generalised linear latent variable model to predict the joint abundance of different species at different sites. The model uses a factor analytic approach to allow the predicted abundances of e…

---

## [Bayes factor using brms](https://discourse.mc-stan.org/t/bayes-factor-using-brms/4469)

<div class="topic-metadata">

**Author:** [@vasishth](https://discourse.mc-stan.org/u/vasishth)\
**Replies:** 23\
**Last updated:** [November 14, 2021, 10:53am UTC](https://discourse.mc-stan.org/t/bayes-factor-using-brms/4469 "2021-11-14T10:53:23Z")

</div>

Hi all, Attached are some data that I am trying to do a Bayes factor analysis on using brms. Reproducible code is below. I set pretty reasonable priors for the fixed effects factors. I am testing the null hypothesis th…

---

## [Marginalization for non-experts](https://discourse.mc-stan.org/t/marginalization-for-non-experts/14687)

<div class="topic-metadata">

**Author:** [@mbjoseph](https://discourse.mc-stan.org/u/mbjoseph)\
**Replies:** 0\
**Last updated:** [April 29, 2020, 6:33am UTC](https://discourse.mc-stan.org/t/marginalization-for-non-experts/14687 "2020-04-29T06:33:33Z")

</div>

Hey all, @martinmodrak suggested I post a link to this blog post on marginalizing over discrete parameters in Stan: https://mbjoseph.github.io/posts/2020-04-28-a-step-by-step-guide-to-marginalizing-over-discrete-paramet…

---

## [Cross-validation vs. marginal likelihoods](https://discourse.mc-stan.org/t/cross-validation-vs-marginal-likelihoods/10956)

<div class="topic-metadata">

**Author:** [@bgoodri](https://discourse.mc-stan.org/u/bgoodri)\
**Replies:** 1\
**Last updated:** [September 12, 2019, 8:51pm UTC](https://discourse.mc-stan.org/t/cross-validation-vs-marginal-likelihoods/10956 "2019-09-12T20:51:59Z")

</div>

This is one of the most divisive issues among Bayesians, but this new paper claims to show that “the marginal likelihood is formally equivalent to exhaustive leave-p-out cross-validation averaged over all values of p …

---

## [Marginal likelihood / model comparison in pystan](https://discourse.mc-stan.org/t/marginal-likelihood-model-comparison-in-pystan/6824)

<div class="topic-metadata">

**Author:** [@Laurent](https://discourse.mc-stan.org/u/Laurent)\
**Replies:** 1\
**Last updated:** [December 2, 2018, 10:16pm UTC](https://discourse.mc-stan.org/t/marginal-likelihood-model-comparison-in-pystan/6824 "2018-12-02T22:16:35Z")

</div>

hi, The marginal likelihood can be obtained using the R implementation of bridge sampling; how can I compute the marginal likelihood (or at least compare models with each other by computing the Bayes ratios) in pystan? …

---

## [Calculating Bayes Factor using Stan](https://discourse.mc-stan.org/t/calculating-bayes-factor-using-stan/4012)

<div class="topic-metadata">

**Author:** [@geraltofrivia](https://discourse.mc-stan.org/u/geraltofrivia)\
**Replies:** 8\
**Last updated:** [April 29, 2018, 7:31pm UTC](https://discourse.mc-stan.org/t/calculating-bayes-factor-using-stan/4012 "2018-04-29T19:31:43Z")

</div>

Hello Stan Community! As we are all aware that, Stan gives an estimate of the log marginal likelihood (lp\_\_) in the output along with the estimates of the other parameters. My question is, can I use this estimate of lp…

---

## [Bridgesampling with rstanarm?](https://discourse.mc-stan.org/t/bridgesampling-with-rstanarm/2532)

<div class="topic-metadata">

**Author:** [@Robert\_Feldt](https://discourse.mc-stan.org/u/Robert_Feldt)\
**Replies:** 12\
**Last updated:** [March 29, 2018, 3:40am UTC](https://discourse.mc-stan.org/t/bridgesampling-with-rstanarm/2532 "2018-03-29T03:40:40Z")

</div>

Given the recent blog post about the bridgesampling R package I wanted to try it on some rstanarm stanreg objects. However, at least for a poisson glm fit, not all information that bridgesampling needs is retained, i.e.: …

---

## [Marginal likelihood requires multivariate integration to determine normalization constant Z](https://discourse.mc-stan.org/t/marginal-likelihood-requires-multivariate-integration-to-determine-normalization-constant-z/3520)

<div class="topic-metadata">

**Author:** [@bhomass](https://discourse.mc-stan.org/u/bhomass)\
**Replies:** 2\
**Last updated:** [March 13, 2018, 9:22pm UTC](https://discourse.mc-stan.org/t/marginal-likelihood-requires-multivariate-integration-to-determine-normalization-constant-z/3520 "2018-03-13T21:22:03Z")

</div>

In Andrew Gelman’s paper, he states “Estimating the marginal likelihood is more challenging, because determining the normalization constants Z\\k requires multivariate integrations” I have a couple of question. If you a…

---

## [Is stan useful for MML? What is the state of GMO?](https://discourse.mc-stan.org/t/is-stan-useful-for-mml-what-is-the-state-of-gmo/3053)

<div class="topic-metadata">

**Author:** [@jan-glx](https://discourse.mc-stan.org/u/jan-glx)\
**Replies:** 6\
**Last updated:** [February 6, 2018, 2:30am UTC](https://discourse.mc-stan.org/t/is-stan-useful-for-mml-what-is-the-state-of-gmo/3053 "2018-02-06T02:30:10Z")

</div>

Is stan useful for empirical Bayes/maximum marginal likelihood? It seems that the gmo package package should provide this functionality. Is it still being developed and will the corresponding write-up be published anyti…
