Gamma distribution
gamma_distribution.RdShape shape and scale scale: mean shape * scale, variance
shape * scale^2, as in stats::dgamma(). gamma_from_mean_cv() takes
the mean and coefficient of variation; gamma_from_mean_dispersion() the
GLM parameterization, mean mu and dispersion phi (variance
phi * mu^2). Properties: d@shape, d@scale.
Usage
gamma_distribution(shape, scale, ptr = NULL)
gamma_from_mean_cv(mean, cv)
gamma_from_mean_dispersion(mean, dispersion)Value
A gamma_distribution object, which inherits from distribution.
Details
Supports the same operations as pareto, plus log_density().
Examples
g <- gamma_from_mean_cv(1000, 0.5)
g@shape
#> [1] 4
layer(g, 1000, 1000)
#> [1] 180.4946