# How dose bayesian bootstrap weight in az.compare() work?

**URL:** <https://discourse.mc-stan.org/t/how-dose-bayesian-bootstrap-weight-in-az-compare-work/31984>\
**Category:** General\
**Tags:** loo, arviz\
**Created:** [July 6, 2023, 6:47am UTC](https://discourse.mc-stan.org/t/how-dose-bayesian-bootstrap-weight-in-az-compare-work/31984 "2023-07-06T06:47:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qi-peng](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/qi-peng/32/18158_2.png) [@qi-peng](https://discourse.mc-stan.org/u/qi-peng)\
**Post date:** [July 6, 2023, 6:47am UTC](https://discourse.mc-stan.org/t/how-dose-bayesian-bootstrap-weight-in-az-compare-work/31984/1 "2023-07-06T06:47:36Z")

</div>

Hi, I’m new to pystan. I am confused about how arviz calculates weight through bayesian bootstrap. Is there any reference to help me understand how its works?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Bob\_Carpenter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/bob_carpenter/32/9230_2.png) [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Post date:** [July 27, 2023, 8:39pm UTC](https://discourse.mc-stan.org/t/how-dose-bayesian-bootstrap-weight-in-az-compare-work/31984/2 "2023-07-27T20:39:11Z")

</div>

I’m not sure what you mean by “Bayesian bootstrap” as we’re not trying to compute confidence intervals.

What’s going on with ArviZ compare ( [arviz.compare — ArviZ 0.16.1 documentation](https://python.arviz.org/en/stable/api/generated/arviz.compare.html) ) is an expected log predictive density (ELPD) comparison. There’s a citation to a Spiegelhalter et al. paper in the doc but you can also read this, which goes over the computation and the Pareto smoothed importance sampling estimator of it we use in the loo package in R ( [CRAN - Package loo](https://cran.r-project.org/web/packages/loo/index.html) ), with citations here: [Efficient Leave-One-Out Cross-Validation and WAIC for Bayesian Models • loo](https://mc-stan.org/loo/).

---

<div class="post-metadata">

**Author:** ![avehtari](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/avehtari/32/5935_2.png) [@avehtari](https://discourse.mc-stan.org/u/avehtari)\
**Post date:** [July 28, 2023, 12:51pm UTC](https://discourse.mc-stan.org/t/how-dose-bayesian-bootstrap-weight-in-az-compare-work/31984/3 "2023-07-28T12:51:01Z")

</div>

I guess this might refer to Pseudo-BMA+ weights in [Using Stacking to Average Bayesian Predictive Distributions (with Discussion)](https://projecteuclid.org/euclid.ba/1516093227)
