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
rv(length = 0)

is.rv(x)

Arguments

length

desired length.

x

object to be coerced or tested.

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

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

See Also

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

Examples

1
  x <- rv(1)   

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