Consider a Beta-Binomial Bayesian model for parameter \(\pi\) with a Beta(alpha, beta) prior on \(\pi\) and Binomial likelihood with n trials and y successes. Given information on the prior (alpha and data) and data (y and n), this function summarizes the mean, mode, and variance of the prior and posterior Beta models of \(\pi\).

summarize_beta_binomial(alpha, beta, y = NULL, n = NULL)

Arguments

alpha, beta

positive shape parameters of the prior Beta model

y

number of successes

n

number of trials

Value

a summary table

Examples

summarize_beta_binomial(alpha = 1, beta = 15, y = 25, n = 50)
#>       model alpha beta      mean     mode         var         sd
#> 1     prior     1   15 0.0625000 0.000000 0.003446691 0.05870853
#> 2 posterior    26   40 0.3939394 0.390625 0.003563450 0.05969464