| GammaDistribution {rdecision} | R Documentation |
A parametrized Gamma distribution
Description
An R6 class representing a Gamma distribution.
Details
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.
Super class
rdecision::Distribution -> GammaDistribution
Methods
Public methods
Inherited methods
Method new()
Create an object of class GammaDistribution.
Usage
GammaDistribution$new(shape, scale)
Arguments
shapeshape parameter of the Gamma distribution.
scalescale parameter of the Gamma distribution.
Returns
An object of class GammaDistribution.
Method distribution()
Accessor function for the name of the distribution.
Usage
GammaDistribution$distribution()
Returns
Distribution name as character string.
Method mean()
Return the expected value of the distribution.
Usage
GammaDistribution$mean()
Returns
Expected value as a numeric value.
Method mode()
Return the mode of the distribution (if shape >= 1)
Usage
GammaDistribution$mode()
Returns
mode as a numeric value.
Method SD()
Return the standard deviation of the distribution.
Usage
GammaDistribution$SD()
Returns
Standard deviation as a numeric value
Method sample()
Draw and hold a random sample from the distribution.
Usage
GammaDistribution$sample(expected = FALSE)
Arguments
expectedIf TRUE, sets the next value retrieved by a call to
r()to be the mean of the distribution.
Returns
Updated distribution.
Method quantile()
Return the quantiles of the Gamma uncertainty distribution.
Usage
GammaDistribution$quantile(probs)
Arguments
probsVector of probabilities, in range [0,1].
Returns
Vector of quantiles.
Method clone()
The objects of this class are cloneable with this method.
Usage
GammaDistribution$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Author(s)
Andrew J. Sims andrew.sims@newcastle.ac.uk
References
Briggs A, Claxton K, Sculpher M. Decision modelling for health economic evaluation. Oxford, UK: Oxford University Press; 2006.