# Bayes Factor in Pystan

**URL:** <https://discourse.mc-stan.org/t/bayes-factor-in-pystan/21276>\
**Category:** PyStan\
**Tags:** bayes-factor\
**Created:** [March 13, 2021, 1:20pm UTC](https://discourse.mc-stan.org/t/bayes-factor-in-pystan/21276 "2021-03-13T13:20:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xenia](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/xenia/32/10031_2.png) [@xenia](https://discourse.mc-stan.org/u/xenia)\
**Post date:** [March 13, 2021, 1:20pm UTC](https://discourse.mc-stan.org/t/bayes-factor-in-pystan/21276/1 "2021-03-13T13:20:44Z")

</div>

Are there any packages or python-conversions from r packages that one can use to find the Bayes Factor of a model in pystan. I know there are a few in R but can’t find anything definitive in python?

---

<div class="post-metadata">

**Author:** ![martinmodrak](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/martinmodrak/32/133_2.png) [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Post date:** [March 18, 2021, 10:04am UTC](https://discourse.mc-stan.org/t/bayes-factor-in-pystan/21276/2 "2021-03-18T10:04:42Z")

</div>

I guess @ariddell might know…

I however admit I am personally mostly skeptical that Bayes factors are a practical tool for most scientific questions (see [Hypothesis testing, model selection, model comparison - some thoughts](https://discourse.mc-stan.org/t/hypothesis-testing-model-selection-model-comparison-some-thoughts/19163)), so you may consider some alternative methods (as outlined in the link)  
to test/select hypothesis/models that could be more aligned with your goals and easier to implement robustly.

Best of luck with your model!

---

<div class="post-metadata">

**Author:** ![xenia](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/xenia/32/10031_2.png) [@xenia](https://discourse.mc-stan.org/u/xenia)\
**Post date:** [March 18, 2021, 10:16am UTC](https://discourse.mc-stan.org/t/bayes-factor-in-pystan/21276/3 "2021-03-18T10:16:31Z")

</div>

Thank you for the response, I will have a read of that!
