Theory 1

By composing any function g: with a random variable X:S we obtain a new random variable gX. This one is called a derived random variable.

Notation

The derived random variable gX may be written “g(X)”.

Expectation of derived variables

Discrete case:

E[g(X)]=kg(k)PX(k)

(Here the sum is over all possible values k of X, i.e. where PX(k)0.)

Continuous case:

E[g(X)]=+g(x)fX(x)dx

Notice: when applied to outcome sS:

  • k is the output of X
  • g(k) is the output of gX

The proofs of these formulas are tricky because we must relate the PDF or PMF of X to that of g(X).


Linearity of expectation

For constants a and b:

E[aX+b]=aE[X]+b

For any X and Y on the same probability model:

E[X+Y]=E[X]+E[Y]

Exercise - Linearity of expectation

Using the definition of expectation, verify both linearity formulas for the discrete case.

Be careful!

Usually E[g(X)]g(E[X]).

For example, usually E[XX]E[X]E[X].

We distribute E over sums but not products (unless the factors are independent).


Variance squares the scale factor

For constants a and b:

Var[aX+b]=a2Var[X]

Thus variance ignores the offset and squares the scale factor. It is not linear!


Extra - Moments

The nth moment of X is defined as the expectation of Xn:

Discrete case:

E[Xn]=kknp(k)

Continuous case:

E[Xn]=+xnf(x)dx

A central moment of X is a moment of the variable XE[X]:

E[(XE[X])n]

The data of all the moments collectively determines the probability distribution. This fact can be very useful! In this way moments give an analogue of a series representation, and are sometimes more useful than the PDF or CDF for encoding the distribution.

Theory 2

Suppose we are given the PDF fX(x) of X, a continuous RV.

What is the PDF fg(X), the derived variable given by composing X with g:?

PDF of derived

The PDF of g(X) is not (usually) equal to gfX(x).

Relating PDF and CDF

When the CDF of X is differentiable, we have:

FX(x)=xfX(t)dtfX(x)=ddxFX(x)Fg(X)(x)=xfg(X)(t)dtfg(X)(x)=ddxFg(X)(x)

Therefore, if we know fX(x), we can find fg(X)(x) using a 3-step process:

(1) Integrate PDF to get CDF:

FX(x)=xfX(t)dt

(2) Find Fg(X), the CDF of g(X), by comparing conditions:

When g is monotone increasing, we have equivalent conditions:

g(X)xXg1(x)P[g(X)x]=P[Xg1(x)]Fg(X)(x)=FX(g1(x))

(3) Differentiate CDF to recover PDF:

fg(X)(x)=ddxFg(X)(x)ddxFX(g1(x))fX(g1(x))ddx(g1)

Alternative: Method of differentials

Change variables: The measure for integration is fX(x)dx. Set Y=X2 so dy=2xdx and dx=12ydy. Thus fX(x)dx=fX(y)12ydy. So the measure of integration in terms of y is fY(y)=fX(y)12y.

Warning: this assumes the function is one-to-one.