posterior_predictive_check

posterior_predictive_check(
    data,
    distribution,
    sampler='DEMCz',
    iterations=3000,
    output_length=10000,
    seed=12345,
    number_of_replicates=1000,
    thinning_interval=-1,
)

Posterior predictive check: fit an MCMC, draw replicates, compute common p-values.

Wraps the shared C++ PosteriorPredictiveCheck.

Parameters

Name Type Description Default
data array_like Observations to fit. required
distribution str Distribution family name. required
sampler ('DEMCz', 'DEMCzs', 'ARWMH', 'NUTS') MCMC sampler. "DEMCz"
iterations int Number of post-warmup MCMC iterations. 3000
output_length int Number of posterior samples. 10000
seed int PRNG seed for the sampler. 12345
number_of_replicates int Number of posterior predictive replicates. 1000
thinning_interval int MCMC thinning interval; -1 keeps the sampler’s own default. -1

Returns

Name Type Description
dict number_of_replicates, the five posterior predictive p-values (mean_p_value etc.), and has_misfit (1 when any p-value is extreme, else 0).