# What does the median tell us about a distribution

In statistics and probability theory, the median is the value separating the higher half from the lower half of a data sample, a population, or a probability distribution. For a data set, it may be thought of as "the middle" value. The basic feature of the median in describing data compared to the mean (often simply described as the "average") is that it is not skewed by a small proportion of extremely large or small values, and therefore provides a better representation of a "typical" value. Median income, for example, may be a better way to suggest what a "typical" income is, because income distribution can be very skewed. The median is of central importance in robust statistics, as it is the most resistant statistic, having a breakdown point of 50%: so long as no more than half the data are contaminated, the median is not an arbitrarily large or small result.

Finding the median in sets of data with an odd and even number of values

## Finite data set of numbersEdit

The median of a finite list of numbers is the "middle" number, when those numbers are listed in order from smallest to greatest.

If the data set has an odd number of observations, the middle one is selected. For example, the following list of seven numbers,

1, 3, 3, 6, 7, 8, 9

has the median of 6, which is the fourth value.

If the data set has an even number of observations, there is no distinct middle value and the median is usually defined to be the arithmetic mean of the two middle values.[1][2] For example, this data set of 8 numbers

1, 2, 3, 4, 5, 6, 8, 9

has a median value of 4.5, that is (4+5)/2{\displaystyle (4+5)/2}. (In more technical terms, this interprets the median as the fully trimmed mid-range).

In general, with this convention, the median can be defined as follows: For a data set x{\displaystyle x} of n{\displaystyle n} elements, ordered from smallest to greatest,

if n{\displaystyle n} is odd, median(x)=x(n+1)/2{\displaystyle \mathrm {median} (x)=x_{(n+1)/2}}if n{\displaystyle n} is even, median(x)=x(n/2)+x(n/2)+12{\displaystyle \mathrm {median} (x)={\frac {x_{(n/2)}+x_{(n/2)+1}}{2}}}Comparison of common averages of values [ 1, 2, 2, 3, 4, 7, 9 ]TypeDescriptionExampleResultArithmetic meanSum of values of a data set divided by number of values: x¯=1ni=1nxi{\displaystyle \scriptstyle {\bar {x}}={\frac {1}{n}}\sum _{i=1}^{n}x_{i}}(1+2+2+3+4+7+9)/74MedianMiddle value separating the greater and lesser halves of a data set1, 2, 2, 3, 4, 7, 93ModeMost frequent value in a data set1, 2, 2, 3, 4, 7, 92

### Formal definitionEdit

Formally, a median of a population is any value such that at most half of the population is less than the proposed median and at most half is greater than the proposed median. As seen above, medians may not be unique. If each set contains less than half the population, then some of the population is exactly equal to the unique median.

The median is well-defined for any ordered (one-dimensional) data, and is independent of any distance metric. The median can thus be applied to classes which are ranked but not numerical (e.g. working out a median grade when students are graded from A to F), although the result might be halfway between classes if there is an even number of cases.

A geometric median, on the other hand, is defined in any number of dimensions. A related concept, in which the outcome is forced to correspond to a member of the sample, is the medoid.

There is no widely accepted standard notation for the median, but some authors represent the median of a variable x either as x͂ or as μ1/2[1] sometimes also M.[3][4] In any of these cases, the use of these or other symbols for the median needs to be explicitly defined when they are introduced.

The median is a special case of other ways of summarizing the typical values associated with a statistical distribution: it is the 2nd quartile, 5th decile, and 50th percentile.

The median can be used as a measure of location when one attaches reduced importance to extreme values, typically because a distribution is skewed, extreme values are not known, or outliers are untrustworthy, i.e., may be measurement/transcription errors.

For example, consider the multiset

1, 2, 2, 2, 3, 14.

The median is 2 in this case, (as is the mode), and it might be seen as a better indication of the center than the arithmetic mean of 4, which is larger than all-but-one of the values. However, the widely cited empirical relationship that the mean is shifted "further into the tail" of a distribution than the median is not generally true. At most, one can say that the two statistics cannot be "too far" apart; see §Inequality relating means and medians below.[5]

