def theta_t(th, n, p): pt = pt_t(th, n, p) if binomial(1, pt) == 1: return (th, pt, np.log(pt)) tt = dirichlet(alpha + n, 1)[0] return (tt, pt, np.log(1-pt) + dir_logpdf(tt, alpha + n))
def prior_prob(theta): return dir_logpdf(theta, alpha)
def theta_t(th, n, p): pt = pt_t(th, n, p) if binomial(1, pt) == 1: return (th, pt, np.log(pt)) tt = dirichlet(alpha + n, 1)[0] return (tt, pt, np.log(1-pt) + dir_logpdf(tt, alpha + n))
def prior_prob(theta): return dir_logpdf(theta, alpha)