Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Continuous Random Variables Michael Akritas
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
The Density Function The Normal Random Variable Normal Approximation to the Binomial
The Exponential Distribution Transformations
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Definition X is continuous if there exists a ≥ 0 function f (x) such that Z P(X ∈ A) = f (x)dx. A
This function is called the probability density function, or pdf. Properties: R∞ I −∞ f (x)dx = 1 (= P(−∞ < X < ∞)). Rb I P(a ≤ X ≤ b) = P(a < X < b) = a f (x)dx. Ra I P(X = a) = a f (x)dx = 0. Read Example 1a, p. 187. Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Example X = life time of an indicator light, has pdf f (x) =
100 x I (x
> 100)
1. Find P(X < 150) 2. What is the probability that two of 5 such indicator lights will have to be replaced within the first 150 hours?
Definition F (x) = P(X ≤ x) = distribution function. I
Rx
−∞ f (t)dt
is called the cumulative
By the Fundamental Theorem of Calculus,
Michael Akritas
d dx F (x)
Continuous Random Variables
= f (x)
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Example X ∼ fX (x). Find the pdf of Y = 2X . R∞ I µX = E (X ) = xfX (x)dx (Definition) R ∞ −∞ I E (g (X )) = −∞ g (x)f (x)dx (To be shown – see next page) I
E (ag1 (X ) + bg2 (X )) = aE (g1 (X )) + bE (g2 (X ))
Example X ∼ fX (x) = I (0 ≤ x ≤ 1). Find E (e X ). Solution: a) Apply above formula with g (x) = e x b) Find the pdf, fY (y ), of Y R= e X and use the definition of ∞ expected value, i.e. E (Y ) = −∞ yfY (y )dy . Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Lemma If Y is a ≥ 0 r.v., then E (Y ) =
R∞ 0
P(Y > y )dy
Proposition E (g (X )) =
R∞
−∞ g (x)f (x)dx.
Proof: Assume first that g (x) ≥ 0, for all x. Then, Z ∞ Z ∞Z E (g (X )) = P(g (X ) > y )dy = 0
Z
0 ∞
Z
=
g (x)
Z
∞
dyf (x)dx = −∞
0
f (x)dxdy
x:g (x)>y
g (x)f (x)dx −∞
For general g write g (x) = g (x)I (g (x) ≥ 0) + g (x)I (g (x) < 0) = g + (x) − g − (x), and use E (g (X )) = E (g + (X )) − E (g − (X )) Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
I
σX2 = Var(X ) = E (X − µX )2 = E (X 2 ) − µ2X .
I
Var(aX + b) = a2 Var(X )
Example (The Uniform in (0,1) Random Variable) X ∼ U(0, 1) if fX (x) = I (0 < x < 1). Show FX (x) = 0I (x ≤ 0) + xI (0 < x ≤ 1) + I (x > 1), µX
= 0.5,
σX2 =
1 12
Example (The Uniform in (a,b) Random Variable) X ∼ U(0, 1) if fX (x) = FX , µX and σX2
1 b−a I (a
< x < b). Derive expressions for
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
(x−µ)2 √ 1 exp{− } 2σ 2 2πσ
I
X ∼ N(µ, σ 2 ) if fX (x) =
I
If µ = 0, σ 2 = 1, X is said to have the standard normal distribution. A standard normal random variable is typically denoted by Z .
Showing that fX integrates to one is not simple. In fact, you either know how to do this integral or you spend a lot of time going nowhere. See page 199 of the book. I
If X ∼ N(µ, σ 2 ) then Y = a + bX ∼ N(a + bµ, b 2 σ 2 )
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
Corollary 1. If Z ∼ N(0, 1), then X = µ + σZ ∼ N(µ, σ 2 ). 2. If X ∼ N(µ, σ 2 ), then 3. If X ∼ N(µ, σ 2 ), then
X −µ ∼ N(0, 1). σ xα = µ + σzα ,
Z=
where xα and zα denote the percentiles of X and Z .
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
Finding Probabilities via the Standard Normal Table In Table A.3, z-values are identified from the left column, up to the first decimal, and the top row, for the second decimal. Thus, 1 is identified by 1.0 in the left column and 0.00 in the top row.
Example (The 68-95-99.7% Property.) Let Z ∼ N(0, 1). Then 1. P(−1 < Z < 1) = Φ(1) − Φ(−1) = .8413 − .1587 = .6826. 2. P(−2 < Z < 2) = Φ(2) − Φ(−2) = .9772 − .0228 = .9544. 3. P(−3 < Z < 3) = Φ(3) − Φ(−3) = .9987 − .0013 = .9974.
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
Finding Probabilities via the Standard Normal Table Example Let X ∼ N(1.25, 0.462 ). Find a) P(1 ≤ X ≤ 1.75), and b) P(X > 2). X − 1.25 ∼ N(0, 1) to express these 0.46 probabilities in terms of Z . Thus, 1 − 1.25 X − 1.25 1.75 − 1.25 ≤ ≤ a) P(1 ≤ X ≤ 1.75) = P .46 .46 .46 Solution. Use Z =
= P(−.54 < Z < 1.09) = Φ(1.09) − Φ(−.54) = .8621 − .2946. 2 − 1.25 b) P(X > 2) = P Z > = 1 − Φ(1.63) = .0516. .46 Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
Finding Percentiles via the Standard Normal Table To find zα , one first locates 1 − α in the body of Table A.3 and then reads zα from the margins. If the exact value of 1 − α does not exist in the main body of the table, then an approximation is used as described in the following.
Example Find z0.05 , the 95th percentile of Z . Solution. 1 − α = 0.95 does not exist in the body of the table. The entry that is closest to, but larger than 0.95 (i.e. 0.9505), corresponds to 1.64. The entry that is closest to, but smaller than 0.95 (which is 0.9495), corresponds to 1.65. We approximate z0.05 by averaging these two z-values: z.05 ' Michael Akritas
1.64 + 1.65 = 1.645. 2
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
Finding Percentiles via the Standard Normal Table
Example Let X denote the weight of a randomly chosen frozen yogurt cup. Suppose X ∼ N(8, .462 ). Find the value c that separates the upper 5% of weight values from the lower 95%. Solution. This is another way of asking for the 95-th percentile, x.05 , of X . Using the formula xα = µ + σzα , we have x.05 = 8 + .46z.05 = 8 + (.46)(1.645) = 8.76.
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
The Basic Result If X ∼ Bin(n, p), then the DeMoivre-Laplace limit theorem states that ·
X ∼ N(np, np(1 − p)), for n large enough. The approximation is quite good for values of n such that np(1 − p) ≥ 10 and is often used if np ≥ 5 and n(1 − p) ≥ 5. If b p = X /n, the DeMoivre-Laplace limit theorem also yields p(1 − p) · b p ∼ N p, , for n large enough as above. n Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
The Continuity Correction Due to the discreteness of the binomial distribution, the normal approximation is improved by the so-called continuity correction: P(X ≤ x) = P(X ≤ x + 0.5) ·
= P(Y ≤ x + 0.5) = Φ
x + 0.5 − np p np(1 − p)
! ,
where Y ∼ N(np, np(1 − p)), i.e. is a normal r.v. with mean and variance equal to the mean and variance of the Binomial r.v. X . I
The normal approximation works in situations where the Poisson approximation does not work. For example p does not have to be ≤ 0.01. Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
Example Suppose that 60% of all drivers in a certain state wear seat belt always. A random sample of 500 drivers is selected. Find the (approximate) probability that the number of those wearing seat belt always is between 270 and 320 (inclusive). Solution: Let X denote the number of drivers that always wear seat belt. Then, X ∼ Bin(500, 0.6). Since np ≥ 5 and n(1 − p) ≥ 5, P(270 ≤ X ≤ 320) = P(X ≤ 320) − P(X ≤ 269) 320 − 300 269 − 300 = Φ −Φ = Φ(1.826) − Φ(−2.83) 10.95 10.95 = 0.9661 − 0.0023 = 0.9638.
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Normal Approximation to the Binomial
Example (Continued) Using the continuity correction, we have P(270 ≤ X ≤ 320) = P(X ≤ 320) − P(X ≤ 269) 320 + 0.5 − 300 269 + 0.5 − 300 = Φ −Φ 10.95 10.95 = Φ(1.87) − Φ(−2.78) = 0.9693 − 0.0027 = 0.9666.
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
I I I
X ∼ Exp(λ) if fX (x) = λe −λx I (x > 0), for some λ > 0. F (x) = P(X ≤ x) = 1 − e −λx E (X n ) = λn E (X n−1 ), so that E (X ) =
1 1 , Var(X ) = 2 λ λ
Example Suppose that the number of miles a car can run before its battery wears out is exponentially distributed with an average value of 10,000 miles. A person decides to take a 5,000 mile trip having just changed the battery. What is the probability that the trip will be completed without having to replace the battery? Solution: P(X > 5) = e −5/10 = 0.604. Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
The Memoryless Property of the Exponential RV I
If X ∼ Exp(λ) then for t > s we have P(X > t|X > s) = P(X > t − s)
Example Suppose that the number of miles a car can run before its battery wears out is exponentially distributed with an average value of 10,000 miles. A person decides to take a 5,000 mile. What is the probability that the trip will be completed without having to replace the battery? Solution: By the memoryless property, P(X > 5) = e −5/10 = 0.604. Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
The Poisson-Exponential Relationship
Proposition Let X (t) be a Poisson process with parameter λ, and let T be the time until the first occurrence. Then T ∼ Exp(λ)
Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Example a) If X ∼ U(0, 1), find the distribution of Y = X 2 . b) If X ∼ U(−1, 1), find the distribution of Y = X 2 . c) If X ∼ U(0, 1), find the distribution of Y = log X .
Theorem Let X be continuous with pdf fX , and let g (x) be strictly monotonic and differentiable function. Then Y = g (X ) has pdf d −1 −1 fY (y ) = fX (g (y )) g (y ) dy for y in the range of the function g , and zero otherwise. Michael Akritas
Continuous Random Variables
Outline The Density Function The Normal Random Variable The Exponential Distribution Transformations
Example 1. (The Probability Transformation) Let X be continuous with cumulative distribution function FX . Then, if g = FX , Y = g (X ) ∼ U(0, 1). 2. (The Quantile Transformation) Let X ∼ U(0, 1) and F be a cumulative distribution function of a continuous random variable. Then, if g = F −1 , Y = g (X ) has FY = F .
Michael Akritas
Continuous Random Variables