Mean, Median and Mode

Mean, Median and Mode#

Median#

Definition 108 (Median)

Let \(X\) be a continuous random variable with \(P D F f_X\). The median of \(X\) is a point \(c \in \mathbb{R}\) such that

\[ \int_{-\infty}^c f_X(x) d x=\int_c^{\infty} f_X(x) d x \]

Theorem 26 (Median from CDF)

The median of a random variable \(X\) is the point \(c\) such that

\[ F_X(c)=\frac{1}{2} \]

Mode#

The mode is the peak of the PDF. We can see this from the definition below.

Definition 109 (Mode)

Let \(X\) be a continuous random variable. The mode is the point \(c\) such that \(f_X(x)\) attains the maximum:

\[ c=\underset{x \in \Omega}{\operatorname{argmax}} f_X(x)=\underset{x \in \Omega}{\operatorname{argmax}} \frac{d}{d x} F_X(x) \]

Note that the mode of a random variable is not unique, e.g., a mixture of two identical Gaussians with different means has two modes[Chan, 2021].

Mean#

We have defined the mean as the expectation of \(X\). Here, we show how to compute the expectation from the CDF. To simplify the demonstration, let us first assume that \(X>0\).

Lemma 5 (Mean from CDF (X > 0))

Let \(X>0\). Then \(\mathbb{E}[X]\) can be computed from \(F_X\) as

\[ \mathbb{E}[X]=\int_0^{\infty}\left(1-F_X(t)\right) d t \]

Lemma 6 (Mean from CDF (X < 0))

Let \(X<0\). Then \(\mathbb{E}[X]\) can be computed from \(F_X\) as

\[ \mathbb{E}[X]=\int_{-\infty}^0 F_X(t) d t \]

Theorem 27 (Mean from CDF)

The mean of a random variable \(X\) can be computed from the CDF as

\[ \mathbb{E}[X]=\int_0^{\infty}\left(1-F_X(t)\right) d t-\int_{-\infty}^0 F_X(t) d t . \]

See Also

See chapter 4.4. of An Introduction to Probability for Data Science by Chan[Chan, 2021] for a more rigorous treatment of the mean, median and mode.

References and Further Readings#

  • Chan, Stanley H. “Chapter 4.4 Median, Mode, and Mean.” In Introduction to Probability for Data Science, 196-201. Ann Arbor, Michigan: Michigan Publishing Services, 2021.