Location estimator
= Location estimator
{title2=$\widehat\theta$}
A <location estimator> estimates the common shift in a <location family>, for example observations $X_i=\theta+\varepsilon_i$ with a fixed error <probability distribution>. A <translation-equivariant estimator> obeys
$$
T(x_1+a,\ldots,x_n+a)=T(x_1,\ldots,x_n)+a.
$$
Changing 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 $0,1,2$, both estimates equal $1$. Replacing $2$ by $100$ changes the <sample mean> to $101/3$ while leaving the <sample median> at $1$. 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.