Creates or tests for objects of type "rv".

rv(length = 0)

is.rv(x)

Arguments

length

desired length.

x

object to be coerced or tested.

Value

An rv object of desired length, with the single simulation value NA.

Details

rv creates a random vector of the specified length. The elements of the vector are all equal to NA.

is.rv returns TRUE if its argument is a rv object, FALSE otherwise.

as.rv attempts to coerce its argument to the random vector (rv) type.

is.random returns TRUE or FALSE for each component of the argument vector, depending on whether the component is a random variable object.

is.rvobj tests whether its argument object is either of class rv or of class rvsummary.

as.rvobj coerces its argument object to rv unless the object is an rv object (is.rvobj(x) is TRUE).

Note

rv objects are internally lists with the class attribute set to ``rv". The number of simulations in rv objects is set by setnsims. This is by default set to 2500.

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

See also

For a short version of the paper, view the vignette by vignette("rv").

Author

Jouni Kerman jouni@kerman.com

Examples


  x <- rv(1)