Expectation over a Gaussion Distribution

Published on: Date

Following our weekly book reading session at NAAMII, where we discussed Chapter 2: Probabilities from the book 'Deep Learning - Foundations and Concepts,' we decided to explore the concept of expectation in different probability distributions. This was a great chance to remember and brush up on our integration lessons!

Expected value of function of a continuous variable x is given by

E(f) = p(x).f(x)dx

Which can be viewed as a weighted average of function f(x) under a probability distribution p(x).

Gaussian distribution is defined by:

p(x) = 1σ2π*e-12*(x-μσ)2

Here, probability density over x is governed by two parameters: μ, called the mean, σ, called the standarad deviation. The distribution is defined over entire real line, extending from - to .

let f(x) = x

E(x) = -1σ2π*e-12*(x-μσ)2*xdx   ----------(1)

Let:
x-μσ=a
and,
x = aσ+μ : dx = σda

Put the value of x in equation 1.
= -1σ*2π*e-12a2*(aσ+μ)*σ*da

= 12π*-e-12a2*a*σ*da+-e-12a2*μ*da ------------ (2)

Let:
J = -e-12a2*a*σ*da

I =-e-12a2*μ*da

Solving for J:

= -0e-12a2*a*σ*da + 0e-12a2*a*σ*da
= -0e-12a2*a*σ*da + 0e-12a2*a*σ*da
= 0

Solving for I:

 I = -e-12a2*μ*da
I2 = -e-12a2*μ*da * -e-12b2*μ*db
I2 = --e-12a2+b2*μ2*dadb

Next we change cartesian to polar form:

a2+b2 = r2
da*db = r*dr*dθ

Therefore:

= 02π0e-12r2*μ2*r*dr*dθ
= 2π*0e-12r2*μ2*r*dr
Let:

r2 = x
2*r*dr = dx
Now,
= π*0e-x2*μ2*dx
= π*e-2-12 - e-02-12*μ2
= π*0 +2*μ2

So, I2 = 2π*μ2

I = 2π*μ2
I = μ2π

Keeping the value of I and J back to equation 2 we get,
E(x) = 12π*2π*μ
E(x) = μ