AI Glossary / Statistics and probability / Intermediate
Order statistic
Definition
An order statistic is an observation identified by its position after a sample is sorted from smallest to largest. The kth order statistic is the kth smallest observation, counting repeated values separately. The first is the sample minimum and the last is the sample maximum. Order statistics provide the basis for medians, sample quantiles, ranges, and many rank-related statistical procedures.
What it means
The original row number tells us when or where an observation was recorded. Its order-statistic position tells us where its value falls relative to the other values in the sample.
For example, the third recorded response time need not be the third smallest response time. Sorting changes the arrangement, not the measurements. Before sampling, an order statistic is a random quantity; after observing the data, it has a realized numerical value.
How it works
For observations X1 through Xn, write the sorted values as X(1) less than or equal to X(2), continuing through X(n). Parentheses around the index commonly distinguish sorted position from the original observation identifier.
Ties occupy separate positions. If two observations share the minimum, both X(1) and X(2) can have that value. This differs from procedures that assign average ranks to ties; a rank is a position label, while an order statistic is the associated observed value.
For an odd sample size, the sample median is the middle order statistic. For an even size, a common numerical convention averages the two central order statistics, so the resulting median need not itself be an observation. Quantile conventions can interpolate differently between neighboring positions.
Under independent, identically distributed sampling, the distribution of X(k) can be derived by counting observations below a threshold. X(k) is at most x exactly when at least k sample observations are at most x. That count follows a binomial distribution with success probability F(x), where F is the population cumulative distribution function.
The maximum therefore has cumulative probability F(x) raised to n, while the minimum's cumulative probability is 1 minus [1 - F(x)] raised to n. These formulas depend on the sampling assumptions; dependent observations require a different calculation.
Order statistics are generally dependent even when the original observations are independent. Their sorted positions constrain one another. Sample size also matters: a maximum from a larger sample tends to be more extreme even if the underlying distribution is unchanged.
Three practical examples
- Service reporting: use sorted response times to locate a median or a specified empirical quantile.
- Quality assessment: inspect the smallest and largest recorded measurements while considering how many measurements were taken.
- AI evaluation: summarize a distribution of per-example errors with ordered values instead of relying only on their mean.
Think of it this way
Think of lining up parcels by weight. The parcel in the fourth position has the fourth order statistic's weight. Its shipping label still identifies the original parcel, and two equally heavy parcels still occupy two positions in the line.
Worked example
Take the original sample 8, 2, 5, 2, 11, 7. Sorting gives 2, 2, 5, 7, 8, 11. Thus X(1) = 2, X(2) = 2, X(3) = 5, and X(6) = 11.
The sample range is 11 - 2 = 9. Under the usual even-sample convention, the median is [X(3) + X(4)]/2 = (5 + 7)/2 = 6. This median is not one of the observed values.
For a separate probability illustration, draw five independent observations uniformly from zero to one. The probability that the second smallest is at most 0.25 equals the probability that at least two observations fall at or below 0.25.
Using the complement, this is 1 - 0.75^5 - 5 times 0.25 times 0.75^4 = 47/128, approximately 0.3671875.
The calculation concerns a random order statistic across repeated samples. It does not say that the second smallest observed value in any particular sample equals that probability.
Illustrative case study
Fictional case: Cedar Cloud compares the maximum latency reported by two service teams. One team measured 100 requests and the other measured 100,000.
The analyst explains that unequal sample sizes affect the behavior of maxima and inspects comparable quantiles and the underlying sampling periods. The teams preserve request identifiers when sorting so extreme observations can be investigated. They avoid attributing the larger observed maximum solely to a worse service without considering exposure and uncertainty.
Common misconceptions and mistakes
An order statistic is a measured value, not its rank number. Nor is it necessarily the observation originally collected in that position.
Do not remove duplicates before calculating order statistics unless the target explicitly concerns distinct values. Removing repeats changes the empirical distribution and can change medians and quantiles.
Sample order statistics are not population quantiles known without uncertainty. Software may also use different interpolation conventions for percentile estimates, especially in small samples.
Finally, a very large sample maximum is not automatically an error or an outlier requiring deletion. Its interpretation depends on the distribution, sample size, measurement process, and intended analysis.
Business use
Businesses use order statistics to report typical and extreme outcomes, set empirical thresholds, and understand service variability. Record the sample size and quantile convention alongside the reported number. For operational comparisons, align sampling windows and eligibility rules. Keep the original record links so ordered summaries can lead back to specific incidents and measurement checks.
People also ask
Can two order statistics be equal?
Yes, when the sample contains ties.
Is the median always an order statistic?
For odd numerical sample sizes it is the central one; for even sizes a common convention averages two.
Are sorted observations independent?
Generally not, even when the original sample observations were independent.
Check your understanding
Why are the first two order statistics both 2 in the example?
Answer: The sample contains two separate observations with that value.
Why does a binomial count appear in the probability calculation?
Answer: Each independent observation either falls at or below the threshold or does not.
Related terms
- Rank
- Median
- Empirical distribution
- Range
- sample quantile
- sample minimum
- sample maximum
- extreme-value statistics
Learn next
compute several sample percentiles under two interpolation conventions, then distinguish those estimates from the population quantiles they target.
More in Statistics and probability
- Optimal experimental design - Optimal experimental design is the planning of measurements, treatment assignments, or experimental settings to optimize a defined measure of information or...
- Order effect - An order effect is a change in responses or performance attributable to the sequence in which conditions, tasks, questions, or treatments are presented.
- Order of integration - The order of integration describes how many ordinary differences are needed to remove a time series' stochastic trend and obtain an integrated-of-order-zero...
- Ordinal interaction - An ordinal interaction is an interaction in which a specified group difference changes in magnitude across levels of another variable without reversing...
- Ordinal scale - An ordinal scale classifies observations into categories with a meaningful order, without establishing equal distances between adjacent categories.
- Orthogonal array - An orthogonal array is a structured table of experimental or test settings with a specified balance property.
Sources
Sources: Karl Gregory, University of South Carolina, Order statistics: https://people.stat.sc.edu/gregorkb/STAT_712_fa_2022/STAT_712_Lec_13_slides.pdf . NIST/SEMATECH, Percentiles: https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm . Primary mathematical and institutional sources were opened. The AIMA glossary seed was not separately retrieved. Examples and exact probability calculation are original.
Previous: Order selection criteria Next: Ordered key - value store