# Can different samples be merged?

**URL:** <https://discourse.pymc.io/t/can-different-samples-be-merged/3184>\
**Category:** Questions\
**Created:** [May 1, 2019, 5:11pm UTC](https://discourse.pymc.io/t/can-different-samples-be-merged/3184 "2019-05-01T17:11:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Hamster\_on\_wheels](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/hamster_on_wheels/32/1823_2.png) [@Hamster\_on\_wheels](https://discourse.pymc.io/u/Hamster_on_wheels)\
**Post date:** [May 1, 2019, 7:48pm UTC](https://discourse.pymc.io/t/can-different-samples-be-merged/3184/2 "2019-05-01T19:48:18Z")

</div>

Maybe this can help?

> [@Larger dataset linear regression GPU memory problems with NUTS for larger N and D (batch training?)](https://discourse.pymc.io/t/larger-dataset-linear-regression-gpu-memory-problems-with-nuts-for-larger-n-and-d-batch-training/386/2):
>
> Data partitioning in MCMC needs some care to do it correctly. Currently out of the box in PyMC3 you can try [SGFS](https://github.com/pymc-devs/pymc3/blob/master/pymc3/step_methods/sgmcmc.py) (it is an experimental sampler so use with caution) [https://github.com/pymc-devs/pymc3/blob/master/docs/source/notebooks/sgfs\_simple\_optimization.ipynb](https://github.com/pymc-devs/pymc3/blob/master/docs/source/notebooks/sgfs_simple_optimization.ipynb) Alternatively, you can partition your data by hand and fit multiple smaller model with NUTS and then combine them post hoc. The official treatment is Expectation propagation (e.g., [https://arxiv.org/pdf/1412.4869.pdf](https://arxiv.org/pdf/1412.4869.pdf)), which you can…

---

_[View the full topic](https://discourse.pymc.io/t/can-different-samples-be-merged/3184)._