As a median is based on the middle data in a set, it is not necessary to know the value of extreme results in order to calculate it. For example, in a psychology test investigating the time needed to solve a problem, if a small number of people failed to solve the problem at all in the given time a median can still be calculated.[6]

Because the median is simple to understand and easy to calculate, while also a robust approximation to the mean, the median is a popular summary statistic in descriptive statistics. In this context, there are several choices for a measure of variability: the range, the interquartile range, the mean absolute deviation, and the median absolute deviation.

For practical purposes, different measures of location and dispersion are often compared on the basis of how well the corresponding population values can be estimated from a sample of data. The median, estimated using the sample median, has good properties in this regard. While it is not usually optimal if a given population distribution is assumed, its properties are always reasonably good. For example, a comparison of the efficiency of candidate estimators shows that the sample mean is more statistically efficient when and only when data is uncontaminated by data from heavy-tailed distributions or from mixtures of distributions.[citation needed] Even then, the median has a 64% efficiency compared to the minimum-variance mean (for large normal samples), which is to say the variance of the median will be ~50% greater than the variance of the mean.[7][8]

## Probability distributionsEdit

Geometric visualization of the mode, median and mean of an arbitrary probability density function[9]

For any real-valued probability distribution with cumulative distribution functionF, a median is defined as any real numberm that satisfies the inequalities

(,m]dF(x)12and[m,)dF(x)12{\displaystyle \int _{(-\infty ,m]}dF(x)\geq {\frac {1}{2}}{\text{ and }}\int _{[m,\infty )}dF(x)\geq {\frac {1}{2}}}.

An equivalent phrasing uses a random variable X distributed according to F:

P(Xm)12andP(Xm)12{\displaystyle \operatorname {P} (X\leq m)\geq {\frac {1}{2}}{\text{ and }}\operatorname {P} (X\geq m)\geq {\frac {1}{2}}}

Note that this definition does not require X to have an absolutely continuous distribution (which has a probability density function ƒ), nor does it require a discrete one. In the former case, the inequalities can be upgraded to equality: a median satisfies

P(Xm)=mf(x)dx=12=mf(x)dx=P(Xm){\displaystyle \operatorname {P} (X\leq m)=\int _{-\infty }^{m}{f(x)\,dx}={\frac {1}{2}}=\int _{m}^{\infty }{f(x)\,dx}=\operatorname {P} (X\geq m)}.

Any probability distribution on R has at least one median, but in pathological cases there may be more than one median: if F is constant 1/2 on an interval (so that ƒ=0 there), then any value of that interval is a median.

The medians of certain types of distributions can be easily calculated from their parameters; furthermore, they exist even for some distributions lacking a well-defined mean, such as the Cauchy distribution:

## PopulationsEdit

### Optimality propertyEdit

The mean absolute error of a real variable c with respect to the random variableX is

E(|Xc|){\displaystyle E(\left|X-c\right|)\,}

Provided that the probability distribution of X is such that the above expectation exists, then m is a median of X if and only if m is a minimizer of the mean absolute error with respect to X.[11] In particular, m is a sample median if and only if m minimizes the arithmetic mean of the absolute deviations.[12]

More generally, a median is defined as a minimum of

E(|Xc||X|),{\displaystyle E(|X-c|-|X|),}

as discussed below in the section on multivariate medians (specifically, the spatial median).

This optimization-based definition of the median is useful in statistical data-analysis, for example, in k-medians clustering.

If the distribution has finite variance, then the distance between the median X~{\displaystyle {\tilde {X}}} and the mean X¯{\displaystyle {\bar {X}}} is bounded by one standard deviation.

This bound was proved by Mallows,[13] who used Jensen's inequality twice, as follows. Using |·| for the absolute value, we have

|μm|=|E(Xm)|E(|Xm|)E(|Xμ|)E((Xμ)2)=σ.{\displaystyle {\begin{aligned}|\mu -m|=|\operatorname {E} (X-m)|&\leq \operatorname {E} (|X-m|)\\&\leq \operatorname {E} (|X-\mu |)\\&\leq {\sqrt {\operatorname {E} \left((X-\mu )^{2}\right)}}=\sigma .\end{aligned}}}

