update_gamma: Update Gamma

View source: R/update_gamma.R

update_gammaR Documentation

Update Gamma

Description

Updates Gamma Distribution with the Gamma-Exponential conjugate prior update rule. Parameterized by k and \theta (not \alpha, \beta)

Usage

update_gamma(k, theta, priors = list(), alternate_priors = FALSE)

Arguments

k

Double value for k (total revenue generating events). Must be 0 or greater.

theta

Double value for \theta (sum of revenue). Must be 0 or greater.

priors

An optional list object that contains k0 and theta0. Otherwise the function will use Gamma(1,250) as the prior distribution. If a second gamma distribution is used k01 and theta01 can be defined as separate priors when alternate_priors is set to TRUE.

alternate_priors

Boolean Defaults to FALSE. Allows a user to specify alternate prior names so the same prior isn't required when multiple gamma distributions are used.

Value

A list object that contains 'k' and 'theta'

Examples

update_gamma(k = 1, theta = 100, priors = list(k0 = 2, theta0 = 1000))
update_gamma(k = 10, theta = 200)


grizbayr documentation built on Oct. 9, 2023, 5:10 p.m.