Logo

4.4 Error Function

Through the transformation of variables, we can specify the error function, the complementary error function, and the cumulative distribution function of the standard normal distribution into an "$h$" function

\begin{equation*}
\text{erf}\left( x \right)=\frac{x}{\sqrt{\pi }}{\exp(-{{x}^{2}})}h_{\tfrac{-1}{2}}^{-{{x}^{2}}},\tag{4.7}
\end{equation*}
[Proof for (4.7)]
\begin{equation*}
\text{erfc}\left(x\right)=1-\frac{x}{\sqrt{\pi }}{\exp(-{{x}^{2}})}h_{\tfrac{-1}{2}}^{-{{x}^{2}}}
\end{equation*}

\begin{equation*}
\Phi\left(x\right)=\frac{1}{2}\left[1+\frac{x}{\sqrt{2\pi }}{\exp(\tfrac{-{{x}^{2}}}{2})}h_{\tfrac{-1}{2}}^{\tfrac{-{{x}^{2}}}{2}} \right].\tag{4.8}
\end{equation*}
[Proof for (4.8)]

Since the improper integral of the Gaussian function can be exactly analyzed, numerical error resulted from the choice of $C$ does not apply to the three error functions. As the most widely used distribution, the error function is encountered when we integrate the probability of the normal distribution. We present the "$h$" formulas for eight related distribution functions, including the normal, inverse Gaussian, log-normal, logit-normal, half-normal, folded normal, Maxwell-Boltzmann, and Levy distributions.

C11 Normal distribution
\begin{equation*}
F\left( x;\mu ,\sigma \right) =\frac{1}{2}\left[ 1+\frac{x-\mu }{\sqrt{2\pi }\sigma }{\exp\left(-\tfrac{{{\left( x-\mu \right)}^{2}}}{2{{\sigma }^{2}}}\right)}h_{\tfrac{-1}{2}}^{-\tfrac{{{\left( x-\mu \right)}^{2}}}{2{{\sigma }^{2}}}} \right],
\end{equation*}
where $\mu \in \mathbb{R}$ (location parameter), ${{\sigma }^{2}}>0$ (scale parameter), and $x\in \mathbb{R}$.

C12 Inverse Gaussian distribution
\begin{multline*}
F\left( x;\mu ,\lambda \right)=\frac{1}{2}\left[ 1+\sqrt{\frac{\lambda }{2\pi x}}\left( \frac{x}{\mu }-1 \right){\exp\left(\tfrac{-\lambda }{2x}{{\left( \tfrac{x}{\mu }-1 \right)}^{2}}\right)}h_{\tfrac{-1}{2}}^{\tfrac{-\lambda }{2x}{{\left( \tfrac{x}{\mu }-1 \right)}^{2}}} \right] \\+\frac{1}{2}\exp \left( \frac{2\lambda }{\mu } \right)\left[ 1-\sqrt{\frac{\lambda }{2\pi x}}\left( \frac{x}{\mu }+1 \right){\exp\left(\tfrac{-\lambda }{2x}{{\left( \tfrac{x}{\mu }+1 \right)}^{2}}\right)}h_{\tfrac{-1}{2}}^{\tfrac{-\lambda }{2x}{{\left( \tfrac{x}{\mu }+1 \right)}^{2}}} \right],
\end{multline*}
where $\mu >0$ (location parameter), $\lambda >0$ (shape parameter), and $x\in \left( 0,\infty \right)$.

C13 Log-normal distribution
\begin{equation*}
F\left( x;\mu ,\sigma \right)=\frac{1}{2}+\frac{\log x-\mu }{2\sqrt{2\pi }\sigma }{\exp\left(-\tfrac{{{\left( \log x-\mu \right)}^{2}}}{2{{\sigma }^{2}}}\right)}h_{\tfrac{-1}{2}}^{-\tfrac{{{\left( \log x-\mu \right)}^{2}}}{2{{\sigma }^{2}}}},
\end{equation*}
where $\mu \in \mathbb{R}$ (location parameter), ${{\sigma }^{2}}>0$ (scale parameter), and $x\in \left( 0,\infty \right)$.

