Learn R Programming

grizbayr (version 1.3.5)

update_gamma: 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)

Value

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

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.

Examples

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

Run the code above in your browser using DataLab