rvdens {rv}R Documentation

Sample from an arbitrary density function using grid approximation

Description

rvdens generates a random vector where each simulation comes from a Bernoulli sampling distribution.

Usage

  rvdens(n=1, FUN, range, unitprecision=10, ...)

Arguments

n number of random scalars to draw
FUN density function
range range to discretize over
unitprecision how many points per unit length
... other arguments passed on to FUN

Details

Value

A random vector (an rv object) of length n.

Note

The resulting vector will not be independent and identically distributed Bernoulli unless prob is a fixed number.

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.

Examples

  #

[Package rv version 0.949 Index]