Skip to content

Instantly share code, notes, and snippets.

View lfloeer's full-sized avatar

Lars lfloeer

View GitHub Profile
@lfloeer
lfloeer / gist:d8a2d3ccc8898eeb02af
Created May 4, 2015 15:34
Discrete variables in emcee
import emcee
from scipy import stats
from scipy.special import binom
import numpy as np
import pylab as pl
def ln_prior(p):
"Uniform prior on trials and beta prior on probability per trial"
if 5 <= p[0] <= 15 and 0. < p[1] < 1.:
return -0.5 * np.log(p[1]) - 0.5 * np.log(1 - p[1])