3

I am trying to find the partial derivative of univariate normal cdf w.r.t $\sigma$. I just need some direction. So far I have gotten this:

$\frac{\partial }{\partial \sigma}\Phi(x,\mu,\sigma^2) = \frac{\partial }{\partial \sigma} \displaystyle\int_{-\infty}^x \frac{1}{\sqrt{2\pi}}\exp\left(-\ln(\sigma)-\frac{(x-\mu)^2}{2\sigma^2}\right)dx $

$ = \displaystyle\int_{-\infty}^x\frac{\partial }{\partial \sigma}\frac{1}{\sqrt{2\pi}}\exp\left(-\ln(\sigma)-\frac{(x-\mu)^2}{2\sigma^2}\right)dx$

$ = \displaystyle\int_{-\infty}^x\frac{1}{\sqrt{2\pi}}\exp\left(-\ln(\sigma)-\frac{(x-\mu)^2}{2\sigma^2}\right)\times\left( -\frac{1}{\sigma}+\frac{(x-\mu)^2}{\sigma^3}\right)dx$

$ = \displaystyle\int_{-\infty}^x -\frac{1}{\sqrt{2\pi}\sigma^2}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) + \frac{(x-\mu)^2}{\sqrt{2\pi}\sigma^4}\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) dx$

I don't know how to proceed from there.

A Gore
  • 113
  • Also see http://stats.stackexchange.com/questions/27436/how-to-take-derivative-of-multivariate-normal-density for the generalization to multivariate normals. – whuber Feb 16 '17 at 23:17
  • @whuber I couldn't find an answer that addressed this particular question with a proof on the site. I also think that showing a proof for the univariate normal is a good idea as not everyone will be comfortable with the vector notation of the multivariate the case. – statsplease Feb 17 '17 at 00:17

1 Answers1

6

There is a much simpler way of proceeding. We know that:

$$N(\mu,\sigma^{2})$$

has cumulative distribution function:

$$F_{X}(x;\mu,\sigma^{2})=\Phi\bigg(\frac{x-\mu}{\sigma}\bigg)$$

where $\Phi$ is the cumulative distribution function of the standard normal. We can proceed as follows:

$$\begin{align} \frac{\partial}{\partial \sigma}F_{X}(x;\mu,\sigma^{2})&=\frac{\partial}{\partial \sigma}\Phi\bigg(\frac{x-\mu}{\sigma}\bigg) \end{align}$$

Using the chain rule, this should set you up.


Using your approach is a little bit more involved. This was my attempt at it. According to Leibniz's rule, we know that:

$$\frac{\partial}{\partial\sigma}\int_{-\infty}^{x}f_{X}(x;\mu,\sigma^{2})\,dx=\int_{-\infty}^{x}\frac{\partial}{\partial\sigma}f_{X}(x;\mu,\sigma^{2})\,dx$$

Now, as you've already calculated:

$$\frac{\partial}{\partial\sigma}f_{X}(x;\mu,\sigma^{2})=-\frac{1}{\sqrt{2\pi}\sigma^{2}}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}+\frac{(x-\mu)^{2}}{\sqrt{2\pi}\sigma^{4}}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}$$

Now, the first of the terms above is simple enough to integrate:

$$\int_{-\infty}^{x}-\frac{1}{\sqrt{2\pi}\sigma^{2}}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}\,dx=-\frac{1}{\sigma}\Phi\bigg(\frac{x-\mu}{\sigma}\bigg)$$

Let's focus now on the second term. For the sake of simple notation, let's allow:

$$z=\frac{x-\mu}{\sigma}$$

This gives:

$$\frac{1}{\sqrt{2\pi}\sigma}\int_{-\infty}^{x}z^{2}e^{-\frac{z^{2}}{2}}\,dz$$

To solve, we'll use integration by parts. Let:

$$\begin{align} u&=z,\quad dv=ze^{-\frac{z^{2}}{2}}\\ du&=1,\quad\,\,\, v=-e^{-\frac{z^{2}}{2}} \end{align}$$

So,

$$\begin{align} \frac{1}{\sqrt{2\pi}\sigma}\int_{-\infty}^{x}z^{2}e^{-\frac{z^{2}}{2}}\,dz&=\frac{1}{\sqrt{2\pi}\sigma}\bigg[-ze^{-\frac{z^{2}}{2}}\bigg]_{-\infty}^{x}+\frac{1}{\sqrt{2\pi}\sigma}\int_{-\infty}^{x}e^{-\frac{z^{2}}{2}}\,dz\\ &=\frac{1}{\sqrt{2\pi}\sigma}\bigg[-\bigg(\frac{x-\mu}{\sigma}\bigg)e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}-0\bigg]+\frac{1}{\sigma}\Phi\bigg(\frac{x-\mu}{\sigma}\bigg)\\ &=-\bigg(\frac{x-\mu}{\sigma^{2}}\bigg)\frac{1}{\sqrt{2\pi}}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}+\frac{1}{\sigma}\Phi\bigg(\frac{x-\mu}{\sigma}\bigg)\\ &=-\bigg(\frac{x-\mu}{\sigma^{2}}\bigg)\phi\bigg(\frac{x-\mu}{\sigma}\bigg)+\frac{1}{\sigma}\Phi\bigg(\frac{x-\mu}{\sigma}\bigg) \end{align}$$

Thus,

$$\begin{align} \frac{\partial}{\partial\sigma}\int_{-\infty}^{x}f_{X}(x;\mu,\sigma^{2})\,dx&=-\frac{1}{\sigma}\Phi\bigg(\frac{x-\mu}{\sigma}\bigg)-\bigg(\frac{x-\mu}{\sigma^{2}}\bigg)\phi\bigg(\frac{x-\mu}{\sigma}\bigg)+\frac{1}{\sigma}\Phi\bigg(\frac{x-\mu}{\sigma}\bigg)\\ &=-\bigg(\frac{x-\mu}{\sigma^{2}}\bigg)\phi\bigg(\frac{x-\mu}{\sigma}\bigg) \end{align}$$

statsplease
  • 2,808
  • Does that mean that $\frac{\partial}{\partial \sigma} \Phi\left(\frac{x-\mu}{\sigma}\right) = -\frac{x-\mu}{\sigma^2}\phi\left(\frac{x-\mu}{\sigma}\right)$ is the partial derivative? Is there a way to get the same solution using my approach? – A Gore Feb 14 '17 at 06:26
  • @AGore That's my understanding, yes. I've edited my answer to include a derivation from your approach. – statsplease Feb 16 '17 at 06:31
  • the σ^2 terms should be under the sqrt IINM (after "Now, as you've already calculated") – Mattwmaster58 Feb 24 '22 at 02:12