纳卡米分布#

卡方分布的推广。形状参数为 \(\nu>0.\) 支持为 \(x\geq0.\)

\begin{eqnarray*} f\left(x;\nu\right) & = & \frac{2\nu^{\nu}}{\Gamma\left(\nu\right)}x^{2\nu-1}\exp\left(-\nu x^{2}\right)\\ F\left(x;\nu\right) & = & \frac{\gamma\left(\nu,\nu x^{2}\right)}{\Gamma\left(\nu\right)}\\ G\left(q;\nu\right) & = & \sqrt{\frac{1}{\nu}\gamma^{-1}\left(\nu,q{\Gamma\left(\nu\right)}\right)} \end{eqnarray*}

其中 \(\gamma\) 是下不完全伽马函数,\(\gamma\left(\nu, x\right) = \int_0^x t^{\nu-1} e^{-t} dt\).

\begin{eqnarray*} \mu & = & \frac{\Gamma\left(\nu+\frac{1}{2}\right)}{\sqrt{\nu}\Gamma\left(\nu\right)}\\ \mu_{2} & = & \left[1-\mu^{2}\right]\\ \gamma_{1} & = & \frac{\mu\left(1-4v\mu_{2}\right)}{2\nu\mu_{2}^{3/2}}\\ \gamma_{2} & = & \frac{-6\mu^{4}\nu+\left(8\nu-2\right)\mu^{2}-2\nu+1}{\nu\mu_{2}^{2}} \end{eqnarray*}

实现:scipy.stats.nakagami

SciPy 中纳卡米分布的 MLE (nakagami.fit)#

SciPy 中 nakagami 分布的概率密度函数为

\begin{equation} f(x; \nu, \mu, \sigma) = 2 \frac{\nu^\nu}{ \sigma \Gamma(\nu)}\left(\frac{x-\mu}{\sigma}\right)^{2\nu - 1} \exp\left(-\nu \left(\frac{x-\mu}{\sigma}\right)^2 \right),\tag{1} \end{equation}

对于 \(x\) 满足 \(\frac{x-\mu}{\sigma} \geq 0\),其中 \(\nu \geq \frac{1}{2}\) 是形状参数,\(\mu\) 是位置,\(\sigma\) 是尺度。

因此,对数似然函数为

\begin{equation} l(\nu, \mu, \sigma) = \sum_{i = 1}^{N} \log \left( 2 \frac{\nu^\nu}{ \sigma\Gamma(\nu)}\left(\frac{x_i-\mu}{\sigma}\right)^{2\nu - 1} \exp\left(-\nu \left(\frac{x_i-\mu}{\sigma}\right)^2 \right) \right),\tag{2} \end{equation}

可以扩展为

\begin{equation} l(\nu, \mu, \sigma) = N \log(2) + N\nu \log(\nu) - N\log\left(\Gamma(\nu)\right) - 2N \nu \log(\sigma) + \left(2 \nu - 1 \right) \sum_{i=1}^N \log(x_i - \mu) - \nu \sigma^{-2} \sum_{i=1}^N \left(x_i-\mu\right)^2, \tag{3} \end{equation}

不考虑支持约束,似然导数的最优一阶条件给出了参数估计

\begin{align} \frac{\partial l}{\partial \nu}(\nu, \mu, \sigma) &= N\left(1 + \log(\nu) - \psi^{(0)}(\nu)\right) + 2 \sum_{i=1}^N \log \left( \frac{x_i - \mu}{\sigma} \right) - \sum_{i=1}^N \left( \frac{x_i - \mu}{\sigma} \right)^2 = 0 \text{,} \tag{4}\\ \frac{\partial l}{\partial \mu}(\nu, \mu, \sigma) &= (1 - 2 \nu) \sum_{i=1}^N \frac{1}{x_i-\mu} + \frac{2\nu}{\sigma^2} \sum_{i=1}^N x_i-\mu = 0 \text{, and} \tag{5}\\ \frac{\partial l}{\partial \sigma}(\nu, \mu, \sigma) &= -2 N \nu \frac{1}{\sigma} + 2 \nu \sigma^{-3} \sum_{i=1}^N \left(x_i-\mu\right)^2 = 0 \text{,}\tag{6} \end{align}

其中 \(\psi^{(0)}\) 是阶数为 \(0\) 的多伽马函数;即 \(\psi^{(0)}(\nu) = \frac{d}{d\nu} \log \Gamma(\nu)\).

但是,分布的支持是 \(x\) 的值,使得 \(\frac{x-\mu}{\sigma} \geq 0\),这提供了额外的约束,即

\begin{equation} \mu \leq \min_i{x_i}.\tag{7} \end{equation}

对于 \(\nu = \frac{1}{2}\),对数似然关于 \(\mu\) 的偏导数简化为

\begin{equation} \frac{\partial l}{\partial \mu}(\nu, \mu, \sigma) = {\sigma^2} \sum_{i=1}^N (x_i-\mu), \end{equation}

当满足支持约束时,该偏导数为正。因为关于 \(\mu\) 的偏导数为正,所以增加 \(\mu\) 会增加对数似然,因此该约束在 \(\mu\) 的最大似然估计处是活跃的

\begin{equation} \mu = \min_i{x_i}, \quad \nu = \frac{1}{2}. \tag{8} \end{equation}

对于 \(\nu\) 足够大于 \(\frac{1}{2}\),似然方程 \(\frac{\partial l}{\partial \mu}(\nu, \mu, \sigma)=0\) 有解,并且该解提供了 \(\mu\) 的最大似然估计。但是,在任何情况下,条件 \(\mu = \min_i{x_i}\) 都为数值优化提供了合理的初始猜测。

此外,关于 \(\sigma\) 的似然方程可以显式求解,它提供了最大似然估计

\begin{equation} \sigma = \sqrt{ \frac{\sum_{i=1}^N \left(x_i-\mu\right)^2}{N}}. \tag{9} \end{equation}

因此,nakagami_fitstart 方法使用

\begin{align} \mu_0 &= \min_i{x_i} \, \text{and} \\ \sigma_0 &= \sqrt{ \frac{\sum_{i=1}^N \left(x_i-\mu_0\right)^2}{N}} \end{align}

作为数值优化的初始猜测。