<<

Continuous Random Variables Survival Function Normal Random Variables

Topic 8 The Continuous Random Variables

1 / 11 Continuous Random Variables Survival Function Normal Random Variables Outline

Continuous Random Variables

Survival Function

Normal Random Variables

2 / 11 Continuous Random Variables Survival Function Normal Random Variables Continuous Random Variables

For X a continuous with density function fX , consider the discrete random variable X˜ obtained from X by rounding down. Say, for example, we give lengths by rounding down to the nearest millimeter. Thus, X˜ = 1.776 meters for any lengths X satisfying

1.776 meters < X ≤ 1.777meters.

˜ The random variable X is discrete and has a mass function fX˜ . Thus, the expected value ˜ X Eg(X ) = g(˜x)fX˜ (˜x). x˜

3 / 11 Continuous Random Variables Survival Function Normal Random Variables Continuous Random Variables Let∆ x be the spacing between values for ˜ X . Then,˜x, an integer multiple of∆ x, rep- 3 ˜ resents a possible value for X , density f 2.5 X

X˜ =x ˜ if and only if˜ x < X ≤ x˜ + ∆x. 2

1.5

With this, we can give the mass function round 1 down ˜ fX˜ (˜x) = P{X =x ˜} = P{x˜ < X ≤ x˜ + ∆x}. 0.5 ! x 0 Now, by the property of the density func- Figure:!0.5 !0.25 The0 value0.25 of0.5 the0.75 mass1 function1.25 1.5 f 1.75(˜x) 2is tion, X˜ the area of the rectangular region above and to the right of˜x . P{x˜ ≤ X < x˜ + ∆x} ≈ fX (˜x)∆x.

4 / 11 Continuous Random Variables Survival Function Normal Random Variables Continuous Random Variables

For this discrete random variable X˜ , we can use the approximation of its mass function to approximate the expected value.

˜ X X Eg(X ) = g(˜x)fX˜ (˜x) = g(˜x)P{x˜ ≤ X < x˜ + ∆x} x˜ x˜ X ≈ g(˜x)fX (˜x)∆x. x˜

This last sum is a Riemann sum and so taking limits as∆ x → 0, we have that X˜ converges to X and the Riemann sum converges to the definite integral. Thus, Z ∞ Eg(X ) = g(x)fX (x) dx. −∞

5 / 11 Continuous Random Variables Survival Function Normal Random Variables Continuous Random Variables

Exercise. For the dart example, the density fX (x) = 2x on the interval [0, 1] and0 otherwise. Determine EX and EX 2. As in the case of discrete random variables, a similar formula to holds for a vector of random variables X = (X1, X2,..., Xn), fX , the joint density function and g a real-valued function of the vector x = (x1, x2,..., xn).

The expectation in this case is an n-dimensional Riemann integral. For example, if X1

and X2 has joint density fX1,X2 (x1, x2), then Z ∞ Z ∞

Eg(X1, X2) = g(x1, x2)fX1,X2 (x1, x2) dx2dx1 −∞ −∞ provided that the improper Riemann integral converges.

6 / 11 Continuous Random Variables Survival Function Normal Random Variables Survival Function We learned that the sample is equal to the area under the empirical survival function for nonnegative observations. We check to see if an analogous identity holds for continuous random variables.

Let X be a nonnegative random variable with distribution function FX and density fX . Cumulative Distribution Function Survival Function Then the survival function 1.0 1.0 F X (x) = P{X > x} = 1 − FX (x). 0.8 0.8 0.6 0.6

The question we are asking is if0.4 the following 0.4

identity holds: 0.2 0.2

Z ∞ 0.0 0.0 EX = P{X > x} dx. 0 0.0 0.5 1.0 1.5 0.0 0.5 1.0 1.5 x x

7 / 11 Continuous Random Variables Survival Function Normal Random Variables Survival Function

We integrate by parts.

Z ∞ ∞ Z ∞

(1 − FX (x))dx = x(1 − FX (x)) − x(−fX (x)) dx 0 0 0 Z ∞ = xfX (x) dx = EX . 0

u(x) = 1 − FX (x) v(x) = x 0 0 u (x) = −fX (x) v (x) = 1

2 Exercise. For the dart example, the distribution function FX (x) = x on the interval [0, 1]. Use the survival function to determine EX .

8 / 11 Continuous Random Variables Survival Function Normal Random Variables Normal Random Variables

The most important density function we 0.4 shall encounter is 0.3 1 z2 φ(z) = √ exp(− ), z ∈ R.

2π 2 0.2 dnorm(x) for Z, the standard normal random variable. 0.1

Because the function φ has no simple an- 0.0 tiderivative, we use a numerical approxima- -3 -2 -1 0 1 2 3 tion to compute the distribution function, x denotedΦ. Figure: Normal density, plotted by entering curve(dnorm(x),-3,3)

9 / 11 Continuous Random Variables Survival Function Normal Random Variables Normal Random Variables The expectation, 1 Z ∞ z2 EZ = √ z exp(− ) dz = 0 2π −∞ 2 because the integrand is an odd function. Next to evaluate

1 Z ∞ z2 1  z2 ∞ Z ∞ z2  2 2 EZ = √ z exp(− ) dz = √ −z exp(− ) + exp(− )dz = 1. 2π −∞ 2 2π 2 −∞ −∞ 2 we integrate by parts.

u(z) = z v(z) = − exp(−z2/2) u0(z) = 1 v 0(z) = z exp(−z2/2)

Use l’Hˆopital’srule to see that the first term is0. The fact that the integral of a probability density function is1 shows that the second term equals1.

10 / 11 Continuous Random Variables Survival Function Normal Random Variables Summary

distribution function FX (x) = P{X ≤ x} discrete random variable continuous

mass function density function fX (x) = P{X = x} fX (x)∆x ≈ P{x ≤ X < x + ∆x}

fX (x) ≥ 0 properties fX (x) ≥ 0 P R ∞ all x fX (x) = 1 −∞ fX (x) dx = 1 P R P{X ∈ A} = x∈A fX (x) probability P{X ∈ A} = A fX (x) dx P R ∞ Eg(X ) = all x g(x)fX (x) expectation Eg(X ) = −∞ g(x)fX (x) dx

11 / 11