Generates a distribution definition when only parameter estimates are available for gamma distributed parameters. See rgamma for distribution information.

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.

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 definining 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) print(def)
#> model params max_value #> 1: gamma <list[2]> 20 #> 2: gamma <list[2]> 20 #> 3: gamma <list[2]> 20 #> 4: gamma <list[2]> 20 #> 5: gamma <list[2]> 20 #> 6: gamma <list[2]> 20 #> 7: gamma <list[2]> 20 #> 8: gamma <list[2]> 20 #> 9: gamma <list[2]> 20 #> 10: gamma <list[2]> 20
def$params[[1]]
#> $alpha #> [1] 6.446901 #> #> $beta #> [1] 1.168393 #>
## 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 #> 1: gamma <list[2]> 20 #> 2: gamma <list[2]> 20 #> 3: gamma <list[2]> 20 #> 4: gamma <list[2]> 20 #> 5: gamma <list[2]> 20 #> 6: gamma <list[2]> 20 #> 7: gamma <list[2]> 20 #> 8: gamma <list[2]> 20 #> 9: gamma <list[2]> 20 #> 10: gamma <list[2]> 20
def$params[[1]]
#> $alpha #> [1] 0.9309454 #> #> $beta #> [1] 0.3262709 #>