Skip to contents

This function generates random values from the random variable.

Arguments

n

Integer. Number of observations.

mu

Numeric. If it is provided and has length n, values will be used in each realization.

sigma

Numeric. If it is provided and has length n, values will be used in each realization.

Value

A vector of numeric values.

See also

Examples


test <- rand_lognormal(mu = 1, sigma = 2)
test$gen(10)
#>  [1]  1.02141317  9.56484814  0.58001387  1.06664094 26.72162584  2.82191931
#>  [7]  5.53787116  0.97328392  0.06651952  0.21273126

test$gen(3, mu = c(0,1,2), sigma = c(1,2,3))
#> [1]  2.2017418  0.5300569 47.3228123