Asymptotic distribution of a sample median Created 2026-09-24 Updated 2026-11-05
Let be independent and identically distributed random variables with unique median , and let their probability distribution have continuous probability density function with . For odd , the sample median satisfiesThe influence function of the sample median has mean zero and variance : each of its two nonzero values occurs with probability . Its asymptotic linear representation, followed by the central limit theorem, gives the displayed limit.
For a standard normal distribution, , so the asymptotic variance of the unscaled sample median is . The sample mean instead has variance in that model. This quantifies an efficiency cost at the reference model without contradicting the sample median's bounded response to an outlier.
Bootstrapping (statistics) Created 2026-09-24 Updated 2026-10-18
The bootstrap approximates a sampling distribution by repeatedly sampling with replacement from the empirical measure of the observed data. In the ordinary nonparametric version, observations are assumed independent and identically distributed; a bootstrap sample has the same size as the original statistical sample. A statistic, such as a sample mean or sample median, is recomputed on each resample. Its variation across resamples estimates how the original statistic would vary across repeated sampling from the unknown probability distribution.[ref]
Lecture 12: The Bootstrap. UW STAT 535: Statistical Machine Learning, Autumn 2026; The Bootstrap, resampling procedure; High level idea of how bootstrap works, conditional empirical sampling law
The key distinction is between the observed statistical sample and its still-unknown source probability distribution. Condition on the observed values and form the empirical measureHere is a Dirac measure. Draw independent indices from the uniform distribution on a finite set and set . Each observed slot has probability on every draw. If equal values occupy several slots, their total probability is the sum of those slot probabilities; distinct observed values need not be equally likely. A star denotes this conditional resampling experiment. There are equally likely ordered index sequences, although bootstrap count vectors and statistics can combine many such sequences.
Sampling with replacement reuses observed slots while keeping the original data fixed
. Original schematic for observations . Three possible ordered bootstrap samples have different sample means. Their colors identify source slots; none of these samples is new evidence about the unknown probability distribution. Details.A complicated sampling distribution need not stop statistical inference when recomputing the statistic is easy. The bootstrap reuses that calculation on simulated datasets. The plug-in estimator principle replaces the unknown probability measure by in the whole repeated-sampling experiment. Whether that substitution approximates the target sampling distribution needs an appropriate bootstrap consistency theorem for the sample mean or a result for the particular statistic. A larger number of resamples reduces Monte Carlo error; it cannot repair the bootstrap failure for a uniform endpoint, an unrepresentative statistical sample or ignored statistical dependence.[ref]
Lecture 12: The Bootstrap. UW STAT 535: Statistical Machine Learning, Autumn 2026; High level idea of how bootstrap works; Bootstrap and Statistical Functionals, conditional variance and bootstrap variance consistency; Failure of the bootstrap, uniform-endpoint counterexample
Breakdown point Created 2026-09-24 Updated 2026-11-05
A breakdown point measures how much contamination can make an estimator fail without bound. It specifies a contamination mechanism and a notion of failure. For scalar location under replacement contamination, failure means that replacing some observations can move the estimated location arbitrarily far.
The sample mean of observations can be made arbitrarily large by changing just one observation. For an odd sample of size , the sample median stays between original data values after at most replacements, but replacements can send it to infinity.
Two finite-sample conventions record either the first fraction allowing unbounded error or the largest fraction still guaranteed bounded. For the sample mean they are and ; for that odd-sample sample median they are and . The replacement breakdown point must state which convention is used. Both describe a finite change, whereas an influence function describes an infinitesimal perturbation.
Coordinatewise median Created 2026-09-28 Updated 2026-11-05
The coordinatewise median of vectors applies the univariate sample median separately to each coordinate. It is easy to compute but depends on the chosen coordinate axes.
Finite-sample maximum bias 2026-10-14
Here counts the observations replaced. This curve measures the largest change after at most arbitrary replacements. Under the first-unbounded convention, the replacement breakdown point is . The largest fraction still guaranteed bounded is one grid step smaller; those conventions must not be confused. A sample mean breaks after one replacement, while a scalar sample median with a fixed ordinary tie convention needs about half the sample replaced.
Uniform convergence in probability of empirical criteria on a compact set proves consistency for minimizers in that set; it does not confine a minimizer over a larger domain. A bounded identifiable regression function can approach its true value again at infinity. For median regression, has unique zero at zero, but a small positive fitted sample median has a second solution . This solution diverges as , although uniform convergence on any fixed compact interval holds. Constraining the estimator, or proving suitable global separation and localization, repairs the argument.
Huber location estimator Created 2026-09-24 Updated 2026-10-18
More generally, fix a known scale and a dimensionless threshold before fitting. For observations , a Huber location estimator is a minimizer of the summed Huber loss, equivalently a root of its estimating equation:Here is the Huber loss and the Huber score. The physical clipping distance is , in the observations' units; the initial formula uses . A large observation keeps contributing a bounded signed score rather than being discarded. The original clipped location criterion appears in Peter J. Huber's 1964 paper.[ref]
Robust Estimation of a Location Parameter by Peter J. Huber. §4(iii), printed p. 79: quadratic-central, linear-tail criterion and clipping around the fitted location
For the original data , take and . At , the standardized differences and their Huber scores areTheir sum is zero, so the Huber location estimator is . Four scores remain in the central linear region, making the root unique. By comparison, the sample mean is , and the sample median, using the midpoint of the two middle observations, is . Agreement with the sample median is a feature of these data, rather than an identity between the two estimators.
The geometry explains both existence and possible nonuniqueness. The Huber loss is a convex function, so is a convex function of and its derivative is . For , tends to infinity as grows, hence attains a minimum; its zero derivative characterizes every minimizer. Between clipping transitions, the summed score has slope , where is the number of observations strictly within of . A root with is unique. If , a flat interval is possible: for data with , every is a minimizer. A complete single-valued estimator then needs a selection rule, such as the interval's midpoint.
A bounded Huber score limits one observation's contribution to the estimating equation. The influence function of a Huber location estimator additionally divides by the population's central mass, so the size of its bound depends on the reference probability distribution. Clipping does not by itself make the bias of an estimator zero or prove a universal breakdown point; the separate local influence versus replacement breakdown argument specifies what fixed scale permits. Estimating from the same data changes the procedure and requires separate analysis.
Huber location response to one outlier 2026-10-18
Hold fixed and move only the sixth observation . For , the sample mean is , the sample median is , and the Huber location estimator with fixed stays at . Once , its Huber score is already ; moving it farther changes the Huber loss but leaves the root unchanged.
For a closer view of the transition, the exact Huber location estimator over isTo verify the first branch, when the score of is saturated and the other five scores sum with it to . When , the score of is saturated instead, giving the same expression. At , the moving observation saturates too, and the equation becomes . The piecewise formula is continuous at the transition.
The rising sample mean comes from an unbounded linear score, the flat distant-outlier response from a bounded Huber score. This is a finite-data response curve with a specified scale and threshold, rather than a population influence function or a general claim about arbitrary numbers of outliers.
Known-rate Laplace location confidence interval Created 2026-10-25 Updated 2026-11-05
For an independent and identically distributed Laplace distribution sample with density and known rate , the sample mean has mean and variance . The central limit theorem gives the displayed asymptotic confidence interval for at confidence level . The sample mean need not be a maximum-likelihood estimator for this construction to be valid. The Laplace location and scale maximum likelihood location is a sample median; that is a different choice of statistic.
Laplace location and scale maximum likelihood Created 2026-10-18 Updated 2026-10-25
Suppose , , are independent and identically distributed with Laplace distribution , where . For realized values , the likelihood function and log-likelihood function areFor fixed , maximum likelihood estimation of the location therefore minimizes the sum of absolute losses. This connects the Laplace distribution to robust statistics: each observation contributes a cost growing linearly with its distance, whereas squared-error loss grows quadratically.
Why does a sample median minimize ? Between successive order statistics, moving a little to the right increases each distance to a value on the left and decreases each distance to a value on the right. Hence the slope is the number on the left minus the number on the right. It changes from negative to positive at the middle. More precisely, if , all minimizing locations areFor an even sample size, the objective is flat throughout the interval between the two central order statistics. The midpoint convention for the sample median selects one solution; it does not prove uniqueness. [ref]
Laplace (Double Exponential, Bilateral Exponential) Distribution. SciPy 1.18.0 documentation; SciPy reference guide, Laplace distribution, ML location estimator and the even-N interval between the two central order statistics
This is the finite-sample counterpart of median minimizes expected absolute loss.If , maximizing over givesThe derivative is positive below this value and negative above it. Moreover the maximized likelihood function is proportional to wherever , so the same minimizing locations give the joint maximum-likelihood estimates. [ref]
1.3.6.6.12. Double Exponential Distribution. NIST and SEMATECH e-Handbook of Statistical Methods; NIST/SEMATECH e-Handbook, Section 1.3.6.6.12, Parameter Estimation; median and average absolute deviation formulas
The scale estimate divides by ; this formula is not an assertion that it is an unbiased estimator.The boundary case matters: if all observations equal , choose . Then and as . There is no finite joint maximum-likelihood estimate in the parameter space . In particular, this always occurs for . Writing does not produce an admissible Laplace distribution.
Laplace median robustness example 2026-10-18
Choose the five numbers as an original illustration. Their sample median is 2 and their sample mean is 4. The sum of absolute losses at the sample median isIf these numbers were modeled as an independent and identically distributed Laplace distribution sample, the joint maximum-likelihood estimates would therefore be and . Using the sample mean instead gives , so it does not maximize this likelihood function.
Now replace only 10 by 100. The sample median stays at 2, while the sample mean becomes . The minimized sum of absolute losses rises to , and the fitted scale rises to . Stability of the fitted location therefore does not mean stability of every fitted parameter.
The left panel subtracts each objective's minimum so the two absolute loss curves can be compared despite the different totals. The right panel tracks the sample mean and sample median as the largest chosen value changes. This is an outlier sensitivity illustration, not actual observations or a check that a Laplace distribution fits any population. In applications, regression residuals and the data-generating assumptions need separate examination; a stable sample median alone does not validate a statistical model.
Laplace regression Created 2026-09-24 Updated 2026-10-18
For linear regression with fixed predictor vectors , assume conditionally independent responses with a common scale :Each conditional median and mean is . The log-likelihood function is , so maximum likelihood estimation minimizes the sum of absolute regression residuals:This is least absolute deviations. With only an intercept, it reduces to the Laplace location and scale maximum likelihood problem, so a sample median is a fitted intercept. Provided the minimum , the scale estimate is ; the conditional standard deviation is . If the scale is denoted instead of , the conditional standard deviation is .
Minimizing a sum of absolute losses does not automatically give a unique coefficient vector. Even an intercept-only fit to an even sample size can have an interval of solutions, and redundant predictor columns can introduce further nonuniqueness. If a fit makes every regression residual zero, the joint likelihood function is unbounded as , so there is no finite joint maximum-likelihood estimate with positive scale.
The linear growth of absolute loss limits sensitivity to an extreme response at fixed predictors compared with squared-error loss. It does not protect against every outlier: an extreme predictor can have large regression leverage. The numerical example above changes a response in an intercept-only problem, and makes no general claim of immunity to such predictor changes.
Local influence versus replacement breakdown 2026-10-14
The influence function describes an infinitesimal change at a specified reference probability distribution. The replacement breakdown point asks how many observations in a particular finite sample can be replaced before an estimator becomes unbounded. The finite-sample maximum bias records the intervening changes. These are different questions: a bounded influence function at one baseline is not a general bound over all epsilon-contamination neighborhoods, nor a proof of a positive replacement breakdown point.[ref]
The Influence Curve and Its Role in Robust Estimation by Frank R. Hampel. Frank R. Hampel, The Influence Curve and Its Role in Robust Estimation, §4, p. 386: exact asymptotic curve supplemented by behavior at other distributions, especially empirical ones
The mean illustrates agreement between local and global fragility: its gross-error sensitivity is infinite and one replacement can send the sample mean arbitrarily far. The median has finite gross-error sensitivity under the stated positive-density assumptions, while its sample median withstands fewer than about half the observations being replaced under ordinary tie conventions. Its population contamination bias above still diverges as when the atom remains beyond the shifted median. Here must also move outward; taking that limit with a fixed finite atom would invalidate the displayed quantile formula.
For scalar location with a fixed positive scale, the Huber score has a direct global argument: if strictly more than half of the sample stays fixed, then beyond every retained observation by more than , their saturated scores outweigh all possible replaced scores. Every root therefore stays in a bounded interval. This is a separate finite-replacement argument; estimating scale changes its premises. A smooth bounded influence function is valuable local protection, but global robustness also depends on the full estimating rule, scale choice, and root selection.
Location estimator 2026-11-05
A location estimator estimates the common shift in a location family, for example observations with a fixed error probability distribution. A translation-equivariant estimator obeysChanging the origin of measurement then shifts the estimate by the same amount. Both the sample mean and sample median have this property, but their sensitivity to an outlier differs.
For observations , both estimates equal . Replacing by changes the sample mean to while leaving the sample median at . This illustrates resistance to an extreme observation, not a claim that the sample median is optimal under every probability distribution. A location parameter need not be a population mean: a Cauchy distribution has a location parameter although its expected value does not exist.
Median Created 2026-09-24 Updated 2026-11-05
A median of a real random variable is a number with at least half the probability at or below it and at least half at or above it:Equivalently, its cumulative distribution function satisfies . The non-strict inequalities matter for atoms: if almost surely, zero is its median despite having no probability strictly below or strictly above it.
A median need not be unique. If zero and one each have probability , every point in is a median. The generalized inverse selects the lower median. For a continuous strictly increasing cumulative distribution function, the unique median solves .
For a finite data set, the sample median measures the middle rather than the arithmetic average. The sample has median three and mean 22; changing 100 to a still larger value leaves its median unchanged. With finite first absolute moment, medians are exactly the minimizers of expected absolute loss, giving a decision-theoretic reason for their usefulness.
Median-of-means estimator Created 2026-09-24 Updated 2026-11-05
A median-of-means estimator divides a sample into disjoint groups, computes the sample mean in each group, and returns a sample median of those group means. A single extreme observation changes only one group mean, so it need not dominate the final answer.
Here is a finite-variance guarantee. Let the observations be independent and identically distributed random variables with mean and variance . Take odd , groups of equal size , and discard any unused observations. By Chebyshev inequality, each group mean differs from by more than with probability at most .
The groups are independent. If their sample median exceeds this error, at least half of the groups must be bad. Applying Hoeffding inequality to their bad-group indicators givesThus an odd gives confidence at least , provided there are enough observations. If , then , giving error at most . This is a sub-Gaussian deviation bound under finite variance; it does not assert that the observations are sub-Gaussian random variables. The block argument above derives the bound from the two stated inequalities. Choosing too many groups makes the individual means noisy.
M-estimator Created 2026-09-28 Updated 2026-11-05
An M-estimator chooses a parameter by minimizing an empirical objective:Here is a loss function. For scalar location, squared-error loss gives the sample mean, absolute-error loss gives a sample median, and Huber loss gives a Huber location estimator.
At an interior minimum of a differentiable objective, the estimating equation is , where . A root need not be a global minimizer for a nonconvex objective: zero is a stationary point of , but the minima are at . For a differentiable convex function, a zero derivative is sufficient for global minimality.
Thus the loss-minimization and estimating-equation formulations require an explicit relation between their solutions. The sandwich variance of an M-estimator describes regular estimating-equation roots; choosing a robust loss does not itself establish the regularity or uniqueness needed for that calculation. Peter J. Huber's original location criterion is a central historical example.[ref]
Robust Estimation of a Location Parameter by Peter J. Huber. Section 4(iii), clipped location criterion
Order statistic Created 2026-09-24 Updated 2026-10-14
An order statistic is a value selected by its position in a sorted statistical sample. For real observations , writeThe th order statistic is the th smallest value, counting repeated values separately. The parentheses distinguish sorted position from the original observation label: and need not be equal. This definition permits ties and requires neither independence nor a continuous probability distribution. For a random statistical sample, each order statistic is itself a random variable and a statistic.
For example, the five fixed observationssort toTheir original indices in sorted order are , so . Their ranks of observations, listed in original observation order, are . Here is the minimum, is the sample maximum, and is the sample median. These are deliberately chosen observations, rather than simulated draws.
Order statistics put extremes and typical values in one language: the first and last locate the minimum and sample maximum, while intermediate positions give sample quantiles and the sample median. Under the existing generalized-inverse convention, the sample quantile at level is . For the five observations, the sample quantiles at are . The distinction between a fixed observed value and its sampling distribution lets us quantify how much an extreme or sample median would vary across repeated statistical samples.
The useful counting identity isFor independent and identically distributed random variables with a continuous cumulative distribution function , the count on the right has binomial distribution with parameters , givingThis cumulative distribution function is a binomial distribution tail: a question about sorting becomes a question about counting successes in Bernoulli trials. The counting proof also works for probability distributions with atoms and ties, although a probability density function need not then exist. For a uniform order statistic, on , which makes the formula particularly explicit.
The printed group means suggest about 13.49 more tweets in the liberal group, but the reported significance cannot be accepted as one coherent test result. The printed would reject equal means at 5%; the printed with 23.92 statistical degrees of freedom instead gives a two-sided p-value about 0.06380 and would not reject at 5%. The confidence-interval fields are also inconsistent.
There are 14 conservative-coded and 12 liberal-coded observations. The tweet summary has sample median 258.5, quartiles 204.5 and 323.2, and range 108 to 441, so the interquartile range is about 118.7 tweets. No measurement period is specified, so these should not be reinterpreted as tweets per day. The displayed overall sample mean is 261.5, subject to a further consistency issue below. These are small groups; the summary alone cannot establish normality, lack of outliers or an appropriate sampling design.
Let and be the two population means for the defined tweet measure. The null hypothesis is , against the two-sided test alternative . Welch's t-test usesallowing unequal group variances. It requires independent observations and a suitable approximation to the sampling distribution of the mean difference; a large-sample justification cannot simply be assumed with group sizes 14 and 12. Its noninteger statistical degrees of freedom comes from the Welch approximation, not a fractional number of respondents.[ref]
Student's t-Test in the R documentation. Arguments and Details: two-sided alternative and unequal-variance Welch calculation
The two displayed sample means implyThe negative sign means the liberal-coded group has the larger observed mean. This is a difference in group averages, not a statement about every individual and not evidence that political orientation causes tweeting behaviour. Practical importance concerns this difference and its context; statistical significance does not itself measure its importance.
A p-value is calculated under the null hypothesis and the assumed sampling model. It is the probability of a result at least as incompatible with that hypothesis as the observed one, not the probability that the hypothesis is true or that this conclusion is mistaken. A prespecified significance level controls the long-run Type I error rate of rejecting a true null; a Type II error is nonrejection of a false null, and statistical power concerns rejection under a specified alternative. Neither a small p-value nor a nonrejection settles the effect size or a causal explanation.
Taken on its own, the printed p-value supports a nominal 5% rejection, but not a 1% rejection. Taken instead from the printed t statistic and statistical degrees of freedom, the two-sided tail is about 0.06380. These different 5% decisions cannot be reconciled by ordinary rounding. Conditional on trusting the group means, t and degrees of freedom, the implied standard error is and the corresponding 95% confidence interval isIt includes zero, consistently with that larger p-value. This calculation is a conditional consistency check, not recovery of the true raw-data interval.
The source lists its interval endpoints as 0.04582 and , in that order. They are not ordered, and merely sorting them would still give midpoint about , rather than the estimated difference . The symmetric confidence-interval consistency identities therefore fail for the usual t interval. A frequentist 95% interval describes repeated-sample coverage of its procedure, not a 95% posterior probability for a fixed parameter; neither interpretation justifies silently repairing these endpoints.
The group summaries also imply pooled mean , which cannot round to the printed 261.5. The pooled-mean compatibility under rounding identifies this additional mismatch for summaries of the same complete sample. Thus the observed direction is conditionally liberal-greater-than-conservative, but the inferential decision and interval require corrected coherent output. Nonrejection under the t/df reading would not establish equal population means. Random assignment, representativeness and possible confounding are not supplied by this test.
Conditional on the printed two-group test output, the male-coded group has higher mean efficacy by about 1.034 scale points, with a 95% confidence interval of about 0.785 to 1.282 points. This is strong evidence against equal population means under the test's assumptions. It does not establish a causal effect, and the accompanying overall mean is inconsistent with the group summaries.
Here the coding identifies group 0 as male and group 1 as female in this dataset. The counts are 1215 and 1251, respectively, or approximately 49.27% and 50.73% of 2466 observations. These are sample compositions, not evidence that the sample represents every population of interest. The continuous efficacy scale runs from 0 to 16, with higher scores indicating stronger efficacy. Its printed sample median is 10 and its quartiles are 8 and 12, so its interquartile range is 4 points. The printed overall sample mean, 9.348, requires the separate consistency qualification below.
Let and denote the two population means. The null hypothesis is , and the alternative hypothesis is the two-sided test . The two sample means giveThe positive sign means higher mean efficacy in group 0, given this coding; it does not say that every member of that group has higher efficacy than every member of group 1.
Welch's t-test estimates uncertainty from the two groups separately rather than assuming equal population variances:The printed implies a standard error of approximately points. The noninteger 2277.4 statistical degrees of freedom comes from the Welch approximation; it is not a count of fractional observations. Using the corresponding Student t-distribution gives the displayed p-value, approximately . The test and interval calculations agree to the precision of the printed numbers.[ref]
Student's t-Test in the R documentation. Arguments and Details: two-sided default and unequal-variance Welch calculation; Value: estimates, statistic, degrees of freedom and interval
A p-value is the probability, under the null hypothesis and the assumed sampling model, of a test result at least as incompatible with equal means as the observed result. It is not the probability that the null hypothesis is true, the probability that the finding is a chance mistake, or the size of the mean difference. At a prespecified significance level such as , this result rejects the equal-mean null hypothesis; it also rejects at 1%. A Type I error is rejection when that hypothesis is true, and a valid level- procedure controls its long-run probability. A Type II error is failure to reject a false hypothesis; statistical power is the probability of rejection under a specified alternative. Neither error probability for this one realized claim is supplied by its p-value.
The 95% confidence interval comes from , with critical value about 1.961. Its positive endpoints support the same direction and exclude zero. The frequentist 95% statement concerns coverage over repeated samples, not a 95% posterior probability assigned to this fixed interval. Reporting the difference in scale points supplies an effect size; its practical importance also depends on what a point means substantively. A very small p-value alone does not answer that question.
The inferential calculation requires independent observations and an appropriate sampling model. With these large groups, approximately normal sampling distributions of the means can be more plausible than normality of individual bounded scores, but a large sample size does not correct dependence, clustering, selection bias or measurement problems. The output does not establish random assignment or remove possible confounding, so the estimated difference is an association.
There is a material source inconsistency. For exhaustive groups with complete outcome data, the sample mean must be the sample-size-weighted mean of the group means:which cannot round to 9.348. Figure 7 independently reports all 2466 efficacy values present and again gives 9.348; Question 6 refers back to the same continuous scale. The pooled-mean compatibility under rounding rules out explaining the discrepancy by the displayed decimal precision. Thus the two-group test supports the stated conclusion if its own group summaries and test fields are trusted, while the overall mean cannot simultaneously be accepted as a coherent summary of those groups. No unprinted exclusion or uniquely correct replacement mean is established.



