• 沒有找到結果。

3 Moments and moment generating functions

N/A
N/A
Protected

Academic year: 2022

Share "3 Moments and moment generating functions"

Copied!
10
0
0

加載中.... (立即查看全文)

全文

(1)

Theorem 2.1 Let X be a random variable and let a, b, and c be constants. Then for any functions g1(x) and g2(x) whose expectations exist,

a. E(ag1(X) + bg2(X) + c) = aEg1(X) + bEg2(X) + c.

b. If g1(x) ≥ 0 for all x, then Eg1(X) ≥ 0.

c. If g1(x) ≥ g2(x) for all x, then Eg1(X) ≥ Eg2(X).

d. If a ≤ g1(x) ≤ b for all x, then a ≤ Eg1(X) ≤ b.

Example 2.4 (Minimizing distance) Find the value of b which minimizes the distance E(X − b)2. E(X − b)2 = E(X − EX + EX − b)2

= E(X − EX)2+ (EX − b)2+ 2E((X − EX)(EX − b))

= E(X − EX)2+ (EX − b)2. Hence E(X − b)2 is minimized by choosing b = EX.

When evaluating expectations of nonlinear functions of X, we can proceed in one of two ways.

From the definition of Eg(X), we could directly calculate Eg(X) =

Z

−∞

g(x)fX(x)dx.

But we could also find the pdf fY(y) of Y = g(X) and we would have Eg(X) = EY =

Z

−∞

yfY(y)dy.

3 Moments and moment generating functions

Definition 3.1 For each integer n, the nth moment of X (or FX(x)), µ0n, is µ0n= EXn.

The nth central moment of X, µn, is

µn= E(X − µ)n, where µ = µ01= EX.

Theorem 3.1 The variance of a random variable X is its second central moment, VarX = E(X − EX)2. The positive square root of VarX is the standard deviation of X.

(2)

Example 3.1 (Exponential variance) Let X ∼ exponential(λ). We have calculated EX = λ, then VarX = E(X − λ)2 =

Z

0 (x − λ)21

λe−x/λdx = λ2.

Theorem 3.2 If X is a random variable with finite variance, then for any constants a and b, Var(aX + b) = a2VarX.

The variance can be calculated using an alternative formula:

VarX = EX2− (EX)2.

Example 3.2 (Binomial variance) Let X ∼ binomial(n, p), that is, P (X = x) =n

x



px(1 − p)n−x, x = 0, 1, . . . , n.

We have known EX = np. Now we calculate EX2 =

n

X

x=0

x2n x



px(1 − p)n−x

= n

n

X

x=1

xn − 1 x − 1



px(1 − p)n−x

= n

n−1X

y=0

(y + 1)n − 1 y



py+1(1 − p)n−1−y

= np

n−1X

y=0

yn − 1 y



py+1(1 − p)n−1−y+ np

n−1X

y=0

n − 1 y



py+1(1 − p)n−1−y

= np[(n − 1)p] + np.

Hence, the variance is:

VarX = n(n − 1)p2+ np − (np)2 = np(1 − p).

The moment generating function (mgf), as its name suggests, can be used to generate moments.

In practice, it is easier in many cases to calculate moments directly than to use the mgf. However, the main use of the mdf is not to generate moments, but to help in characterizing a distribution.

This property can lead to some extremely powerful results when used properly.

Definition 3.2 Let X be a random variable with cdf FX. The moment generating function (mgf) of X (or FX), denoted by MX(t), is

MX(t) = EetX,

(3)

provided that the expectation exists for t in some neighborhood of 0. That is, there is an h such that, for all t in −h < t < h, EetX exists. If the expectation does not exist in a neighbor of 0, we say that the moment generating function does not exist.

More explicitly, we can write the mgf of X as MX(t) =

Z

−∞

etxfX(x)dx if X is continuous, or

MX(t) =X

x

etxP (X = x) if X is discrete.

Theorem 3.3 If X has mgf MX(t), then

EXn= MX(n)(0), where we define

MX(n)(0) = dn

dtnMX(t)|t=0.

That is, the nth moment is equal to the nth derivative of MX(t) evaluated at t = 0.

Proof: Assuming that we can differentiate under the integral sign, we have d

dtMX(t) = d dt

Z

−∞

etxfX(x)dx

= Z

−∞

(d

dtetx)fX(x)dx

= Z

−∞

(xetx)fX(x)dx

