Rayleigh radial thresholds and quantiles (source code)

= Rayleigh radial thresholds and quantiles
{c}
{title2=$\mathbb P(R>r)=e^{-r^2/(2\sigma^2)}$}

For $r\geq0$, integration gives the <survival function> and <cumulative distribution function>
$$
\mathbb P(R>r)=e^{-r^2/(2\sigma^2)},\qquad
F_R(r)=1-e^{-r^2/(2\sigma^2)}.
$$
Solving $F_R(r_p)=p$ gives the <quantile function>
$$
\boxed{r_p=\sigma\sqrt{-2\log(1-p)},\qquad0<p<1.}
$$
<Random: Probability, Mathematical Statistics, Stochastic Processes by Kyle Siegrist/The Rayleigh Distribution>[Random: Probability, Mathematical Statistics, Stochastic Processes by Kyle Siegrist; The General Rayleigh Distribution, Distribution Functions: CDF, quantile and survival functions]{ref}

For the chosen positioning model $\sigma=2\,\mathrm{cm}$,
$$
\mathbb P(R\leq2\,\mathrm{cm})=1-e^{-1/2}\simeq0.3935,\qquad
\mathbb P(R\leq4\,\mathrm{cm})=1-e^{-2}\simeq0.8647.
$$
The <disk> of <radius> one component <standard deviation> therefore contains about 39.35% of outcomes; the familiar one-dimensional normal interval percentage does not apply to a two-dimensional <disk>. The 95% and 99% radial thresholds are
$$
\boxed{r_{0.95}\simeq4.8955\,\mathrm{cm},\qquad r_{0.99}\simeq6.0697\,\mathrm{cm}.}
$$
A <circle> defined by $R=r_p$ itself still has <probability> zero; its enclosed <disk> carries the stated <probability>.

\Image[/rayleigh-radius-coverage-and-thresholds.png]
{title=Radial coverage uses <disks> rather than one-dimensional normal intervals}
{description=Original chosen model: each independent centered coordinate has <standard deviation> $2\,\mathrm{cm}$. Concentric <disks> have radii $2\,\mathrm{cm}$, $4\,\mathrm{cm}$ and the calculated 95% threshold $4.8955\,\mathrm{cm}$. The curve gives exact model coverage, not empirical counts.}

The closed-form <quantile function> also gives <inverse transform sampling>: if $U$ has <uniform distribution> on $(0,1)$, then $\sigma\sqrt{-2\log U}$ has <Rayleigh distribution>. Using $1-U$ instead gives the same law. Endpoints are excluded so that the <logarithm> stays finite.