# Moyal distribution ## Moyal PDF $$ M(x) = \frac{1}{\sqrt{2 \pi}} e^{-\frac{1}{2} \left[ x + e^{-x} \right]} $$ \vspace{10pt} $$ \text{More generally:} \hspace{15pt} \begin{cases} \text{location parameter:} \quad &\mu_M \\ \text{scale parameter:} \quad &\sigma_M \end{cases} $$ \vspace{10pt} $$ x \rightarrow \frac{x - \mu}{\sigma_M} \thus M_{\mu \sigma_M}(x) = \frac{1}{\sqrt{2 \pi} \sigma_M} e^{-\frac{1}{2} \left[ \frac{x - \mu}{\sigma_M} + e^{- \frac{x - \mu}{\sigma_M}} \right]} $$ ## Moyal CDF The cumulative distribution function $F_M(x)$ can be derived from the pdf $M(x)$ integrating: $$ F_M(x) = \frac{1}{\sqrt{2 \pi}} \int\limits_{- \infty}^x dy \, M(y) = \frac{1}{\sqrt{2 \pi}} \int\limits_{- \infty}^x dy \, e^{- \frac{y}{2}} e^{- \frac{1}{2} e^{-y}} $$ ## Moyal CDF with the change of variable: $$ z = \frac{1}{\sqrt{2}} e^{-\frac{y}{2}} $$ the CDF can be rewritten as: $$ F_M(x) = \frac{-2 \sqrt{2}}{\sqrt{2 \pi}} \int\limits_{+ \infty}^{f(x)} dz \, e^{- z^2} \with f(x) = \frac{e^{- \frac{x}{2}}}{\sqrt{2}} $$ ## Moyal CDF given the definition of the error function `erf`: $$ \text{erf} = \frac{2}{\sqrt{\pi}} \int_0^x dy \, e^{-y^2} $$ one finally gets: $$ F_M(x) = 1 - \text{erf} \left( \frac{e^{- \frac{x}{2}}}{\sqrt{2}} \right) $$ ## Moyal QDF The quantile is defined as the inverse of the CDF: $$ F_M(x) = 1 - \text{erf} \left( \frac{e^{- \frac{x}{2}}}{\sqrt{2}} \right) $$ hence: $$ Q(x) = -2 \ln \left[ \sqrt{2} \, \text{erf}^{(-1)} (1 - F_M(x)) \right] $$ ## Moyal median The median is defined as the point at which $F_M(x) = 1/2$: \vspace{15pt} $$ M(x) \thus m_M = -2 \ln \left[ \sqrt{2} \, \text{erf}^{(-1)} \left( \frac{1}{2} \right) \right] $$ \vspace{15pt} $$ M_{\mu \sigma_M}(x) \thus m_M = \mu -2 \sigma_M \ln \left[ \sqrt{2} \, \text{erf}^{(-1)} \left( \frac{1}{2} \right) \right] $$ ## Moyal mode Peak of the PDF \vspace{10pt} $$ \partial_x M(x) = \partial_x \left( \frac{1}{\sqrt{2 \pi}} e^{-\frac{1}{2} \left( x + e^{-x} \right)} \right) = \frac{1}{\sqrt{2 \pi}} e^{-\frac{1}{2} \left( x + e^{-x} \right)} \left( -\frac{1}{2} \right) \left( 1 - e^{-x} \right) $$ \vspace{10pt} $$ \partial_x M(x) = 0 \thus \mu_M = 0 $$ \vspace{10pt} $$ \partial_x M_{\mu \sigma_M}(x) = 0 \thus \mu_M = \mu $$ ## Moyal FWHM We need to compute the maximum value: $$ M(\mu) = \frac{1}{\sqrt{2 \pi e}} \thus M(x_{\pm}) = \frac{1}{\sqrt{8 \pi e}} $$ which leads to: $$ x_{\pm} + e^{-x_{\pm}} = 1 + 2 \ln(2) \thus \begin{cases} x_+ = a + W_0 \left( - \frac{1}{4 e} \right) \\ x_- = a + W_{-1} \left( - \frac{1}{4 e} \right) \end{cases} $$ with $a = 1 + 2 \ln(2)$ ## Moyal FWHM $$ \text{FWHM}_L = x_+ - x_- = 3.590806098... $$ \vspace{15pt} $$ M(x) \thus \text{FWHM}_M = 3.590806098... $$ \vspace{15pt} $$ M_{\mu \sigma_M}(x) \thus \text{FWHM}_M = \sigma_M \cdot 3.590806098... $$