var_distro: Generate Random Distribution

Description Usage Arguments Value Examples

Description

Generate Random Distribution

Usage

1
2
var_distro(n, mean, sd = 0, lower = -Inf, upper = Inf, method = "RND",
  lhs = NULL, distro = "normal", seed = 1234)

Arguments

n

number of realizations

mean

mean

sd

standard deviation

lower

lower limit of the truncated distribution

upper

upper limit of the truncated distribution

method

sampling method, either "RND" or "LHS". Default = "RND"

lhs

vector of quatiles (obtained from LH sampling functions). Not required if method = "RND". Default = NULL

distro

distribution

seed

integer serving as seed number, work only for the RND option

Value

an array with n random values for the given parameters

Examples

1
2
3
4
5
6
7
8
## Not run: 
distribution_1 <- var_distro(100, 10, 4)
hist(distribution_1)

distribution_2 <- var_distro(100, 10, 4, "truncated normal", 7, 13, seed = 123)
hist(distribution_2)

## End(Not run)

ravenroadresources/rmontecarlo documentation built on May 23, 2019, 3:06 p.m.