I am taking an introductory Machine Learning class but it has been a while since I took calculus. I am having a difficulty in understanding the following equations.
So we are currently talking about the Gaussian Distribution: $$\int_{-\infty}^{\infty} N(x|\mu,\sigma^2)dx = 1$$
This makes sense to me as I understand that the sum of the probability distribution adds up to one.
Where I start to struggle is the following: $$\int_{-\infty}^{\infty} N(x|\mu,\sigma^2)xdx = \mu$$ I dont understand how adding all the x values from $-\infty$ to $\infty$ gives us the mean.
And this is the next step in the equations, which once again, I cant follow but I believe If I can get the earlier one, this one will be easy as well. $$\int_{-\infty}^{\infty} N(x|\mu,\sigma^2)x^2dx = \mu^2 + \sigma^2$$
Sorry for the trivial looking question. If I can wrap around the intuitive meanings the rest should be easier I feel. The content is from Pattern Recognition and Machine Learning.
Thank you
In you second equation it is important to notice that you are weighting $x$ by the probability of getting $x$, so the most likely values are going to contribute more to the sum, than the less likely values. That's why
$$ \int_{-\infty}^{+\infty}{\rm d}x~xN(x|\mu,\sigma^2) = \mu $$
All this is saying is that average value of $x$ is $\mu$.
As for the last equation, you're ultimately calculating the integral
$$ \int_{-\infty}^{+\infty}{\rm d}x~(x-\mu)^2N(x|\mu,\sigma^2) $$
which just represents the average (squared) distance from the all points to the mean value $\mu$