simapply {rv} | R Documentation |
simapply
applies a given function FUN
to each row of the simulation matrix,
returning an rv object.
simapply(x, FUN, ...)
x |
a random vector |
FUN |
a function |
... |
further arguments passed to FUN |
simapply
applies a given function to
the rows of the simulation matrix of the given random vector.
If the function accepts arrays, use mapply.rv
instead.
If the function is to be applied to columns of the simulation matrix,
use rvsimapply
instead.
Usually used in functions that implement an 'rv'-compatible routine.
Jouni Kerman kerman@stat.columbia.edu http://www.stat.columbia.edu/~kerman
Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.
# x <- rvnorm(10) simapply(x, mean) # Same result as that of mean(x).