From ce39da4ab6e265edd3562045e1a00e318ee49f4f Mon Sep 17 00:00:00 2001 From: Andrew McCluskey Date: Thu, 23 Apr 2020 10:20:45 +0100 Subject: [PATCH] more faws --- docs/source/faq.rst | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/source/faq.rst b/docs/source/faq.rst index cd9a2e9..0a6e1e5 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -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 \ No newline at end of file + 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 \ No newline at end of file