Learn R Programming

rv (version 1.0)

rvquantile: Componentwise Quantiles of Random Variables

Description

Computes componentwise quantiles of random vectors or arrays.

Usage

rvquantile(x, ...)
  ## S3 method for class 'rv':
rvquantile(x, probs=c(0.025, 0.10, 0.25, 0.50, 0.75, 0.90, 0.975), ignoreInf=FALSE, ...)
  ## S3 method for class 'rvsummary':
rvquantile(x, probs=c(0.025, 0.10, 0.25, 0.50, 0.75, 0.90, 0.975), ...)
  rvmedian(x)

Arguments

x
an object
probs
numeric vector of probabilities with values in [0,1]
ignoreInf
ignore infinite values
...
further arguments passed to quantile

Value

  • A numeric vector of quantiles.

Details

rvquantile applies the quantile function to each column of sims(x).

rvmedian applies median to the each column of sims(x).

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

Run this code
x <- rvnorm(3)
  rvquantile(x)
  rvquantile(x, probs=c(0, 0.01, 0.99, 1))
  rvmedian(x)

Run the code above in your browser using DataLab