powered by
rvdens generates a random vector where each simulation comes from a Bernoulli sampling distribution.
rvdens
rvdens(n = 1, FUN, range, unitprecision = 10, ...)
number of random scalars to draw
density function
range to discretize over
how many points per unit length
other arguments passed on to FUN
FUN
A random vector (an rv object) of length n.
n
Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
See also vignette("rv").
vignette("rv")
# NOT RUN { x <- rvdens(FUN=stats:::dnorm, range=c(-5, 5), unitprecision=10) y <- rvnorm(1) ## Should be close to x # }
Run the code above in your browser using DataLab