simapply: Apply a Function to Rows of Simulations of Random Vectors
Description
simapply applies a given function FUN to each row of the simulation matrix,
returning an rv object.
Usage
simapply(x, FUN, …)
Arguments
x
a random vector.
FUN
a function.
…
further arguments passed to FUN.
Value
An rv object, representing the distribution of FUN(x, ...).
Details
simapply applies a given function to
the rows of the simulation matrix of the given random vector. If the function accepts arrays, use rvmapply instead. If the function is to be applied to each component of the random vector
separately (such as in rvmean), use rvsimapply instead. Usually used in functions that implement an 'rv'-compatible numeric function.
References
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").