shift_GA {IMIFA}R Documentation

Moment Matching Parameters of Shifted Gamma Distributions

Description

This function takes shape and rate parameters of a Gamma distribution and modifies them to achieve the same expected value and variance when the left extent of the support of the distribution is shifted up or down.

Usage

shift_GA(shape,
         rate,
         shift = 0,
         param = c("rate", "scale"))

Arguments

shape, rate

Shape and rate parameters a and b, respectively, of a Gamma(a, b) distribution. Both must be strictly positive.

shift

Modifier, such that the Gamma distribution has support on (shift, \infty). Can be positive or negative, though typically negative and small.

param

Switch controlling whether the supplied rate parameter is indeed a rate, or actually a scale parameter. Also governs whether the output is given in terms of rate or scale. Defaults to "rate".

Value

A named vector of length 2, containing the modified shape and rate parameters, respectively.

Note

This function is invoked within mcmc_IMIFA when discount is fixed at a non-zero value and learn.alpha=TRUE.

Author(s)

Keefe Murphy - <keefe.murphy@mu.ie>

Examples

# Shift a Ga(shape=4, rate=2) distribution to the left by 1;
# achieving the same expected value of 2 and variance of 1.
shift_GA(4, 2, -1)

[Package IMIFA version 2.2.0 Index]