Generate a Gamma Distribution Definition Based on Parameter Estimates
Source:R/deprecated.R
gamma_dist_def.Rd
Deprecated; use
Gamma()
instead to define a gamma distribution.
Usage
gamma_dist_def(
shape,
shape_sd,
scale,
scale_sd,
mean,
mean_sd,
sd,
sd_sd,
max_value,
samples
)
Arguments
- shape
Numeric, shape parameter of the gamma distribution.
- shape_sd
Numeric, standard deviation of the shape parameter.
- scale
Numeric, scale parameter of the gamma distribution.
- scale_sd
Numeric, standard deviation of the scale parameter.
- mean
Numeric, log mean parameter of the gamma distribution.
- mean_sd
Numeric, standard deviation of the log mean parameter.
- sd
Numeric, log sd parameter of the gamma distribution.
- sd_sd
Numeric, standard deviation of the log sd parameter.
- max_value
Numeric, the maximum value to allow. Defaults to 120. Samples outside of this range are resampled.
- samples
Numeric, number of sample distributions to generate.
Value
A <data.table>
defining the distribution as used by dist_skel()
Examples
# using estimated shape and scale
def <- gamma_dist_def(
shape = 5.807, shape_sd = 0.2,
scale = 0.9, scale_sd = 0.05,
max_value = 20, samples = 10
)
#> Warning: `gamma_dist_def()` was deprecated in EpiNow2 1.5.0.
#> ℹ Please use `Gamma()` instead.
#> ℹ The function will be removed completely in the next version.
print(def)
#> model params max_value
#> <char> <list> <num>
#> 1: gamma 6.0777763,0.9267953 20
#> 2: gamma 5.7513388,0.8751499 20
#> 3: gamma 5.7858312,0.9239703 20
#> 4: gamma 5.8925820,0.8486462 20
#> 5: gamma 5.7527510,0.8593279 20
#> 6: gamma 6.0945587,0.8659599 20
#> 7: gamma 5.8921964,0.9351958 20
#> 8: gamma 5.8885698,0.9378098 20
#> 9: gamma 5.6248276,0.8597328 20
#> 10: gamma 5.9297915,0.9263977 20
def$params[[1]]
#> shape rate
#> 6.0777763 0.9267953
# using mean and sd
def <- gamma_dist_def(
mean = 3, mean_sd = 0.5,
sd = 3, sd_sd = 0.1,
max_value = 20, samples = 10
)
print(def)
#> model params max_value
#> <char> <list> <num>
#> 1: gamma 1.2720725,0.3813526 20
#> 2: gamma 0.9203360,0.3301614 20
#> 3: gamma 0.6733141,0.2689955 20
#> 4: gamma 0.6087490,0.2678044 20
#> 5: gamma 0.9106026,0.3212901 20
#> 6: gamma 0.8693595,0.3092295 20
#> 7: gamma 0.7594379,0.2850320 20
#> 8: gamma 1.1548728,0.3495902 20
#> 9: gamma 0.7976741,0.2841142 20
#> 10: gamma 0.6436025,0.2621207 20
def$params[[1]]
#> shape rate
#> 1.2720725 0.3813526