Using emcee with Gaussian Priors
问题 I'm trying to use a gaussian prior using emcee and can't seem to fully figure it out. Basically I want to replace def lnprior(theta): a, b, c = theta if 1.0 < a < 2.0 and 1.0 < b < 2.0 and 1.0 < c < 2.0: return 0.0 return -np.inf with something that would sample 'a' from a gaussian distribution with a mu and sigma. How would I do that? Like this? def lnprior(theta): a, b, c = theta if 1.0 < b < 2.0 and 1.0 < c < 2.0: return 0.0 if 0<a<20: mu=10 sigma=1 s=np.random.normal(mu, sigma) return s