折叠正态分布#

如果 \(Z\) 是均值为 \(L\)、标准差为 \(\sigma=S\) 的正态分布,则 \(\left|Z\right|\) 是形状参数为 \(c=\left|L\right|/S\)、位置参数为 \(0\)、尺度参数为 \(S\) 的折叠正态分布。这是具有 1 个自由度和非中心参数为 \(c^{2}.\) 的非中心卡方分布的特例。请注意 \(c\geq0\)。折叠正态分布的标准形式为

\begin{eqnarray*} f\left(x;c\right) & = & \sqrt{\frac{2}{\pi}}\cosh\left(cx\right)\exp\left(-\frac{x^{2}+c^{2}}{2}\right)\\ F\left(x;c\right) & = & \Phi\left(x-c\right)-\Phi\left(-x-c\right)=\Phi\left(x-c\right)+\Phi\left(x+c\right)-1\\ G\left(q;c\right) & = & F^{-1}\left(q;c\right)\\ M\left(t\right) & = & \exp\left(\frac{t}{2}\left(t-2c\right)\right) \left(1+e^{2ct}\right)\\ k & = & \mathrm{erf}\left(\frac{c}{\sqrt{2}}\right)\\ p & = & \exp\left(-\frac{c^{2}}{2}\right)\\ \mu & = & \sqrt{\frac{2}{\pi}}p+ck\\ \mu_{2} & = & c^{2}+1-\mu^{2}\\ \gamma_{1} & = & \frac{\sqrt{\frac{2}{\pi}}p^{3}\left(4-\frac{\pi}{p^{2}}\left(2c^{2}+1\right)\right)+2ck\left(6p^{2}+3cpk\sqrt{2\pi}+\pi c\left(k^{2}-1\right)\right)}{\pi\mu_{2}^{3/2}}\\ \gamma_{2} & = & \frac{c^{4}+6c^{2}+3+6\left(c^{2}+1\right)\mu^{2}-3\mu^{4}-4p\mu\left(\sqrt{\frac{2}{\pi}}\left(c^{2}+2\right)+\frac{ck}{p}\left(c^{2}+3\right)\right)}{\mu_{2}^{2}}\end{eqnarray*}

实现: scipy.stats.foldnorm