3.1 continuous random variables - github pages
TRANSCRIPT
3.1 Continuous Random Variables
Today’s Objectives
▫ What is the difference between a discrete and continuous distributions?
▫ What is a pdf?
▫ What is the cdf in the continuous case? How can we calculate the formula
for a given distribution?
▫ How do we calculate probabilities for a continuous random variable?
▫ How do we calculate E[X], Var[X], mgf, percentiles for continuous random
variables?
2
Fundamental Theorem of Calculus (review)
3
Types of Random Variables
4
Sample spaces belong to one of two types:▫ Discrete▫ Continuous
Discrete: Rolling die and counting the total number of spots▫ Countable (can be countably infinite)
Continuous: Choosing a random number from the interval [0,1]▫ Uncountable
How we calculate probabilitiesDiscrete: Each outcome in the sample space is assigned a probability by the pmf, 𝑓𝑓(𝑥𝑥). 𝑃𝑃(𝑋𝑋 = 𝑥𝑥) = 𝑓𝑓(𝑥𝑥)
Continuous: This no longer works because a continuous space has an uncountably infinite number of outcomes.We need to talk about the probability that 𝑋𝑋 falls within some interval or range. For all x, 𝑃𝑃 𝑋𝑋 = 𝑥𝑥 = 0
5
Probability density function (pdf)A continuous random variable, 𝑋𝑋, can be described with a probability density function, 𝑓𝑓(𝑥𝑥).
𝑓𝑓(𝑥𝑥) is an integrable function that satisfies the following three conditions:
6
Continuous distribution example
𝑓𝑓 𝑥𝑥 = �𝑘𝑘 𝑥𝑥2 + 𝑥𝑥 , 0 ≤ 𝑥𝑥 ≤ 1,0 , 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒
7
Find the value k that makes f(x) a probability density function (pdf).
Cumulative Distribution Function (cdf)
F x = P X ≤ x = �−∞
xf t dt, −∞ ≤ x ≤ ∞
Based on the fundamental theorem of calculus,
F′ x = f(x)
8
cdf example
9
Calculating continuous probabilities𝑓𝑓(𝑦𝑦) = 2𝑦𝑦, 0 < 𝑦𝑦 < 1. Calculate P[ ½ < Y < ¾ ].
Using the cdf:F( ¾ ) – F( ½ ) = ( ¾ )2 – ( ½ )2 = 5/16
10
Calculating continuous probabilities𝑓𝑓 𝑦𝑦 = 2𝑦𝑦, 0 < 𝑦𝑦 < 1. 𝐶𝐶𝐶𝐶𝑒𝑒𝐶𝐶𝐶𝐶𝑒𝑒𝐶𝐶𝐶𝐶𝑒𝑒 P[ ¼ < Y < 2 ].
Using the cdf:F(2) – F( ¼ ) = 1 – ( ¼ )2 = 15/16
11
cdf example
12
𝑓𝑓 𝑥𝑥 = �𝑘𝑘 𝑥𝑥2 + 𝑥𝑥 , 0 ≤ 𝑥𝑥 ≤ 1,0 , 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒
Find an expression for the cdf, 𝐹𝐹 𝑥𝑥 .
When 0 ≤ 𝑥𝑥 ≤ 1,
𝐹𝐹 𝑥𝑥 =�0 , 𝑥𝑥 < 065
𝑥𝑥3
3+ 𝑥𝑥
2
2, 0 ≤ 𝑥𝑥 ≤ 1
1 , 𝑥𝑥 > 1
E[X] and Var[X] for Continuous RV
13
MGF for Continuous RVThe mgf is still E[etX]:
14
Percentiles
▫ For example, the 60th percentile is the number, 𝜋𝜋𝑝𝑝 (𝑜𝑜𝑒𝑒 𝑥𝑥), such that 𝐹𝐹(𝜋𝜋𝑝𝑝) = 0.6
15
Continuous ExampleSuppose 𝑓𝑓𝑋𝑋(x) = 4𝑥𝑥3, 0 ≤ 𝑥𝑥 ≤ 1.
Find 𝑃𝑃(0 ≤ 𝑋𝑋 ≤ 12
) ans: (1/16)
Find E[X]. ans: (4/5)
Find the 20th percentile of X. ans: (0.6687)
16
Properties of continuous pdf/cdfThe pdf for a continuous random variable does not need to be a continuous function. For example:
The cdf will always be a continuous function.
17
Cdf of previous distribution
0, 𝑥𝑥 < 0
F(x) =
12𝑥𝑥, 0 < 𝑥𝑥 < 1
12
, 1 ≤ 𝑥𝑥 ≤ 112
+ 12𝑥𝑥 − 2 , 2 < 𝑥𝑥 < 3
1, 𝑥𝑥 ≥ 3Note: the use of “≤” and “< “ are interchangeable for continuous distributions. Why?
18
A quick note about continuous pdfsA continuous pdf does not need to be bounded above ▫ (that means 𝑓𝑓(𝑥𝑥) for a continuous RV can be larger than 1)▫ (Remember for discrete RVs, the pmf 𝑓𝑓(𝑥𝑥) is bounded by 1.)
The area between a continuous pdf and the x-axis must still equal 1. (total probability)
19