Repository navigation
New analyses
rate()andcompare_rates()for events per unit of exposure: exact Gamma–Poisson posteriors, an exact beta-prime posterior for the rate ratio, and the exact Poisson and exact conditional tests as frequentist twins. Per-period counts are checked for overdispersion.categories()for goodness of fit of one categorical variable: a Dirichlet posterior over its shares with Cohen's w as the headline, a closed-form Bayes factor against fixed shares, and the chi-square goodness-of-fit test as its twin.regression()for a line with one predictor: exact Student-t posteriors for the slope, the average outcome at any x, and a new observation under the reference prior, with the Zellner–Siow Bayes factor. A second predictor raises an error that points to Bambi.compare_proportions()takes three or more groups: the spread between the highest and lowest rate,.pairwise()comparisons with Gunel–Dickey Bayes factors, andpool=Truefor empirical-Bayes partial pooling.- Paired and log-scale means.
compare_means(paired=True)analyzes within-pair differences beside the paired t-test;mean(log=True)andcompare_means(log=True)report geometric means and ratios for skewed positive data, andmean(log=True)takesreference=on the original scale. Result.predict()returns aPrediction, the posterior predictive forproportion(),rate(),mean(), andregression().teach.precision_planning_mean()finds the sample size for a target interval width on one mean or a difference of two.mean(),compare_means(),correlation(),regression(), andcompare_groups()accept column names withdata=, and say how many missing values they dropped.
Fixes
- With
estimand="risk_ratio"or"odds_ratio",compare_proportions()printed the Wald interval on the difference as the ratio's confidence interval. It now reports the Katz (risk ratio) or Woolf (odds ratio) interval on the ratio itself. - The summary labeled the posterior median "most likely value," which names the mode. It now reads "best estimate (median)."
Numbers that move
Exact posteriors now get an analytic HDI instead of one estimated from draws, so the default intervals of proportion() and mean() move in the third or fourth decimal. Equal-tailed intervals (interval(kind="eti")), posterior probabilities, and Bayes factors are unchanged, as are the intervals of the other analyses.
Compatibility
Nothing is removed or renamed. The keys of Result.to_dict() are unchanged for every analysis in 0.1.0, so autograder tests keep working. mean(reference=) now defaults to None, which still means 0 on the raw scale.
Testing
CI covers Python 3.10 through 3.14 and a job with only numpy, scipy, and pytest installed, lints with ruff, and runs every docstring example as a test. The unused hypothesis test dependency is gone.
Full changelog: v0.1.0...v0.2.0