Learn R Programming

IMIFA (version 2.2.0)

shift_GA: 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"))

Value

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

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".

Author

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

Examples

Run this code
# 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)

Run the code above in your browser using DataLab