2

I am reading Pattern Recognition and Machine Learbing by Christopher Bishop and I am having a hard time tracking down an explanation of this formula.

In chapter 1 he states...

we can readily find expectations of functions of x under the Gaussian distribution in particular the average value of x is given by

$$ \mathbb{E}_x = \int_{-\infty}^\infty N(x | \mu, \sigma^2)x dx = \mu $$

How can I explain why this is true?

Joff
  • 944
  • 1
    You are asking how to compute the expectation of a normally distributed random variable. This is an integral of the form $\int_{\mathbb{R}} x f_X(x) dx$ where $f_X(x)$ is the probability density function of a normally distributed RV. If you don’t know basic probability theory or integral calculus, then with all due respect, I think you should study some before tackling or researching problems in ML because almost surely you will encounter more confusion like this due to this being more or less prerequisite knowledge. – Nap D. Lover May 14 '19 at 01:35

2 Answers2

2

Just consider the case you have a variable taking n values $ x_1$ to $x_n$. You are asked to find the expected value of the variable. It would be the mean of that variable over all the values it can take. In case each value is equally probable(1/n) you can simply find this as $\frac 1 n \sum x_i$. But they may not be equiprobable. So then, you multiply each by its probability (which was 1/n in earlier case) and add them. For a random variable, the probability is given by pmf or $f_X(x)$. So $E(X)=\sum xf_X(x)$. So this was the discrete random variable. In the continuous, also the expression is similar, we use PDF, which gives a measure of probability and instead of summation we use integration. So $E(X)=\int xf(x) dx$

Tojra
  • 1,483
0

To give you a little more than what my comment suggests:

Let $X\sim \mathcal{N}(\mu, \sigma^2)$ i.e. normally distributed with mean-parameter $\mu$ and variance $\sigma^2$. We need to show the expectation of $X$ is equal to $\mu$. That is, $$\mathbb{E}(X)=\mu,$$ where the expectation of $X$ is defined as $$\mathbb{E}(X):=\int_{-\infty}^\infty xf_X(x)\mathrm{d}x,$$ and $$f_X(x)=\frac1{\sqrt{2\pi \sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}},$$ is the probability density function of $X$. Thus our integral in full is, $$\mathbb{E}(X)=\frac1{\sqrt{2\pi \sigma^2}}\int_{-\infty}^\infty x e^{-\frac{(x-\mu)^2}{2\sigma^2}} \mathrm{d}x,$$ which can be readily computed by basic integral methods (although it is not a one-liner). In fact, it is already, in detail, explained on this site here (with the bonus of also deriving the variance!).

Nap D. Lover
  • 1,292