The first and third inequalities come from Jensen's inequality applied to the absolute-value function and the square function, which are each convex. The second inequality comes from the fact that a median minimizes the absolute deviation function aE(|Xa|){\displaystyle a\mapsto \operatorname {E} (|X-a|)}.

Mallows' proof can be generalized to obtain a multivariate version of the inequality[14] simply by replacing the absolute value with a norm:

μmE(Xμ2)=trace(var(X)){\displaystyle \|\mu -m\|\leq {\sqrt {\operatorname {E} \left(\|X-\mu \|^{2}\right)}}={\sqrt {\operatorname {trace} \left(\operatorname {var} (X)\right)}}}

where m is a spatial median, that is, a minimizer of the function aE(Xa).{\displaystyle a\mapsto \operatorname {E} (\|X-a\|).\,} The spatial median is unique when the data-set's dimension is two or more.[15][16]

An alternative proof uses the one-sided Chebyshev inequality; it appears in an inequality on location and scale parameters. This formula also follows directly from Cantelli's inequality.[17]

#### Unimodal distributionsEdit

For the case of unimodal distributions, one can achieve a sharper bound on the distance between the median and the mean:

|X~X¯|(35)12σ0.7746σ{\displaystyle \left|{\tilde {X}}-{\bar {X}}\right|\leq \left({\frac {3}{5}}\right)^{\frac {1}{2}}\sigma \approx 0.7746\sigma }.[18]

A similar relation holds between the median and the mode:

|X~mode|312σ1.732σ.{\displaystyle \left|{\tilde {X}}-\mathrm {mode} \right|\leq 3^{\frac {1}{2}}\sigma \approx 1.732\sigma .}

Jensen's inequality states that for any random variable X with a finite expectation E[X] and for any convex function f

f[E(x)]E[f(x)]{\displaystyle f[E(x)]\leq E[f(x)]}

This inequality generalizes to the median as well. We say a function f: is a C function if, for any t,

f1((,t])={xRf(x)t}{\displaystyle f^{-1}\left(\,(-\infty ,t]\,\right)=\{x\in \mathbb {R} \mid f(x)\leq t\}}

is a closed interval (allowing the degenerate cases of a single point or an empty set). Every convex function is a C function, but the reverse does not hold. If f is a C function, then

f(Median[X])Median[f(X)]{\displaystyle f(\operatorname {Median} [X])\leq \operatorname {Median} [f(X)]}

If the medians are not unique, the statement holds for the corresponding suprema.[19]

#### Efficient computation of the sample medianEdit

Even though comparison-sorting n items requires Ω(n log n) operations, selection algorithms can compute the kth-smallest of n items with only Θ(n) operations. This includes the median, which is the n/2th order statistic (or for an even number of samples, the arithmetic mean of the two middle order statistics).[20]

Selection algorithms still have the downside of requiring Ω(n) memory, that is, they need to have the full sample (or a linear-sized portion of it) in memory. Because this, as well as the linear time requirement, can be prohibitive, several estimation procedures for the median have been developed. A simple one is the median of three rule, which estimates the median as the median of a three-element subsample; this is commonly used as a subroutine in the quicksort sorting algorithm, which uses an estimate of its input's median. A more robust estimator is Tukey's ninther, which is the median of three rule applied with limited recursion:[21] if A is the sample laid out as an array, and

med3(A) = median(A[1], A[n/2], A[n]),

then

ninther(A) = med3(med3(A[1 ... 1/3n]), med3(A[1/3n ... 2/3n]), med3(A[2/3n ... n]))

The remedian is an estimator for the median that requires linear time but sub-linear memory, operating in a single pass over the sample.[22]

#### Sampling distributionEdit

The distributions of both the sample mean and the sample median were determined by Laplace.[23] The distribution of the sample median from a population with a density function f(x){\displaystyle f(x)} is asymptotically normal with mean m{\displaystyle m} and variance[24]

14nf(m)2{\displaystyle {\frac {1}{4nf(m)^{2}}}}

where m{\displaystyle m} is the median of f(x){\displaystyle f(x)} and n{\displaystyle n} is the sample size. A modern proof follows below. Laplace's result is now understood as a special case of the asymptotic distribution of arbitrary quantiles.

