$$\begin{aligned}
\operatorname{med}(\mathcal{X},w) &:=
\min \left\{\mu\in\mathbb{R}~\left|~
\sum\nolimits_{x\in\mathcal{X},x\le\mu}w(x)\ge\tfrac12\right.\right\} \;.
\label{medw-lhalf}\end{aligned}$$

Let $\mathcal{X}$, $w$ be as in Definition \[def-medw-lhalf\]. The median of the weighted set $\mathcal{X}$ is $$\begin{aligned}
\operatorname{med}(\mathcal{X},w) &:= \phantom{{}\cap{}}
\left\{\mu\in\mathbb{R}~\left|~
\sum\nolimits_{x\in\mathcal{X},x\le\mu}w(x)\ge\tfrac12\right.\right\} 
\notag\\*&\phantom{{}:={}}
{{}\cap{}}
\left\{\mu\in\mathbb{R}~\left|~
\sum\nolimits_{x\in\mathcal{X},x\ge\mu}w(x)\ge\tfrac12\right.\right\} \;.
\label{medw-shalf}\end{aligned}$$

**Weighted half-line depth.**

The half-line depth definition of the median can be translated as follows.

Let $\mathcal{X}$, $w$ be as in Definition \[def-medw-lhalf\]. The median of the weighted set $\mathcal{X}$ is $$\begin{aligned}
\operatorname{med}(\mathcal{X},w) &:= 
\mathop{\operatorname{argmax}}\limits_{\mu\in\mathbb{R}}
\min\left\{
\sum\nolimits_{x\in\mathcal{X},x\le\mu}w(x),
\sum\nolimits_{x\in\mathcal{X},x\ge\mu}w(x)
\right\} \;.
\label{medw-hs}\end{aligned}$$ For $\mu\in\mathbb{R}$, we call $\min\left\{
\sum\nolimits_{x\in\mathcal{X},x\le\mu}w(x),
\sum\nolimits_{x\in\mathcal{X},x\ge\mu}w(x)
\right\}$ *half-line depth* of $\mu$ w.r.t. $(\mathcal{X},w)$.

Adapting the extrema-stripping procedure to weighted medians is possible with proper bookkeeping of the weighted half-line depth of points during the deletion process; in each step, one deletes the extremum point (minimum or maximum) with lesser half-line depth, or both simultaneously if their half-line depths are equal.

**Minimisation property.**

The minimisation definition , too, can easily be adapted to weighted data.

Let $\mathcal{X}$, $w$ be as in Definition \[def-medw-lhalf\]. The median of the weighted set $\mathcal{X}$ is $$\begin{aligned}
\operatorname{med}(\mathcal{X},w)&:=
\mathop{\operatorname{argmin}}\limits_{\mu\in\mathbb{R}} 
E_{\mathcal{X},w}(\mu)\;, &
E_{\mathcal{X},w}(\mu)&:=
\sum\limits_{x\in\mathcal{X}}
w(x)\lvert \mu-x\rvert
\;.
\label{medw-E}\end{aligned}$$

Median of Continuous Data {#ssec-medd}
-------------------------

The various definitions of the median for weighted sets can easily be generalised to continuous 