08.10.2016 Views

Foundations of Data Science

2dLYwbK

2dLYwbK

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Generating functions are useful for calculating the mean and standard deviation <strong>of</strong> a<br />

sequence. Let z be an integral valued random variable where p i is the probability that<br />

∑<br />

z equals i. The expected value <strong>of</strong> z is given by m = ∞ ∑<br />

ip i . Let p(x) = ∞ p i x i be the<br />

generating function for the sequence p 1 , p 2 , . . .. The generating function for the sequence<br />

p 1 , 2p 2 , 3p 3 , . . . is<br />

x d<br />

∞<br />

dx p(x) = ∑<br />

ip i x i .<br />

Thus, the expected value <strong>of</strong> the random variable z is m = xp ′ (x)| x=1 = p ′ (1). If p was not<br />

a probability function, its average value would be p′ (1)<br />

since we would need to normalize<br />

p(1)<br />

the area under p to one.<br />

i=0<br />

i=0<br />

i=0<br />

The second moment <strong>of</strong> z, is E(z 2 ) − E 2 (z) and can be obtained as follows.<br />

x 2 d ∣ ∣∣∣x=1<br />

∞∑<br />

dx p(x) = i(i − 1)x i p(x)<br />

∣<br />

i=0<br />

x=1<br />

∞∑<br />

= i 2 x i ∞∑<br />

p(x)<br />

− ix i p(x) ∣<br />

∣<br />

x=1<br />

i=0<br />

= E(z 2 ) − E(z).<br />

Thus, σ 2 = E(z 2 ) − E 2 (z) = E(z 2 ) − E(z) + E(z) − E 2 (z) = p ” (1) + p ′ (1) − ( p ′ (1) ) 2<br />

.<br />

12.8.2 The Exponential Generating Function and the Moment Generating<br />

Function<br />

Besides the ordinary generating function there are a number <strong>of</strong> other types <strong>of</strong> generating<br />

functions. One <strong>of</strong> these is the exponential generating function. Given a sequence<br />

∑<br />

a 0 , a 1 , . . . , the associated exponential generating function is g(x) = ∞ x<br />

a i<br />

i . i!<br />

Moment generating functions<br />

The k th moment <strong>of</strong> a random variable x around the point b is given by E((x − b) k ).<br />

Usually the word moment is used to denote the moment around the value 0 or around<br />

the mean. In the following, we use moment to mean the moment about the origin.<br />

i=0<br />

∣<br />

x=1<br />

The moment generating function <strong>of</strong> a random variable x is defined by<br />

i=0<br />

Ψ(t) = E(e tx ) =<br />

∫ ∞<br />

e tx p(x)dx<br />

−∞<br />

421

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!