For normal samples, the density is f(m)=1/2πσ2{\displaystyle f(m)=1/{\sqrt {2\pi \sigma ^{2}}}}, thus for large samples the variance of the median equals (π/2)(σ2/n).{\displaystyle ({\pi }/{2})\cdot (\sigma ^{2}/n).}[7] (See also section #Efficiency below.)

##### Derivation of the asymptotic distributionEdit

We take the sample size to be an odd number N=2n+1{\displaystyle N=2n+1} and assume our variable continuous; the formula for the case of discrete variables is given below in §Empirical local density. The sample can be summarized as "below median", "at median", and "above median", which corresponds to a trinomial distribution with probabilities F(v1){\displaystyle F(v-1)}, f(v){\displaystyle f(v)} and 1F(v){\displaystyle 1-F(v)}. For a continuous variable, the probability of multiple sample values being exactly equal to the median is 0, so one can calculate the density of at the point v{\displaystyle v} directly from the trinomial distribution:

Pr[Median=v]dv=(2n+1)!n!n!F(v)n(1F(v))nf(v)dv{\displaystyle \Pr[\operatorname {Median} =v]\,dv={\frac {(2n+1)!}{n!n!}}F(v)^{n}(1-F(v))^{n}f(v)\,dv}.

Now we introduce the beta function. For integer arguments α{\displaystyle \alpha } and β{\displaystyle \beta }, this can be expressed as B(α,β)=(α1)!(β1)!(α+β1)!{\displaystyle \mathrm {B} (\alpha ,\beta )={\frac {(\alpha -1)!(\beta -1)!}{(\alpha +\beta -1)!}}}. Also, recall that f(v)dv=dF(v){\displaystyle f(v)\,dv=dF(v)}. Using these relationships and setting both α{\displaystyle \alpha } and β{\displaystyle \beta } equal to n+1{\displaystyle n+1} allows the last expression to be written as

F(v)n(1F(v))nB(n+1,n+1)dF(v){\displaystyle {\frac {F(v)^{n}(1-F(v))^{n}}{\mathrm {B} (n+1,n+1)}}\,dF(v)}

Hence the density function of the median is a symmetric beta distribution pushed forward by F{\displaystyle F}. Its mean, as we would expect, is 0.5 and its variance is 1/(4(N+2)){\displaystyle 1/(4(N+2))}. By the chain rule, the corresponding variance of the sample median is

14(N+2)f(m)2{\displaystyle {\frac {1}{4(N+2)f(m)^{2}}}}.

The additional 2 is negligible in the limit.

##### Empirical local densityEdit

In practice, the functions f{\displaystyle f} and F{\displaystyle F} are often not known or assumed. However, they can be estimated from an observed frequency distribution. In this section, we give an example. Consider the following table, representing a sample of 3,800 (discrete-valued) observations:

v00.511.522.533.544.55f(v)0.0000.0080.0100.0130.0830.1080.3280.2200.2020.0230.005F(v)0.0000.0080.0180.0310.1140.2220.5500.7700.9720.9951.000

Because the observations are discrete-valued, constructing the exact distribution of the median is not an immediate translation of the above expression for Pr(Median=v){\displaystyle \Pr(\operatorname {Median} =v)}; one may (and typically does) have multiple instances of the median in one's sample. So we must sum over all these possibilities:

Pr(Median=v)=i=0nk=0nN!i!(Nik)!k!F(v1)i(1F(v))kf(v)Nik{\displaystyle \Pr(\operatorname {Median} =v)=\sum _{i=0}^{n}\sum _{k=0}^{n}{\frac {N!}{i!(N-i-k)!k!}}F(v-1)^{i}(1-F(v))^{k}f(v)^{N-i-k}}

Here, i is the number of points strictly less than the median and k the number strictly greater.

Using these preliminaries, it is possible to investigate the effect of sample size on the standard errors of the mean and median. The observed mean is 3.16, the observed raw median is 3 and the observed interpolated median is 3.174. The following table gives some comparison statistics.

391521Expected value of median3.1983.1913.1743.161Standard error of median (above formula)0.4820.3050.2570.239Standard error of median (asymptotic approximation)0.8790.5080.3930.332Standard error of mean0.4210.2430.1880.159

The expected value of the median falls slightly as sample size increases while, as would be expected, the standard errors of both the median and the mean are proportionate to the inverse square root of the sample size. The asymptotic approximation errs on the side of caution by overestimating the standard error.

#### Estimation of variance from sample dataEdit

The value of (2f(x))2{\displaystyle (2f(x))^{-2}}the asymptotic value of n12(νm){\displaystyle n^{-{\frac {1}{2}}}(\nu -m)} where ν{\displaystyle \nu } is the population medianhas been studied by several authors. The standard "delete one" jackknife method produces inconsistent results.[25] An alternativethe "delete k" methodwhere k{\displaystyle k} grows with the sample size has been shown to be asymptotically consistent.[26] This method may be computationally expensive for large data sets. A bootstrap estimate is known to be consistent,[27] but converges very slowly (order of n14{\displaystyle n^{-{\frac {1}{4}}}}).[28] Other methods have been proposed but their behavior may differ between large and small samples.[29]

#### EfficiencyEdit

The efficiency of the sample median, measured as the ratio of the variance of the mean to the variance of the median, depends on the sample size and on the underlying population distribution. For a sample of size N=2n+1{\displaystyle N=2n+1} from the normal distribution, the efficiency for large N is

2πN+2N{\displaystyle {\frac {2}{\pi }}{\frac {N+2}{N}}}

The efficiency tends to 2π{\displaystyle {\frac {2}{\pi }}} as N{\displaystyle N} tends to infinity.

In other words, the relative variance of the median will be π/21.57{\displaystyle \pi /2\approx 1.57}, or 57% greater than the variance of the mean the relative standard error of the median will be (π/2)121.25{\displaystyle (\pi /2)^{\frac {1}{2}}\approx 1.25}, or 25% greater than the standard error of the mean, σ/n{\displaystyle \sigma /{\sqrt {n}}} (see also section #Sampling distribution above.).[30]

### Other estimatorsEdit

For univariate distributions that are symmetric about one median, the HodgesLehmann estimator is a robust and highly efficient estimator of the population median.[31]

If data are represented by a statistical model specifying a particular family of probability distributions, then estimates of the median can be obtained by fitting that family of probability distributions to the data and calculating the theoretical median of the fitted distribution.[citation needed] Pareto interpolation is an application of this when the population is assumed to have a Pareto distribution.

Previously, this article discussed the univariate median, when the sample or population had one-dimension. When the dimension is two or higher, there are multiple concepts that extend the definition of the univariate median; each such multivariate median agrees with the univariate median when the dimension is exactly one.[31][32][33][34]

The marginal median is defined for vectors defined with respect to a fixed set of coordinates. A marginal median is defined to be the vector whose components are univariate medians. The marginal median is easy to compute, and its properties were studied by Puri and Sen.[31][35]

The geometric median of a discrete set of sample points x1,xN{\displaystyle x_{1},\ldots x_{N}} in a Euclidean space is the[a] point minimizing the sum of distances to the sample points.

μ^=argminμRmn=1Nμxn2{\displaystyle {\hat {\mu }}={\underset {\mu \in \mathbb {R} ^{m}}{\operatorname {arg\,min} }}\sum _{n=1}^{N}\left\|\mu -x_{n}\right\|_{2}}

In contrast to the marginal median, the geometric median is equivariant with respect to Euclidean similarity transformations such as translations and rotations.

If the marginal medians for all coordinate systems coincide, then their common location may be termed the "median in all directions".[37] This concept is relevant to voting theory on account of the median voter theorem. When it exists, the median in all directions coincides with the geometric median (at least for discrete distributions).

### CenterpointEdit

An alternative generalization of the median in higher dimensions is the centerpoint.

When dealing with a discrete variable, it is sometimes useful to regard the observed values as being midpoints of underlying continuous intervals. An example of this is a Likert scale, on which opinions or preferences are expressed on a scale with a set number of possible responses. If the scale consists of the positive integers, an observation of 3 might be regarded as representing the interval from 2.50 to 3.50. It is possible to estimate the median of the underlying variable. If, say, 22% of the observations are of value 2 or below and 55.0% are of 3 or below (so 33% have the value 3), then the median m{\displaystyle m} is 3 since the median is the smallest value of x{\displaystyle x} for which F(x){\displaystyle F(x)} is greater than a half. But the interpolated median is somewhere between 2.50 and 3.50. First we add half of the interval width w{\displaystyle w} to the median to get the upper bound of the median interval. Then we subtract that proportion of the interval width which equals the proportion of the 33% which lies above the 50% mark. In other words, we split up the interval width pro rata to the numbers of observations. In this case, the 33% is split into 28% below the median and 5% above it so we subtract 5/33 of the interval width from the upper bound of 3.50 to give an interpolated median of 3.35. More formally, if the values f(x){\displaystyle f(x)} are known, the interpolated median can be calculated from

mint=m+w[12F(m)12f(m)].{\displaystyle m_{\text{int}}=m+w\left[{\frac {1}{2}}-{\frac {F(m)-{\frac {1}{2}}}{f(m)}}\right].}

Alternatively, if in an observed sample there are k{\displaystyle k} scores above the median category, j{\displaystyle j} scores in it and i{\displaystyle i} scores below it then the interpolated median is given by

mint=mw2[kij].{\displaystyle m_{\text{int}}=m-{\frac {w}{2}}\left[{\frac {k-i}{j}}\right].}

For univariate distributions that are symmetric about one median, the HodgesLehmann estimator is a robust and highly efficient estimator of the population median; for non-symmetric distributions, the HodgesLehmann estimator is a robust and highly efficient estimator of the population pseudo-median, which is the median of a symmetrized distribution and which is close to the population median.[38] The HodgesLehmann estimator has been generalized to multivariate distributions.[39]

### Variants of regressionEdit

The TheilSen estimator is a method for robust linear regression based on finding medians of slopes.[40]

The median filter is an important tool of image processing, that can effectively remove any salt and pepper noise from grayscale images.

### Cluster analysisEdit

In cluster analysis, the k-medians clustering algorithm provides a way of defining clusters, in which the criterion of maximising the distance between cluster-means that is used in k-means clustering, is replaced by maximising the distance between cluster-medians.

This is a method of robust regression. The idea dates back to Wald in 1940 who suggested dividing a set of bivariate data into two halves depending on the value of the independent parameter x{\displaystyle x}: a left half with values less than the median and a right half with values greater than the median.[41] He suggested taking the means of the dependent y{\displaystyle y} and independent x{\displaystyle x} variables of the left and the right halves and estimating the slope of the line joining these two points. The line could then be adjusted to fit the majority of the points in the data set.

Nair and Shrivastava in 1942 suggested a similar idea but instead advocated dividing the sample into three equal parts before calculating the means of the subsamples.[42] Brown and Mood in 1951 proposed the idea of using the medians of two subsamples rather the means.[43] Tukey combined these ideas and recommended dividing the sample into three equal size subsamples and estimating the line based on the medians of the subsamples.[44]

Any mean-unbiased estimator minimizes the risk (expected loss) with respect to the squared-error loss function, as observed by Gauss. A median-unbiased estimator minimizes the risk with respect to the absolute-deviation loss function, as observed by Laplace. Other loss functions are used in statistical theory, particularly in robust statistics.

The theory of median-unbiased estimators was revived by George W. Brown in 1947:[45]

An estimate of a one-dimensional parameter θ will be said to be median-unbiased if, for fixed θ, the median of the distribution of the estimate is at the value θ; i.e., the estimate underestimates just as often as it overestimates. This requirement seems for most purposes to accomplish as much as the mean-unbiased requirement and has the additional property that it is invariant under one-to-one transformation.

Further properties of median-unbiased estimators have been reported.[46][47][48][49] Median-unbiased estimators are invariant under one-to-one transformations.

There are methods of constructing median-unbiased estimators that are optimal (in a sense analogous to the minimum-variance property for mean-unbiased estimators). Such constructions exist for probability distributions having monotone likelihood-functions.[50][51] One such procedure is an analogue of the RaoBlackwell procedure for mean-unbiased estimators: The procedure holds for a smaller class of probability distributions than does the RaoBlackwell procedure but for a larger class of loss functions.[52]

Scientific researchers in the ancient near east appear not to have used summary statistics altogether, instead choosing values that offered maximal consistency with a broader theory that integrated a wide variety of phenomena.[53] Within the Mediterranean (and, later, European) scholarly community, statistics like the mean are fundamentally a medieval and early modern development. (The history of the median outside Europe and its predecessors remains relatively unstudied.)

The idea of the median appeared in the 13th century in the Talmud, in order to fairly analyze divergent appraisals.[54][55] However, the concept did not spread to the broader scientific community.

Instead, the closest ancestor of the modern median is the mid-range, invented by Al-Biruni.[56]: 31 [57] Transmission of Al-Biruni's work to later scholars is unclear. Al-Biruni applied his technique to assaying metals, but, after he published his work, most assayers still adopted the most unfavorable value from their results, lest they appear to cheat.[56]: 358 However, increased navigation at sea during the Age of Discovery meant that ship's navigators increasingly had to attempt to determine latitude in unfavorable weather against hostile shores, leading to renewed interest in summary statistics. Whether rediscovered or independently invented, the mid-range is recommended to nautical navigators in Harriot's "Instructions for Raleigh's Voyage to Guiana, 1595".[56]: 458

The idea of the median may have first appeared in Edward Wright's 1599 book Certaine Errors in Navigation on a section about compass navigation. Wright was reluctant to discard measured values, and may have felt that the median incorporating a greater proportion of the dataset than the mid-range was more likely to be correct. However, Wright did not give examples of his technique's use, making it hard to verify that he described the modern notion of median.[53][57][b] The median (in the context of probability) certainly appeared in the correspondence of Christiaan Huygens, but as an example of a statistic that was inappropriate for actuarial practice.[53]

The earliest recommendation of the median dates to 1757, when Roger Joseph Boscovich developed a regression method based on the L1 norm and therefore implicitly on the median.[53][58] In 1774, Laplace made this desire explicit: he suggested the median be used as the standard estimator of the value of a posterior PDF. The specific criterion was to minimize the expected magnitude of the error; |αα|{\displaystyle |\alpha -\alpha ^{*}|} where α{\displaystyle \alpha ^{*}} is the estimate and α{\displaystyle \alpha } is the true value. To this end, Laplace determined the distributions of both the sample mean and the sample median in the early 1800s.[23][59] However, a decade later, Gauss and Legendre developed the least squares method, which minimizes (αα)2{\displaystyle (\alpha -\alpha ^{*})^{2}} to obtain the mean. Within the context of regression, Gauss and Legendre's innovation offers vastly easier computation. Consequently, Laplaces' proposal was generally rejected until the rise of computing devices 150 years later (and is still a relatively uncommon algorithm).[60]

Antoine Augustin Cournot in 1843 was the first[61] to use the term median (valeur médiane) for the value that divides a probability distribution into two equal halves. Gustav Theodor Fechner used the median (Centralwerth) in sociological and psychological phenomena.[62] It had earlier been used only in astronomy and related fields. Gustav Fechner popularized the median into the formal analysis of data, although it had been used previously by Laplace,[62] and the median appeared in a textbook by F. Y. Edgeworth.[63] Francis Galton used the English term median in 1881,[64][65] having earlier used the terms middle-most value in 1869, and the medium in 1880.[66][67]

Statisticians encouraged the use of medians intensely throughout the 19th century for its intuitive clarity and ease of manual computation. However, the notion of median does not lend itself to the theory of higher moments as well as the arithmetic mean does, and is much harder to compute by computer. As a result, the median was steadily supplanted as a notion of generic average by the arithmetic mean during the 20th century.[53][57]

1. ^ The geometric median is unique unless the sample is collinear.[36]
2. ^ Subsequent scholars appear to concur with Eisenhart that Boroughs' 1580 figures, while suggestive of the median, in fact describe an arithmetic mean.;[56]: 623 Boroughs is mentioned in no other work.