9

A median of a random variable is defined as any $m \in \mathbb{R}$ such that

$P(X \le m) \ge 1/2$ and $P(X \ge m) \ge 1/2$.

Alternatively, in terms of the CDF $F$ of $X$ defined by $F(x) := P(X \le x)$, we need

$F(m) \ge 1/2$ and $F(m^-) \le 1/2$, where the latter is the left limit of $F$ at $m$.

Under what conditions is the median unique? It seems that either

  • there should be a point $m$ with $F(m) = 1/2$ such that the CDF is continuous and inceasing in a neighborhood of $m$,
  • or there should be a point $m$ where $F(m-) < 1/2$ and $F(m) = 1/2$ and $F$ is increasing on $[m,m+\epsilon)$ for some small $\epsilon > 0$,
  • or there should be a point $m$ where $F(m-) < 1/2$ and $F(m) > 1/2$.

Are these all the possibilities?

FD_bfa
  • 4,757
passerby51
  • 4,280
  • you don't need to say that CDF is increasing, it's part of its definition (or its properties) – Martingalo Jan 14 '15 at 21:50
  • 1
    He probably means "strictly increasing." – Math1000 Jan 14 '15 at 22:03
  • Yes, I mean strictly increasing. – passerby51 Jan 15 '15 at 00:03
  • 1
    If it is strictly increasing at $m$, why does it have to be continuous? – Henry Jan 28 '15 at 18:14
  • @Henry: It is just one way to state a set of necessary and sufficient conditions. $F$ is either continuous or not at a potential median $m$. In the first case it has to be strictly increasing for unqiueness (it seems). Otherwise, one imposes other conditions, e.g. like the ones I mentioned. – passerby51 Jan 28 '15 at 22:01

5 Answers5

3

$\lambda(F_X^{-1}(0.5))=0 \iff X\text { is unique }$, where $\lambda()$ is the lebesgue measure and $F^{-1}()$ is the inverse image of the CDF. This condition implies that $\lambda[ \{x:P(X\leq x)\geq 1/2\}\cap\{x: P(X\geq x)\geq 1/2\}]=0$

  • The condition at the end doesn't seem to be necessary. (For the earlier one, how do you define $F^{-1}$? Is it the inverse image, the quantile function, ?) For example, consider a distribution that put 1/3 mass at each of the distinct points ${a,b,c}$ and assume $a < b < c$. Then, $b$ is the unique median. The CDF is not strictly increasing here. – passerby51 Jan 28 '15 at 00:57
  • @passerby51 I've modified my last sentence, as it simply implies the first condition. –  Jan 28 '15 at 13:27
  • @passerby51 I also tightened my first line, since $\epsilon\geq 0$ by necessity of $m$ being a median. –  Jan 28 '15 at 13:31
  • Regarding my example, am I missing something? I agree that $F$ is right-continuous. But from the definition, for $m$ to be median we need $F(m) \ge 1/2$ which holds for $m \in [b,c)$ and we need $F(m^{-}) \le 1/2$ which only holds for $b$. ($F(b^-) = 1/3$ while $F(x^-) = 2/3$ for $x \in (b,c)$.) – passerby51 Jan 28 '15 at 16:30
  • @passerby51 ah, yes...you are correct, and indeed there is not a neighborhood around $b$ that also satisfies the median, per my condition. Ill remove my comments. –  Jan 28 '15 at 17:21
  • @passerby51 I have simplified my condition, I think this encompasses my previous two, and it implies that your example case did have a unique median. –  Jan 29 '15 at 03:31
  • Thanks. I am wondering if just $|F^{-1}(0.5)| \le 1$ is enough. I mean, can we say that the median is unique if $F^{-1}(0.5)$ has cardinality at most $1$, i.e., has either one element or is empty. I haven't thought about whether there are any Cantor-type distribution that might serve as a counterexample. $|F^{-1}(.5)| \le 1$ certainly implies you condition. – passerby51 Jan 30 '15 at 02:33
  • @passerby51 well, that is literally saying the median has only one value. That may be more direct than mine. Not sure about pathological cases though. –  Jan 30 '15 at 03:08
2

For absolutely continuous radom variables you always have a unique median. Indeed, let $F$ denote the distribution function of a continuous random variable $X$, and $f$ its density function. We have $$F(x) = \int_{-\infty}^x f(y)dy.$$ The median is given by the value $x^\ast$ such that $$F(x^\ast)=1/2.$$

Definte the function $G(x) := F(x) - 1/2$. We have (by the Properties of distribution functions) $$\lim_{x\to -\infty} G(x) = -1/2, \, \mbox{and} \, \lim_{x\to \infty}G(x) = 1/2$$ hence by Bolzano's theorem (aka Intermediate value theorem) there is a value $x^\ast \in (-\infty,\infty)$ such that $G(x^\ast)=0$, hence $x^\ast$ is a median. It is unique since $$G'(x) = F'(x) = f(x)\geq 0.$$

Martingalo
  • 1,987
  • Thanks. That is fine, but I want all the cases where it is unique. A set of necessary and sufficient conditions. For example, it is enough for it to be continuous and strictly increasing around $F(x) = 1/2$. – passerby51 Jan 24 '15 at 18:30
  • if $f(x)=0$ in an interval containing $x^*$ then the median may not be unique – Henry Jan 31 '18 at 15:26
  • "It is unique since $G'(x) = F'(x) = f(x) \geq 0$" doesn't work, you need $f(x^*) > 0$. – Mauro Sep 11 '23 at 21:47
