23/33
Bayesian experiment: Bernoulli distribution (1 / 5)
A Bayesian multivariate test with control and 3 variants. Data follows a
Bernoulli distribution with distinct success probability.
I
Generate control and variant models and build experiment. Select
stopping rule and threshold (epsilon).
from scipy import stats
from cprior.models.bernoulli import BernoulliModel
from cprior.models.bernoulli import BernoulliMVTest
from cprior.experiment.base import Experiment
modelA = BernoulliModel(name="control", alpha=1, beta=1)
modelB = BernoulliModel(name="variation", alpha=1, beta=1)
modelC = BernoulliModel(name="variation", alpha=1, beta=1)
modelD = BernoulliModel(name="variation", alpha=1, beta=1)
mvtest = BernoulliMVTest({"A": modelA, "B": modelB, "C": modelC, "D": modelD})
experiment = Experiment(name="CTR", test=mvtest,
stopping_rule="probability_vs_all",
epsilon=0.99, min_n_samples=1000, max_n_samples=None)