epistasis.sampling package

epistasis.sampling.bayesian module

class epistasis.sampling.bayesian.BayesianSampler(model, lnprior=None)

Bases: object

A sampling class to estimate the uncertainties in an epistasis model’s coefficients using a Bayesian approach. This object samples from the experimental uncertainty in the phenotypes to estimate confidence intervals for the coefficients in an epistasis model according to Bayes Theorem:

\[P(H|E) = \frac{ P(E|H) \cdot P(H) }{ P(E) }\]

This reads: “the probability of epistasis model \(H\) given the data \(E\) is equal to the probability of the data given the model times the probability of the model.”

Parameters:model – Epistasis model to run a bootstrap calculation.

Place the walkers in Gaussian balls in parameter space around the ML values for each coefficient.

static lnprior(thetas)

Prior probability for the given set of model parameters.

static lnprob(thetas, lnlike)

The posterior probability of a given set of model parameters and likelihood function.

sample(n_steps=100, n_burn=0, previous_state=None)

Sample the likelihood of the model by walking n_steps with each walker.