Derivative of sum of Gaussians wrt. sigma - How does this work?

226 Views Asked by At

Let $\varepsilon_i \sim \mathcal{N}(0,\sigma_i^2)$ be samples from independent Gaussians, we know by additivity of independent Gaussians that $\varepsilon_1 + \varepsilon_2 = \varepsilon'$ where $\varepsilon' \sim \mathcal{N}(0,\sigma_1^2+\sigma_2^2)$.

We can also write this with $\varepsilon^*_i \sim \mathcal{N}(0,1)$ as

$\sigma_1 \varepsilon^*_1 + \sigma_2 \varepsilon^*_2 = \sqrt{\sigma_1^2 + \sigma_2^2}\varepsilon^*_3$

What confuses me here if that while both terms describe the same distribution, their derivatives with respect to $\sigma$ are quite different.

$\frac{d}{d\sigma_1} \sigma_1 \varepsilon^*_1 + \sigma_2 \varepsilon^*_2 = \varepsilon^*_1$

whereas

$\frac{d}{d\sigma_1} \sqrt{\sigma_1^2 + \sigma_2^2}\varepsilon^*_3 = \frac{\varepsilon^*_3\sigma_1}{\sqrt{\sigma_1^2 + \sigma_2^2}}$

So I see something is going wrong here, I suspect this is because using standard differential calculus might not extend to cases where random variables are involved(?). Can someone here clarify for me, why these derivatives differ and what the right tools for computing derivatives involving random variables would be? Also feel free to correct my notation, I'm not a mathematician.

Thanks!