C14 Logit-normal distribution
\begin{equation*}
F\left( x;\mu ,{{\sigma }^{2}} \right)=\frac{1}{2}\left[ 1+\frac{\text{logit}\left( x \right)-\mu }{\sqrt{2\pi }\sigma }{\exp\left(\tfrac{-{{\left( \text{logit}\left( x \right)-\mu \right)}^{2}}}{2{{\sigma}^{2}}}\right)}h_{\tfrac{-1}{2}}^{\tfrac{-{{\left( \text{logit}\left( x \right)-\mu \right)}^{2}}}{2{{\sigma }^{2}}}} \right],
\end{equation*}
where $\mu \in \mathbb{R}$ (location parameter), ${{\sigma }^{2}}>0$ (scale parameter), and $x\in \left( 0,1 \right)$.

C15 Half-normal distribution
\begin{equation*}
F\left(x;\sigma\right)=\frac{x}{\sqrt{2\pi}\sigma }{\exp\left(\tfrac{-{{x}^{2}}}{2{{\sigma}^{2}}}\right)}h_{\tfrac{-1}{2}}^{\tfrac{-{{x}^{2}}}{2{{\sigma }^{2}}}},
\end{equation*}
where ${{\sigma }^{2}}>0$ (scale parameter), and $x\in \left[ 0,\infty \right)$.

C16 Folded normal distribution
\begin{equation*}
F\left( x;\mu ,\sigma \right)=\frac{1}{2}\left[ \frac{x+\mu }{\sqrt{2\pi }\sigma }{\exp\left(\tfrac{-{{\left( x+\mu \right)}^{2}}}{2{{\sigma }^{2}}}\right)}h_{\tfrac{-1}{2}}^{\tfrac{-{{\left( x+\mu \right)}^{2}}}{2{{\sigma }^{2}}}}+\frac{x-\mu }{\sqrt{2\pi }\sigma }{\exp\left(\tfrac{-{{\left( x-\mu \right)}^{2}}}{2{{\sigma }^{2}}}\right)}h_{\tfrac{-1}{2}}^{\tfrac{-{{\left( x-\mu \right)}^{2}}}{2{{\sigma }^{2}}}} \right],
\end{equation*}
where $\mu \in \mathbb{R}$ (location parameter), ${{\sigma }^{2}}>0$ (scale parameter), and $x\in \left[ 0,\infty \right)$.

C17 Maxwell-Boltzmann distribution
\begin{equation*} F\left(x;a\right)=\frac{x}{\sqrt{2\pi}a}{\exp\left(\tfrac{-{{x}^{2}}}{2{{a}^{2}}}\right)} h_{\tfrac{-1}{2}}^{\tfrac{-{{x}^{2}}}{2{{a}^{2}}}}-\sqrt{\frac{2}{\pi}}\frac{x{\exp\left(\tfrac{-{{x}^{2}}}{2{{a}^{2}}}\right)}}{a},
\end{equation*}
where $a>0$ (scale parameter) and $x\in \left[ 0,\infty \right)$.

C18 Levy distribution
\begin{equation*}
F\left( x;\mu ,\alpha \right)=1-\sqrt{\frac{\alpha}{2\pi \left( x-\mu \right)}}{\exp\left(\tfrac{-\alpha}{2\left( x-\mu \right)}\right)}h_{\tfrac{-1}{2}}^{\tfrac{-\alpha}{2\left( x-\mu \right)}},
\end{equation*}
where $\mu >0$ (location parameter), $\alpha>0$ (scale parameter), $x\ge \mu $, and $x\in \left[ 0,\infty \right)$.

Download [full paper] [supplementary materials] [.m files] [technical note]