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 version 2.0.0.
print(def)
#> model params max_value
#> <char> <list> <num>
#> 1: gamma 5.1600627,0.8790653 20
#> 2: gamma 6.3565061,0.8754369 20
#> 3: gamma 5.6560042,0.9228177 20
#> 4: gamma 5.8599370,0.8210147 20
#> 5: gamma 6.2540577,0.9278593 20
#> 6: gamma 5.8673767,0.9150251 20
#> 7: gamma 5.6658676,0.8983608 20
#> 8: gamma 5.6401075,0.9127138 20
#> 9: gamma 5.8279722,0.9034454 20
#> 10: gamma 6.1162212,0.9148188 20
def$params[[1]]
#> shape rate
#> 5.1600627 0.8790653
# 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.1825553,0.3670235 20
#> 2: gamma 1.1202220,0.3506595 20
#> 3: gamma 1.0297842,0.3803855 20
#> 4: gamma 1.1515217,0.3511661 20
#> 5: gamma 0.9501477,0.3375148 20
#> 6: gamma 1.1171675,0.3390858 20
#> 7: gamma 1.5257826,0.4166384 20
#> 8: gamma 1.4583611,0.4270492 20
#> 9: gamma 0.6654358,0.2676816 20
#> 10: gamma 0.8751677,0.3215357 20
def$params[[1]]
#> shape rate
#> 1.1825553 0.3670235