meridian.analysis.review.checks.BayesianPPPCheck

Checks the Bayesian posterior predictive p-value of the total outcome.

Inherits From: BaseCheck

The test statistic is the outcome summed over the selected geos and times. For each posterior draw, the model's predictive distribution of this total is normal, with mean equal to the expected total outcome and variance equal to the summed residual variance of the selected geo and time cells. The check computes the two-sided posterior predictive p-value in closed form: the average, over posterior draws, of the probability that a predictive total lands at least as far from the posterior predictive mean as the observed total. The check fails if the p-value is below ppp_threshold.

Methods

is_relevant

View source

Checks if the check is relevant for the given model context.

run

View source

Executes the check.

The return type uses the generic ResultType, making it specific for each subclass.