bayesplain.core.dirichlet_multinomial.log_bayes_factor_independence

bayesplain.core.dirichlet_multinomial.log_bayes_factor_independence(table, concentration=1.0, scheme='independent_multinomial', fixed='rows')[source]

Log Bayes factor for association against independence.

Parameters:
table : array_like

Table of counts, shape (R, C).

concentration : float or array_like, default 1.0

Dirichlet concentration a. a = 1 makes every combination of parameter values equally likely a priori; larger values pull the alternative’s predictions toward the null, so a = 10 behaves like a flat prior already updated with nine hypothetical observations per cell. For scheme='independent_multinomial' a per-column vector is also accepted, which is how a Beta(a, b) prior on a rate is carried into the Bayes factor unchanged.

scheme : str, default 'independent_multinomial'

One of SCHEMES. Pick the one matching what the study design fixed in advance; see the module docstring.

fixed : {'rows', 'columns'}, default 'rows'

Which margin was fixed, for the independent-multinomial scheme only. Rows are the groups you sampled.

Returns:

log(BF10). Positive values favour association between rows and columns; negative values favour independence.

Return type:

float

Notes

Exact – gamma functions only, with no integration. Validated against the published values in Jamil et al. (2017); see bayesplain/tests/test_dirichlet_multinomial.py.