Consider a Gamma-Poisson Bayesian model for rate parameter \(\lambda\) with a Gamma(shape, rate) prior on \(\lambda\) and a Poisson likelihood for the data. Given information on the prior (shape and rate) and data (the sample size n and sum_y), this function summarizes the mean, mode, and variance of the prior and posterior Gamma models of \(\lambda\).

summarize_gamma_poisson(shape, rate, sum_y = NULL, n = NULL)

Arguments

shape

positive shape parameter of the Gamma prior

rate

positive rate parameter of the Gamma prior

sum_y

sum of observed data values for the Poisson likelihood

n

number of observations for the Poisson likelihood

Value

data frame

Examples

summarize_gamma_poisson(shape = 3, rate = 4, sum_y = 7, n = 12)
#>       model shape rate  mean   mode       var        sd
#> 1     prior     3    4 0.750 0.5000 0.1875000 0.4330127
#> 2 posterior    10   16 0.625 0.5625 0.0390625 0.1976424