# Is model averaging using pp\_average.brmsfit a good way out of fitting very large datasets?

**URL:** <https://discourse.mc-stan.org/t/is-model-averaging-using-pp-average-brmsfit-a-good-way-out-of-fitting-very-large-datasets/27227>\
**Category:** brms\
**Created:** [April 22, 2022, 9:57am UTC](https://discourse.mc-stan.org/t/is-model-averaging-using-pp-average-brmsfit-a-good-way-out-of-fitting-very-large-datasets/27227 "2022-04-22T09:57:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![George\_GL](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/george_gl/32/7750_2.png) [@George\_GL](https://discourse.mc-stan.org/u/George_GL)\
**Post date:** [April 22, 2022, 9:57am UTC](https://discourse.mc-stan.org/t/is-model-averaging-using-pp-average-brmsfit-a-good-way-out-of-fitting-very-large-datasets/27227/1 "2022-04-22T09:57:46Z")

</div>

Hi everyone,

i just have a quick technical question.

My task is to run in _brms_ a mixed effects, random intercept, random slope model on a very large data set, 400k observations that would take me days to run on a good EC2 instance.

My strategy would involve drawing random sub-samples from the complete dataset, run the models independently and then average the posteriors using the _pp\_average.brmsfit_ function.

Question: is this a legitmate use of the pp\_average function, and is my approach valid, from a theoretical standpoint?

Thanks!  
G.

---

<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:** [April 24, 2022, 2:48pm UTC](https://discourse.mc-stan.org/t/is-model-averaging-using-pp-average-brmsfit-a-good-way-out-of-fitting-very-large-datasets/27227/2 "2022-04-24T14:48:26Z")

</div>

> [@George\_GL](#):
>
> Question: is this a legitmate use of the pp\_average function, and is my approach valid, from a theoretical standpoint?

No and no. Depending on the shape of the posterior you could use consensus Monte Carlo or something more elaborate as in [Expectation Propagation as a Way of Life: A Framework for Bayesian Inference on Partitioned Data](https://jmlr.org/papers/v21/18-817.html) (this paper has also overview of the problem you are interested in)

---

<div class="post-metadata">

**Author:** ![George\_GL](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/george_gl/32/7750_2.png) [@George\_GL](https://discourse.mc-stan.org/u/George_GL)\
**Post date:** [April 24, 2022, 3:56pm UTC](https://discourse.mc-stan.org/t/is-model-averaging-using-pp-average-brmsfit-a-good-way-out-of-fitting-very-large-datasets/27227/3 "2022-04-24T15:56:45Z")

</div>

Many thanks for the answer and I’ll definitely read the reference.  
Thank you,  
G.

P.S. Good to know, I’m not alone in coming with this up… Sounded very appealing.
