Generate a Log Normal Distribution Definition Based on Parameter Estimates
Source:R/deprecated.R
lognorm_dist_def.Rd
Generates a distribution definition when only parameter estimates
are available for log normal distributed parameters. See
rlnorm()
for
distribution information.
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.6450457,0.4991536 20
#> 2: lognormal 1.6750936,0.4843632 20
#> 3: lognormal 1.674877,0.398419 20
#> 4: lognormal 1.7197596,0.4381087 20
#> 5: lognormal 1.5779127,0.4550992 20
#> 6: lognormal 1.6003892,0.4617032 20
#> 7: lognormal 1.6153276,0.4381546 20
#> 8: lognormal 1.6755410,0.4158995 20
#> 9: lognormal 1.5754590,0.4714915 20
#> 10: lognormal 1.5457024,0.3798537 20
def$params[[1]]
#> meanlog sdlog
#> 1.6450457 0.4991536
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.1604231,0.7689993 20
#> 2: lognormal 0.9481073,0.7749594 20
#> 3: lognormal 1.5442670,0.5902921 20
#> 4: lognormal 1.5273931,0.6724763 20
#> 5: lognormal 1.3939681,0.6684031 20
#> 6: lognormal 1.6762011,0.5467758 20
#> 7: lognormal 1.5418488,0.5771506 20
#> 8: lognormal 1.4143202,0.6481358 20
#> 9: lognormal 1.5843558,0.5097814 20
#> 10: lognormal 1.6591397,0.3718212 20
def$params[[1]]
#> meanlog sdlog
#> 1.1604231 0.7689993