bayesplain.priors.from_previous_period¶
- bayesplain.priors.from_previous_period(events, exposure)[source]¶
Build a rate prior from an earlier period’s count.
Treats the earlier period as data observed under the Jeffreys prior, giving
Gamma(0.5 + events, exposure). As withfrom_previous_study(), the strength of the assumption is legible: a prior period of three years is worth three years, no more. Discount it yourself – by passing a fraction of the exposure and events – if you think the rate has drifted since.Examples
>>> from_previous_period(events=30, exposure=5.0).prior_mean 6.1