= EXetX.

Thus, dtdMX(t)|t=0 = EXetX|t=0 = EX. Proceeding in an analogous manner, we can establish that

dn

dtnMX(t)|t=0= EXnetX|t=0= EXn.



Example 3.3 (Gamma mgf) The gamma pdf is f (x) = 1

Γ(α)βαxα−1e−x/β, 0 < x < ∞, α > 0, β > 0,

(4)

where Γ(α) =R

0 tα−1e−tdt denotes the gamma function. The mgf is given by MX(t) = 1

Γ(α)βα Z

0

etxxα−1e−x/betadx

= 1

Γ(α)βα Z

0

xα−1e−x/(1−βtβ )dx

= 1

Γ(α)βαΓ(α) β 1 − βt

α

= 1

1 − βt

α

if t < 1β

If t ≥ 1/β, then the quantity 1 − βt is nonpositive and the integral is infinite. Thus, the mgf of the gamma distribution exists only if t < 1/β.

The mean of the gamma distribution is given by EX = d

dtMX(t)|t=0= αβ

(1 − βt)α+1|t=0= αβ.

Example 3.4 (Binomial mgf) The binomial mgf is MX(t) =

n

X

x=0

etxn x



px(1 − p)n−x

=

n

X

x=0

(pet)x(1 − p)n−x The binomial formula gives

n

X

x=0

n x



uxvn−x= (u + v)n. Hence, letting u = pet and v = 1 − p, we have

MX(t) = [pet+ (1 − p)]n.

The following theorem shows how a distribution can be characterized.

Theorem 3.4 Let FX(x) and FY(y) be two cdfs all of whose moments exist.

a. If X and Y have bounded supports, then FX(u) = FY(u) for all u if and only if EXr = EYr for all integers r = 0, 1, 2, . . ..

b. If the moment generating functions exist and MX(t) = MY(t) for all t in some neighborhood of 0, then FX(u) = FY(u) for all u.

Theorem 3.5 (Convergence of mgfs) Suppose {Xi, i = 1, 2, . . .} is a sequence of random variables, each with mgf MXi(t). Furthermore, suppose that

i→∞lim MXi(t) = MX(t), for all t in a neighborhood of 0,

(5)

and MX(t) is an mgf.Then there is a unique cdf FX whose moments are determined by MX(t) and, for all x where FX(x) is continuous, we have

i→∞lim FXi(x) = FX(x).

That is, convergence, for |t| < h, of mgfs to an mgf implies convergence of cdfs.

Before going to the next example, we first mention an important limit result, one that has wide applicability in statistics. The proof of this lemma may be found in many standard calculus texts.

Lemma 3.1 Let a1, a2, . . . be a sequence of numbers converging to a, that is, limn→∞an= a. Then

n→∞lim(1 +an

n)n= ea.

Example 3.5 (Poisson approximation) The binomial distribution is characterized by two quanti- ties, denoted by n and p. It is taught that the Poisson approximation is valid “when n is large and np is small,” and rules of thumb are sometimes given.

The Poisson(λ) pmf is given by

P (X = x) = λx

x!e−λ, x = 0, 1, 2, . . . ,

where λ is a positive constant. The approximation states that if X ∈ binomial(n, p) and Y ∼ Poisson(λ), with λ = np, then

P (X = x) ≈ P (Y = x)

for large n and small np. We now show the mgfs converge, lending credence to this approximation.

Recall that

MX(t) = [pet+ (1 − p)]n. For the Poisson(λ) distribution, we can calculate

MY(t) = eλ(et−1), and if we define p = λ/n, then

MX(t) = [1 + 1

n(et− 1)(np)]n= [1 + 1

n(et− 1)λ]n. Now set an= a = (et− 1)λ, and apply the above lemma to get

n→∞lim MX(t) = eλ(et−1)= MY(t).

The Poisson approximation can be quite good even for moderate p and n.

(6)

Theorem 3.6 For any constants a and b, the mgf of the random variable aX + b is given by MaX+b(t) = ebtMX(at).

Proof: By definition

MaX+b(t) = Ee(aX+b)t = ebtEe(at)X

= ebtMX(at).



4 Differentiating under an integral sign

The purpose of this section is to characterize conditions under which this operation is legitimate.

We will also discuss interchanging the order of differentiation and summation. Many of these conditions can be established using standard theorems from calculus and detailed proofs can be found in most calculus textbooks. Thus, detailed proofs will not be presented here.

