An R6 class representing a Gamma distribution.
Andrew J. Sims andrew.sims@newcastle.ac.uk
rdecision::Distribution
-> GammaDistribution
new()
Create an object of class GammaDistribution
.
GammaDistribution$new(shape, scale)
shape
shape parameter of the Gamma distribution.
scale
scale parameter of the Gamma distribution.
An object of class GammaDistribution
.
distribution()
Accessor function for the name of the distribution.
GammaDistribution$distribution()
Distribution name as character string.
Expected value as a numeric value.
mode as a numeric value.
SD()
Return the standard deviation of the distribution.
GammaDistribution$SD()
Standard deviation as a numeric value
sample()
Draw and hold a random sample from the distribution.
GammaDistribution$sample(expected = FALSE)
expected
If TRUE, sets the next value retrieved by a call to
r()
to be the mean of the distribution.
Updated distribution.
quantile()
Return the quantiles of the Gamma uncertainty distribution.
GammaDistribution$quantile(probs)
probs
Vector of probabilities, in range [0,1].
Vector of quantiles.
clone()
The objects of this class are cloneable with this method.
GammaDistribution$clone(deep = FALSE)
deep
Whether to make a deep clone.
An object representing a Gamma distribution with hyperparameters
shape (k
) and scale (theta
). In econometrics this
parametrization is more common but in Bayesian statistics the shape
(alpha
) and rate (beta
) parametrization is more usual. Note,
however, that although Briggs et al (2006) use the shape, scale
formulation, they use alpha
, beta
as parameter names. Inherits
from class Distribution
.
Briggs A, Claxton K, Sculpher M. Decision modelling for health economic evaluation. Oxford, UK: Oxford University Press; 2006.