Skip to contents

[Deprecated] Generates a distribution definition when only parameter estimates are available for log normal distributed parameters. See rlnorm() for distribution information.

Usage

lognorm_dist_def(mean, mean_sd, sd, sd_sd, max_value, samples, to_log = FALSE)

Arguments

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.

to_log

Logical, should parameters be logged before use.

Value

A <data.table> defining the distribution as used by dist_skel()

Examples

def <- lognorm_dist_def(
  mean = 1.621, mean_sd = 0.0640,
  sd = 0.418, sd_sd = 0.0691,
  max_value = 20, samples = 10
)
print(def)
#>         model              params max_value
#>        <char>              <list>     <num>
#>  1: lognormal 1.5556334,0.2847219        20
#>  2: lognormal 1.6271052,0.4737328        20
#>  3: lognormal   1.735640,0.341523        20
#>  4: lognormal 1.6346764,0.3466796        20
#>  5: lognormal 1.6671062,0.3830598        20
#>  6: lognormal 1.6993216,0.4474316        20
#>  7: lognormal 1.6587003,0.3480901        20
#>  8: lognormal 1.6486040,0.4105998        20
#>  9: lognormal   1.755844,0.425070        20
#> 10: lognormal 1.6244694,0.4588656        20
def$params[[1]]
#>   meanlog     sdlog 
#> 1.5556334 0.2847219 

def <- lognorm_dist_def(
  mean = 5, mean_sd = 1,
  sd = 3, sd_sd = 1,
  max_value = 20, samples = 10,
  to_log = TRUE
)
print(def)
#>         model              params max_value
#>        <char>              <list>     <num>
#>  1: lognormal 1.2556025,0.6675127        20
#>  2: lognormal 1.2772149,0.4254886        20
#>  3: lognormal 1.5739442,0.2513441        20
#>  4: lognormal 1.7605469,0.3320549        20
#>  5: lognormal 1.3504337,0.5300849        20
#>  6: lognormal 1.2238703,0.4537926        20
#>  7: lognormal 1.1380446,0.5359115        20
#>  8: lognormal 1.4308556,0.4518779        20
#>  9: lognormal 1.7320771,0.5108582        20
#> 10: lognormal 1.3523112,0.4843975        20
def$params[[1]]
#>   meanlog     sdlog 
#> 1.2556025 0.6675127