Difference between revisions of "Bayes' Theorem"
Jump to navigation
Jump to search
(→Misc) |
|||
| Line 20: | Line 20: | ||
* ArviZ documentation on working with [https://python.arviz.org/en/0.14.0/getting_started/WorkingWithInferenceData.html inference data] | * ArviZ documentation on working with [https://python.arviz.org/en/0.14.0/getting_started/WorkingWithInferenceData.html inference data] | ||
* [https://github.com/pymc-devs/pymc-resources/tree/main/BDA3 Bayesian Data Analysis with Python and PyMC] by Gelman et al. (Code ported to Python) | * [https://github.com/pymc-devs/pymc-resources/tree/main/BDA3 Bayesian Data Analysis with Python and PyMC] by Gelman et al. (Code ported to Python) | ||
| + | * *Bayesian Modeling and Computation in Python* by Martin, Kumar & Lao [https://bayesiancomputationbook.com/markdown/chp_01.html ported to Python] | ||
===Misc=== | ===Misc=== | ||
Revision as of 18:48, 29 December 2022
In case you forgot:
- [math]\displaystyle{ P(A|B) = \dfrac{P(B|A)\,P(A)}{P(B)} }[/math]
where,
- [math]\displaystyle{ P(A|B) }[/math] is the conditional probability that A is true given B
- [math]\displaystyle{ P(A), P(B) }[/math] are the marginal probabilities that A or B is true
It's true by the definition of conditional probability:
- [math]\displaystyle{ P(A|B) = \dfrac{P(A\cap B)}{P(B)} }[/math] where [math]\displaystyle{ P(A\cap B) }[/math] is the joint probability that both A and B are true
- [math]\displaystyle{ P(A\cap B) = P(A|B)\,P(B) = P(B|A)\,P(A) }[/math]
In other terminology (VanderPlas):
- [math]\displaystyle{ P(A|B) }[/math] is the posterior, the probability of the model parameters given the data
- [math]\displaystyle{ P(B|A) }[/math] is the likelihood
- [math]\displaystyle{ P(A) }[/math] is the model prior, which encodes knowledge about the model before considering the data [math]\displaystyle{ B }[/math]
- [math]\displaystyle{ P(B) }[/math] is the model evidence (which in practice is a normalization term).
Resources
- The coin factory problem
- Jake VanderPlas's 5 part series on github
- Bayesian Methods for Hackers ported to PyMC3 and Python 3
- ArviZ documentation on working with inference data
- Bayesian Data Analysis with Python and PyMC by Gelman et al. (Code ported to Python)
- *Bayesian Modeling and Computation in Python* by Martin, Kumar & Lao ported to Python
Misc
- Python virtual environment primer
- NBShare notebook on PyTorch (MNIST example)
- Highlight data points and text in Python charts
- RevBayes (a package for phylogenetic analysis, with some good MCMC tutorial pages