Skip to content

Commit

Permalink
more faws
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew McCluskey committed Apr 23, 2020
1 parent f15f394 commit ce39da4
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,28 @@ FAQ
from uravu.distribution import Distribution
sample = np.random.randn(100)
my_distribution = Distribution(sample, name='Random Distribution', units=UREG.meter)
my_distribution = Distribution(sample, name='Random Distribution', units=UREG.meter)
- How do I use the :func:`uravu.utils.bayes_factor()` function to compare different models?

.. _avoid creating multiple unit registries: https://pint.readthedocs.io/en/0.11/tutorial.html#using-pint-in-your-projects
The :func:`uravu.utils.bayes_factor()` function uses the the second Table on page 777 of `Kass and Raftery's`_ paper on Bayesian model comparison.
The function will return a value for :math:`2\ln(B_{10})`, where the model 1 is the first argument in the function and model 0 is the second.
The table mentioned above is reproduced below.

+-----------------------+-----------------+--------------------------+
| :math:`2\ln(B_{10})` | :math:`B_{10}` | Interpretation |
+-----------------------+-----------------+--------------------------+
| 0 to 2 | 1 to 3 | Not worth a bare mention |
+-----------------------+-----------------+--------------------------+
| 2 to 6 | 3 to 20 | Positive |
+-----------------------+-----------------+--------------------------+
| 6 to 10 | 20 to 150 | Strong |
+-----------------------+-----------------+--------------------------+
| > 10 | > 150 | Very Strong |
+-----------------------+-----------------+--------------------------+

So if :py:class:`uravu.utils.bayes_factor(model1, model2)` returns :py:attr:`4.3`, there is "Positive" evidence for :py:attr:`model1` over :py:attr:`model2`.


.. _avoid creating multiple unit registries: https://pint.readthedocs.io/en/0.11/tutorial.html#using-pint-in-your-projects
.. _Kass and Raftery's: https://www.colorado.edu/amath/sites/default/files/attached-files/kassraftery95.pdf

0 comments on commit ce39da4

Please sign in to comment.