rvsample: Draw a Sample from the Simulation Matrix of a Random Variable

Description Usage Arguments Details Value Author(s) References Examples

View source: R/rvsample.R

Description

Draws a sample of desired size from each component of a given random variable x.

Usage

1
rvsample(x, size = 1, jointly = TRUE, reject.na = FALSE)

Arguments

x

an object

size

size of the sample

jointly

return joint simulations and not simulations from each component separately

reject.na

reject each draw that contains an NA

Details

Samples (with replacement) from the distribution of the random variable object. In effect it samples from the rows of the simulation matrix sims(x).

Value

A numeric array of dimensions size times length(x).

Author(s)

Jouni Kerman jouni@kerman.com

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").

Examples

1
  #

jsta/rv documentation built on Feb. 12, 2022, 5:13 p.m.