tnorm | R Documentation |
The function provides efficient state-of-the-art random number generation of a vector of truncated univariate distribution
of the same length as the lower bound vector. The function is vectorized and the vector of means mu
and
of standard deviations sd
are recycled.
If mu
or sd
are not specified they assume the default values of 0 and 1, respectively.
n |
number of observations |
p |
vector or matrix of probabilities |
mu |
vector of means |
sd |
vector of standard deviations |
lb |
vector of lower truncation limits |
ub |
vector of upper truncation limits |
method |
string, either of |
vector or matrix of random variates (rtnorm
) or of quantiles (ptnorm
), depending on the input
rtnorm(n = 10, mu = 2, lb = 1:10, ub = 2:11, method = "fast")
qtnorm(runif(10), mu = 2, lb = 1:10, ub = 2:11, sd = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.