mapply.rv {rv}R Documentation

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.

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.

Value

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

Note

If the function (FUN) has an argument ``FUN", it must be specified within the list supplied to MoreArgs.

Author(s)

Jouni Kerman kerman@stat.columbia.edu http://www.stat.columbia.edu/~kerman

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

  #

[Package rv version 0.949 Index]