bayesplain.core.beta_binomial.log_bayes_factor_point_null

bayesplain.core.beta_binomial.log_bayes_factor_point_null(successes, n, p0=0.5, a=1.0, b=1.0)[source]

Log Bayes factor comparing an unknown rate against a fixed value.

Compares H1: the rate is unknown with a Beta(a, b) prior, against H0: the rate is exactly p0. Both marginal likelihoods are closed form, so this is an exact ratio rather than an estimate.

Parameters:
successes : int

Number of successes observed.

n : int

Number of trials.

p0 : float, default 0.5

The value the null hypothesis fixes the rate at.

a : float, default 1.0

Shape parameters of the Beta prior under H1.

b : float, default 1.0

Shape parameters of the Beta prior under H1.

Returns:

log(BF10). Positive values favour an unknown rate; negative values favour p0.

Return type:

float

Raises:

ValueError – If p0 is not strictly inside (0, 1), or if it is a boundary value that the data contradict outright.