Theorem 4.1 (Leibnitz’s Rule) If f (x, θ), a(θ), and b(θ) are differentiable with respect to θ, then d

dθ Z b(θ)

a(θ)

f (x, θ)dx = f (b(θ), θ) d

dθb(θ) − f(a(θ), θ) d

dθa(θ) + Z b(θ

a(θ)

) ∂

∂θf (x, θ)dx.

Notice that if a(θ) and b(θ) are constants, we have a special case of Leibnitz’s rule:

d dθ

Z b

a

f (x, θ)dx = Z b

a

∂θf (x, θ)dx.

Thus, in general, if we have the integral of a differentiable function over a finite range, differentiation of the integral poses no problem. If the range of integration is infinite, however, problems can arise.

The question of whether interchanging the order of differentiation and integration is justified is really a question of whether limits and integration can be interchanged, since a derivative is a special kind of limit. Recall that if f (x, θ) is differentiable, then

∂θf (x, θ) = lim

δ→0

f (x, θ + δ) − f(x, θ)

δ ,

so we have

Z

−∞

∂θf (x, θ)dx = Z

−∞

δ→0lim

f (x, θ + δ) − f(x, θ)

δ dx,

while

d dθ

Z

−∞

f (x, θ)dx = lim

δ→0

Z

−∞

f (x, θ + δ) − f(x, θ)

δ dx.

The following theorems are all corollaries of Lebesgue’s Dominated Convergence Theorem.

(7)

Theorem 4.2 Suppose the function h(x, y) is continuous at y0 for each x, and there exists a function g(x) satisfying

i. |h(x, y)| ≤ g(x) for all x and y.

ii. R

−∞g(x)dx < ∞.

Then

y→ylim0 Z

−∞

h(x, y)dx = Z

−∞

y→ylim0h(x, y)dx.

The key condition in this theorem is the existence of a dominating function g(x), with a finite integral, which ensures that the integrals cannot be too badly behaved.

Theorem 4.3 Suppose f (x, θ) is differentiable at θ = θ0, that is,

δ→0lim

f (x, θ0+ δ) − f(x, θ0)

δ = ∂

∂θf (x, θ)|θ=θ0

exists for every x, and there exists a function g(x, θ0) and a constant δ0 > 0 such that i.

f (x, θ0+ δ) − f(x, θ0) δ

≤ g(x, θ0), for all x and |δ| ≤ δ0, ii.

Z

−∞

g(x, θ0)dx < ∞.

Then

d dθ

Z

−∞

f (x, θ)dx θ=θ0 =

Z

−∞

 ∂

∂θf (x, θ)|θ=θ0dx. (4) It is important to realize that although we seem to be treating θ as a variable, the statement of the theorem is for one value of θ. That is, for each value θ0 for which f (x, θ) is differentiable at θ0

and satisfies conditions (i) and (ii), the order of integration and differentiation can be interchanged.

Often the distinction between θ and θ0 is not stressed and (4) is written d

dθ Z

−∞

f (x, θ)dx = Z

−∞

∂θf (x, θ)dx. (5)

Example 4.1 (Interchanging integration and differentiation-I) Let X have the exponential(λ) pdf given by f (x) = λ1e−x/λ, 0 < x < ∞, and suppose we want to calculate

d

dλEXn= d dλ

Z

0

xn1

λe−x/λdx

(8)

for integer n > 0. If we could move the differentiation inside the integral, we would have d

dλEXn= Z

0

∂λxn1

λe−x/λdx

= Z

0

xn λ2(x

λ− 1)e−x/λdx

= 1

λ2EXn+1−1 λEXn.

To justify the interchange of integration and differentiation, we bound the derivative as follows.

∂λ xn1

λe−x/λ

= xne−x/λ λ2 |x

λ− 1| ≤ xne−x/λ λ2 (x

λ+ 1), since x/λ > 0. For some constant δ0 satisfying 0 < δ0 < λ, take

g(x, λ) = xne−x/(λ+δ0) (λ − δ0)2 ( x

λ − δ0

+ 1).

We then have

∂λ xn1

λe−x/λ|λ=λ0

≤ g(x, λ) for all λ0 such that |λ0− λ| ≤ δ0. Since the exponential distribution has all of its moments, R

−∞g(x, λ)dx < ∞ as long as λ − δ0> 0, so the interchange of integration and differentiation is justified.

