Math.rv: Mathematical functions and Operators for rv Objects

Description Usage Arguments Details Author(s) References Examples

View source: R/Math_rv.R

Description

Mathematical functions and operators adapted to work with random variable (rv) objects.

Usage

1
2
3
4
  ## S3 method for class 'rv'
Math(x, ...)
  ## S3 method for class 'rv'
Ops(e1, e2)

Arguments

x

object

e1

object

e2

object

...

further arguments passed to or from other methods

Details

The operator method preserves the names of the longer vector (or those of the first if the lengths match).

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
2
3
4
5
6
7
  x <- rvnorm(10)
  -x
  names(x) <- paste("x[", seq_along(x), "]", sep="")
  x + 1:10
  1:2 + x
  cumsum(x)
  cumprod(exp(x))

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