rv: Random Vectors

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/rv.R

Description

Creates or tests for objects of type “rv”.

Usage

1
2
3
4
5
6

Arguments

length

desired length.

x

object to be coerced or tested.

...

further arguments passed to or from other methods.

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

Value

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

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.

Author(s)

Jouni Kerman [email protected]

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

Examples

1
2
  x <- rv(1)
  

rv documentation built on May 29, 2017, 8:53 p.m.