Learn R Programming

robcp (version 0.3.8)

medianDiff: Median of the set X - Y

Description

Computes the median of the set X - Y. X - Y denotes the set \(\{x - y | x \in X, y \in Y\)}.

Usage

medianDiff(x, y)

Value

The median element of X - Y

Arguments

x, y

Numeric vectors

Author

Sheila Görz

Details

Special case of the function kthPair.

References

Johnson, D. B., & Mizoguchi, T. (1978). Selecting the K-th Element in X+Y and X_1+X_2+ ... +X_m. SIAM Journal on Computing, 7(2), 147-153.

Examples

Run this code
x <- rnorm(100)
y <- runif(100)
medianDiff(x, y)

Run the code above in your browser using DataLab