Learn R Programming

rv (version 0.949)

rvoverlap: Test Whether Intervals Overlap with a Given Interval

Description

Tests whether the uncertainty intervals of the given random variables overlap with a given interval.

NOTE. Still experimental.

Usage

rvoverlap(obj, iv, interval=0.95, one.sided=FALSE, left=TRUE)

Arguments

obj
random variable (vector or array)
iv
an interval (range)
interval
size of the (middle) interval
one.sided
logical, FALSE if two-sided interval is desired
left
logical, indicating if the left one-sided interval is desired

Value

  • 0Middle interval is fully enclosed by iv
  • -1Middle interval is partially covered on the left of iv
  • +1Middle interval is partially covered on the right of iv
  • -InfMiddle interval is completely to the left of iv
  • +InfMiddle interval is completely to the right of iv

References

Kerman, Jouni and Gelman, Andrew. Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Technical report, Columbia University, New York.

Examples

Run this code
rvoverlap(rvnorm(20), iv=c(-1,1), interval=0.683) #

Run the code above in your browser using DataLab