Last chance! 50% off unlimited learning
Sale ends in
Generate a random sample of size
r.sample(s, dist, p1=0, p2=1)
A scalar which specifies the size of the random sample drawn.
Character string, used as a switch to the user selected distribution function (see details below).
A scalar. Parameter 1 (vector or object) of the selected distribution.
A scalar. Parameter 2 (vector or object) of the selected distribution.
A vector of random values at the user specified points s
.
Based on user-specified argument dist
, the function returns a random sample of size
Supported distributions (along with the corresponding dist
values) are:
weib: The weibull distribution is implemented as
lognorm: The lognormal distribution is implemented as
norm: The normal distribution is implemented as
uni: The uniform distribution is implemented as
cauchy: The cauchy distribution is implemented as
fnorm: The half normal distribution is implemented as
normmixt:The normal mixture distribution is implemented as
where
skewnorm: The skew normal distribution with parameter
fas: The Fernandez and Steel distribution is implemented as
shash: The Sinh-Arcsinh distribution is implemented as
# NOT RUN {
selected.r <- "norm" #select Normal as the distribution
shape <- 2 # specify shape parameter
scale <- 1 # specify scale parameter
n <- 100 # specify sample size
r.sample(n,selected.r,shape,scale) # calculate CDF at the designated point
# }
Run the code above in your browser using DataLab