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.
Shape parameter a of a Gamma(a, b) distribution. Must be strictly positive.
rate
Rate parameter b of a Gamma(a, b) distribution. 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 list of length 2, containing the modified shape and rate parameters, respectively.
# NOT RUN {# 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)
# }