Bayesian analysis function for a posterior and its decision summaries
b(p(theta), p(y | theta), y) = p(theta | y)
Takes a prior distribution for an unknown model input, a likelihood and the observed data and returns the posterior distribution with the summaries a health technology assessment reads, such as a posterior mean, an expected value of perfect information and a model comparison statistic. The posterior is proportional to likelihood times prior, and HE-FN-BAD-001 gives the normalised form. Live records already hold the common conjugate updates, the beta for a probability in HE-FM-BETA-002, the normal for a treatment effect in HE-FM-BAD-001 and the Dirichlet for a transition row in HE-FM-DIRI-002. The posterior mean of HE-FM-BETA-002 is also the average of the prior mean and the trial proportion weighted by alpha_0 + beta_0 and n (derived). Posterior draws feed the acceptability curve HE-FM-CEAC-001 and EVPI from draws HE-FM-EVPI-002. This package adds the gamma update for an event rate, exact EVPI when incremental net benefit is linear in a beta probability, and the deviance information criterion. Notation follows the Bayesian Analysis article.
Gamma posterior for an event rate from a Poisson count and its exposure
alpha = alpha_0 + D; beta = beta_0 + T; E_r = alpha / beta; SD_r = sqrt(alpha) / beta
Exact two-option EVPI when incremental net benefit is linear in a beta probability
k = lambda * q; p_star = c / k; E_p = alpha / (alpha + beta); INB_bar = k * E_p - c; E_pos = k * E_p * G_1 - c * G_0; EVPI_B = E_pos - max(INB_bar, 0)
Deviance information criterion from posterior mean residual deviance and effective parameters
p_D = D_res - D_fit; DIC = D_res + p_D
