Friday, May 24, 2019

integration - Integrating a cost function over a normal distribution




Let's say you have a cost function $C(x)$ and you want to understand the expected cost if the input follows the normal distribution



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



If I want to find my expected cost, I would need to integrate over the normal distribution



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



I have found ways to approximate the integral of the normal distribution (e.g. taylor series), but nothing on how to integrate another function over it.




I can numerically estimate the integral given an arbitrary cost function, but I was wondering if there is any way to simplify it analytically and see how the expected cost changes as a function of $\mu$ and $\sigma$ and my cost function?



If the arbitrary cost function is too hard, would it be possible to solve for a simplier case such as $C(x) = x^2$? Even in this case I'm struggling to simplify it, although it just might not be possible.


Answer



HINT:



If $C(x)=x^2$, then we can find a closed form for its expected value. Recall that



$$I(a)=\int_{-\infty}^{\infty}e^{-ax^2}dx=\sqrt{\frac{\pi}{a}}$$




and



$$-I'(a)=\int_{-\infty}^{\infty}x^2e^{-ax^2}dx=\frac{\pi^{1/2}}{2a^{3/2}}$$



Then, change variables from $(x-\mu)/\sqrt{2\sigma}$ to $x$ and expand the quadratic inside the integral.



Can you finish from here?


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...