正态分布概率密度的梯度
时间: 2023-10-26 10:46:53 浏览: 74
正态分布概率密度函数的公式为:
$$
f(x) = \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}}
$$
其中,$\mu$ 是均值,$\sigma$ 是标准差。概率密度函数的图像是一个钟形曲线,对应的概率分布是对称的。
我们可以使用链式法则来求取正态分布概率密度函数的梯度。假设我们要求取 $f(x)$ 关于参数 $\theta$ 的梯度,其中 $\theta$ 可以是 $\mu$ 或者 $\sigma$。
$$
\begin{aligned}
\frac{\partial f(x)}{\partial \theta} &= \frac{\partial}{\partial \theta}\left(\frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}}\right) \\
&= \frac{1}{\sqrt{2\pi}\sigma} \frac{\partial}{\partial \theta}\left(e^{-\frac{(x-\mu)^2}{2\sigma^2}}\right) \\
&= \frac{1}{\sqrt{2\pi}\sigma} \left(e^{-\frac{(x-\mu)^2}{2\sigma^2}}\right) \frac{\partial}{\partial \theta}\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) \\
&= \frac{1}{\sqrt{2\pi}\sigma} \left(e^{-\frac{(x-\mu)^2}{2\sigma^2}}\right) \left(\frac{(x-\mu)^2}{\sigma^3}\right) \frac{\partial \sigma}{\partial \theta} \quad \text{(如果 $\theta = \mu$)} \\
&= \frac{1}{\sqrt{2\pi}\sigma} \left(e^{-\frac{(x-\mu)^2}{2\sigma^2}}\right) \left(\frac{(x-\mu)}{\sigma^2}\right) \frac{\partial \mu}{\partial \theta} \quad \text{(如果 $\theta = \sigma$)} \\
\end{aligned}
$$
这里用到了导数的链式法则。根据上式,我们可以计算出正态分布概率密度函数的梯度,并用于优化算法中。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)