Median of the half-Cauchy distribution

The probability density function $f(x)$ of a Cauchy distributed random variable $x$ is given by:

$$f(x; x_0,\gamma) = { 1 \over \pi \gamma } \left[ { \gamma^2 \over (x - x_0)^2 + \gamma^2 } \right]$$

The mean and variance of $x$ are undefined however its median is defined as $x_0$. A half-Cauchy distributed random variable $y$ is given by the absolute value of a Cauchy distributed random variable with $x_0 = 0$. Its probability density function is given by:

$$f(y;\gamma) = { 2 \over \pi \gamma } \left[ { \gamma^2 \over y^2 + \gamma^2 } \right] \quad \text{for }y \geq 0$$

The mean and variance of $y$ are undefined however my question is whether the median of $y$ is defined and if so what is the median given by?

• Medians are always defined. The median of a half-Cauchy must coincide with the upper quartile of the Cauchy, which you can readily compute.
– whuber
Commented Sep 25, 2017 at 14:40
• The upper quartile is $x_0 + \gamma$ so the median of the half-Cauchy is $\gamma$.
– egg
Commented Sep 25, 2017 at 15:04
• Even if it wasn't obvious from the relationship with the Cauchy, the cdf and inverse cdf are not particularly difficult to calculate Commented Sep 26, 2017 at 1:28

From any symmetric distribution, you can define a half-distribution simply by doubling the part of the distribution above the symmetry point (and eliminating the part below the symmetry point). Then it is clear that the upper quartile of original distribution will be the median of the half-distribution.

For the standard Cauchy this gives (using R, you can do it symbolically using the formula for the cdf):

 qcauchy(0.75)
[1] 1


Or the Cauchy with symmetry point 10 and scale parameter 2:

 qcauchy(0.75, 10, 2)
[1] 12