Note that this example gives us a recursion relation for the moments of the exponential distribution, EXn+1= λEXn+ λ2 d

dλEXn.

Example 4.2 (Interchanging summation and differentiation) Let X be a discrete random variable with the geometric distribution

P (X = x) = θ(1 − θ)x, x = 0, 1, . . . , 0 < θ < 1.

We have that P

x=0θ(1 − θ)x= 1 and, provided that the operations are justified, d

dθ X x=0

θ(1 − θ)x = X x=0

d

dθθ(1 − θ)x

=

X

x=0

[(1 − θ)x− θx(1 − θ)x−1]

= 1 θ

X x=0

θ(1 − θ)x− 1 1 − θ

X x=0

xθ(1 − θ)x. SinceP

x=0θ(1 − θ)x= 1 for all 0 < θ < 1, its derivative is 0. So we have 1

θ

X

x=0

θ(1 − θ)x− 1 1 − θ

X

x=0

xθ(1 − θ)x = 0,

(9)

that is,

1 θ− 1

1 − θEX = 0, or

EX = 1 θ − 1.

Theorem 4.4 Suppose that the series P

x=0h(θ, x) converges for all θ in an interval (a, b) of real numbers and

i. ∂θh(θ, x) is continuous in θ for each x, ii. P

x=0

∂θh(θ, x) converges uniformly on every closed bounded subinterval of (a, b).

Then

d dθ

X

x=0

h(θ, x) =

X

x=0

∂θh(x, θ).

The condition of uniform convergence is the key one to the theorem. Recall that a series converges uniformly if its sequence of partial sums converges uniformly.

Example 4.3 (Continuation of Example 4.2) Since h(θ, x) = θ(1 − θ)x and

∂θh(θ, x) = (1 − θ)x− θx(1 − θ)x−1, the uniform convergence of P

x=0

∂θh(θ, x) can be verified as follows. Define Sn(θ) =

n

X

x=0

[(1 − θ)x− θx(1 − θ)x−1].

The convergence will be uniform on [c, d] ⊂ (0, 1) if, given  > 0, we can find an N such that n > N ⇒ |Sn(θ) − S(θ)| <  for all θ ∈ [c, d].

Since

n

X

x=0

(1 − θ)x = 1 − (1 − θ)n+1

θ ,

and

n

X

x=0

θx(1 − θ)x−1 = θ

n

X

x=0

−∂

∂θ(1 − θ)x

= −θ d dθ

n

X

x=0

(1 − θ)x= −θ d

dθ[1 − (1 − θ)n+1

θ ]

= [1 − (1 − θ)n+1] − (n + 1)θ(1 − θ)n

θ .

(10)

Hence,

Sn(θ) = 1 − (1 − θ)n+1

θ −[1 − (1 − θ)n+1] − (n + 1)θ(1 − θ)n θ

= (n + 1)(1 − θ)n.

It is clear that, for 0 < θ < 1, S= limn→∞Sn(θ) = 0. Since Sn(θ) is continuous, the convergence is uniform on any closed bounded interval. Therefore, the series of derivatives converges uniformly and the interchange of differentiation and summation is justified.

Theorem 4.5 Suppose the series P

x=0h(θ, x) converges uniformly on [a, b] and that, for each x, h(θ, x) is a continuous function of θ. Then

Z b

a

X x=0

h(θ, x)dθ = X x=0

Z b

a

h(θ, x)dθ.

參考文獻

相關文件

A metric (topological) space X is disconnected if it is the union of two disjoint nonempty open subsets.. Otherwise, X

[r]

2) A 900 g sample of pure water is shaken with air under a pressure of 0.95 atm at 20 °C. The vapor pressures of the pure compounds at 25°C are 331 mm Hg for cyclopentane and 113 mm

substance) is matter that has distinct properties and a composition that does not vary from sample

The molal-freezing-point-depression constant (Kf) for ethanol is 1.99 °C/m. The density of the resulting solution is 0.974 g/mL.. 21) Which one of the following graphs shows the

The EDB organises professional development programmes to enhance teachers’ subject knowledge (e.g. the role of grammar and vocabulary in academic reading and

 Starting from the 2014/15 school year, EDB has substantially increased the additional funding to schools, and provided schools with teaching resources, teacher

Wang, Solving pseudomonotone variational inequalities and pseudocon- vex optimization problems using the projection neural network, IEEE Transactions on Neural Networks 17