3.1 continuous random variables - github pages

19
3.1 Continuous Random Variables

Upload: others

Post on 17-May-2022

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3.1 Continuous Random Variables - GitHub Pages

3.1 Continuous Random Variables

Page 2: 3.1 Continuous Random Variables - GitHub Pages

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

Page 3: 3.1 Continuous Random Variables - GitHub Pages

Fundamental Theorem of Calculus (review)

3

Page 4: 3.1 Continuous Random Variables - GitHub Pages

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

Page 5: 3.1 Continuous Random Variables - GitHub Pages

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

Page 6: 3.1 Continuous Random Variables - GitHub Pages

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

Page 7: 3.1 Continuous Random Variables - GitHub Pages

Continuous distribution example

𝑓𝑓 𝑥𝑥 = �𝑘𝑘 𝑥𝑥2 + 𝑥𝑥 , 0 ≤ 𝑥𝑥 ≤ 1,0 , 𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒𝑒

7

Find the value k that makes f(x) a probability density function (pdf).

Page 8: 3.1 Continuous Random Variables - GitHub Pages

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

Page 9: 3.1 Continuous Random Variables - GitHub Pages

cdf example

9

Page 10: 3.1 Continuous Random Variables - GitHub Pages

Calculating continuous probabilities𝑓𝑓(𝑦𝑦) = 2𝑦𝑦, 0 < 𝑦𝑦 < 1. Calculate P[ ½ < Y < ¾ ].

Using the cdf:F( ¾ ) – F( ½ ) = ( ¾ )2 – ( ½ )2 = 5/16

10

Page 11: 3.1 Continuous Random Variables - GitHub Pages

Calculating continuous probabilities𝑓𝑓 𝑦𝑦 = 2𝑦𝑦, 0 < 𝑦𝑦 < 1. 𝐶𝐶𝐶𝐶𝑒𝑒𝐶𝐶𝐶𝐶𝑒𝑒𝐶𝐶𝐶𝐶𝑒𝑒 P[ ¼ < Y < 2 ].

Using the cdf:F(2) – F( ¼ ) = 1 – ( ¼ )2 = 15/16

11

Page 12: 3.1 Continuous Random Variables - GitHub Pages

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

Page 13: 3.1 Continuous Random Variables - GitHub Pages

E[X] and Var[X] for Continuous RV

13

Page 14: 3.1 Continuous Random Variables - GitHub Pages

MGF for Continuous RVThe mgf is still E[etX]:

14

Page 15: 3.1 Continuous Random Variables - GitHub Pages

Percentiles

▫ For example, the 60th percentile is the number, 𝜋𝜋𝑝𝑝 (𝑜𝑜𝑒𝑒 𝑥𝑥), such that 𝐹𝐹(𝜋𝜋𝑝𝑝) = 0.6

15

Page 16: 3.1 Continuous Random Variables - GitHub Pages

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

Page 17: 3.1 Continuous Random Variables - GitHub Pages

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

Page 18: 3.1 Continuous Random Variables - GitHub Pages

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

Page 19: 3.1 Continuous Random Variables - GitHub Pages

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