2

I would have thought you need a point $m$ such that $$\left(\tfrac12-F(m-\delta)\right)\left(F(m+\delta)-\tfrac12\right)\gt 0 \text{ for all } \delta \gt 0$$

You could split this into either of

  1. $F(m)=\tfrac12$ and $F(x)$ is strictly increasing at $x=m$
  2. $F(m) \gt \tfrac12$ and $F(x)\lt \tfrac12$ for all $x \lt m$

perhaps splitting (2) into

  1. $F(m) \gt \tfrac12$ and $\displaystyle \lim_{x\nearrow \,m-} F(x)\lt \tfrac12$
  2. $F(m) \gt \tfrac12$ and $\displaystyle \lim_{x\nearrow \,m-} F(x)= \tfrac12$ and $F(x)\lt \tfrac12$ for all $x \lt m$
Henry
  • 169,616
  • Thanks. Your first condition isn't necessary, at least with strict inequality. We could have a median for which $F$ is identically equal to $1/2$ in its neighborhood. For example, uniform distribution on ${-1,1}$ has all the points in $[-1,1]$ as its median, but for all the points $(-1,1)$ the CDF is $1/2$ in a neighborhood of the median. – passerby51 Jan 28 '15 at 16:42
  • @passerby: If your example has all the points in $[−1,1]$ as its median then I would have thought the median would not be unique. Perhaps I have misunderstood what you are saying. – Henry Jan 28 '15 at 18:12
  • Yes, based on the definition of the median I mentioned, which is the standard one in probability theory, that is the set of medians for a probability distribution with 1/2 mass at each of -1 and +1. – passerby51 Jan 28 '15 at 22:00
  • @passerby51: OK, but that example fails all my tests, as I would expect if the median is not unique. – Henry Jan 28 '15 at 22:02
  • OK... I see. Sorry, for some reason I thought your first line is giving conditions for $m$ to be a median (not a unique median). Let me think a bit about your first condition. But your second statement (2 cases) does not seem to be equivalent to the first. In your case 1, $F$ doesn't need to be strictly increasing for $x < m$, only for $x \ge m$ (it seems to me.) – passerby51 Jan 28 '15 at 22:06
  • 1
    I think my first line is both necessary and sufficient for a unique median – Henry Jan 28 '15 at 22:09
  • I believe, yours is true, but Eupraxis1981 has a simpler condition (just a matter of taste.) I would give you half the bounty if possible. Thanks again. – passerby51 Jan 30 '15 at 02:35
  • An alternative would be an $m$ such that $(x-m)\left(F(x)-\frac12\right) \gt 0$ for all $x \ne m$ – Henry Jan 30 '15 at 07:33
1

The following conditions guarantee the exsitence of a unique median

$1.$ CDF of the random variable $X$ is continuous.

$2.$ CDF of the random variable $X$ is strictly increasing.

Let $$a(m)=\int_{-\infty}^{m}f_X(x)\mathrm{d}x,\quad \mathcal{A}=\{m:a(m)\geq 1/2\}$$ and $$b(m)=\int_{m}^{\infty}f_X(x)\mathrm{d}x,\quad \mathcal{B}=\{m:b(m)\geq 1/2\}$$

If $a(m^*)=1/2$ for some $m^*$ then, $a(m)\geq 1/2$ for $m\geq m^*$ because $a$ is an increasing function.

Simlarly, if $b(m^{**})=1/2$ for some $m^{**}$ then, $b(m^{**})\geq 1/2$ for $m\leq m^{**}$ because $b$ is a decreasing function.

Hence, $$m^{**}\geq m\geq m^*\quad\quad (1)$$

We also know what $b(m)=1-a(m)\forall m$. Assume $m=m^{**}$. Then $$1/2=b(m^{**})=1-a(m^{**})=1-a(m^{*})$$ which implies $$a(m^{*})=b(m^{**})=1/2$$ Since both $a$ and $b$ are continuos. They intersect only at a single point at the co-domain of the CDF (even if the functions are non-increasing, non-decreasing type). If $a$ and $b$ are strictly increasing (decreasing resp.) functions, then the domain of intersection is also a single point, which is $m^*=m^{**}$. With this result Equation $1$ is also a single point and we are done.

  • Can you find an example where the CDF is strictly increasing in an open neighbourhood of a median $m$ but not continuous at $m$, where $m$ is not the unique median? In other words, why do you need (left-)continuity? – Henry Jan 31 '18 at 15:24
0

From the definitions

$$P(X \le m) \ge \frac12 \land P(X \ge m) \ge \frac12,$$ $$F(x) := P(X \le x),$$ we infer $$F(m)\ge \frac12\land 1-F(m)+P(X=m)\ge\frac12,$$ hence $$\frac12\le F(m)\le\frac12+P(X=m).$$ The solution set is $m\in F^{-1}([\frac12,\frac12+P(X=m)])$.

For continuous distributions, $F^{-1}(\frac12)$. $F$ must be injective for the image $\frac12$.