I have two random variables (say x1 and x2) defined by empirical probability distributions, and would like to calculate the median of their sum.
Under what circumstances (in terms of the distributions of x1 and x2) can I assume the median of the sum is equal to the sum of the medians i.e.
median(x1) + median(x2). (1)
The alternative approach I've used is to randomly generate large samples of x1 and x2 and then calculate the median as
median(sample of x1 + sample of x2). (2)
Approach (1) is quicker and I need to do this calculation many times. Under what circumstances is approach 1 approximately correct? Are their alternatives to my second approach?
---- Additional information after reading the comments
If we have two normally distributed random variables then median of the sum is approximately the sum of the medians
N1 <- rnorm(10000, mean = 1, sd = 0.1) N2 <- rnorm(10000, mean = 0) # We expect an answer of 1 and get close median(N1) + median(N2) # 0.9918688 median(N1 + N2) # 0.9962555
This doesn't work for exponential variables
set.seed(2002) e1 <- rexp(100000, 1) e2 <- rexp(100000, 1) median(e1) + median(e2) # expect 2* log(2) = 1.386 and get 1.374 median(e1 + e2) # expect 1.678 and get 1.668
So, looking at @glen_b's comment, is symmetry the sufficient condition that would allow the assumption that the median of the sum is the sum of the medians?