bayesplain.core.beta_binomial.posterior¶
-
bayesplain.core.beta_binomial.posterior(successes, n, a=
1.0, b=1.0)[source]¶ Exact Beta posterior for an unknown proportion.
With a
Beta(a, b)prior andsuccessesout ofnobserved, the posterior isBeta(a + successes, b + n - successes). That is the whole computation – conjugacy means the prior and posterior are the same family, so observing data just adds counts to the two shape parameters.- Parameters:¶
- Returns:¶
Frozen Beta posterior, supporting
.mean(),.ppf(),.rvs()and the rest of the scipy distribution interface.- Return type:¶
scipy.stats.rv_continuous_frozen
Notes
Because the posterior is available in closed form, quantities like the mean and the equal-tailed interval should be read off analytically rather than estimated from draws. Draws are only needed for quantities built from more than one posterior, such as a difference between two groups.