Learn R Programming

rv (version 0.949)

mapply.rv: Apply a function to multiple random vector arguments

Description

mapply.rv is a rv-compatible version of mapply. It repeats the function FUN for each joint draw of the random (or constant) arguments.

Usage

mapply.rv(FUN, ..., MoreArgs=NULL, USE.NAMES=TRUE, SAMPLESIZE=NULL)

Arguments

FUN
the function to apply to the simulations of X.
MoreArgs
Other args passed to FUN `as is'
USE.NAMES
logical; see mapply for details
SAMPLESIZE
number of simulations to process. This should be not specified whenever the function is numeric.
...
further arguments to FUN, possibly random vectors or array.

Value

  • Depends on FUN; a random vector or array if FUN is numeric.

Details

mapply.rv applies a given function to each simulation (vector or array) of the given random vectors, returning a the results as a random vector or array.

Usually used in functions that implement an 'rv'-compatible routine.

For an example of a function that uses SAMPLESIZE, abline.

References

Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.

See Also

mapply, simapply

Examples

Run this code
#

Run the code above in your browser using DataLab