Slide set 12 Stat 330 (Spring 2015) Last update: January 28, 2015 Stat 330 (Spring 2015): slide set 12 Continuous Random Variables All properties of discrete RVs have direct counterparts for coninuous RVs. One basic difference: summations used in the case of discrete RVs are replaced by integrals. Summing over (uncountable) infinite many values corresponds to an integral. For e.g.,we define a cumulative distribution function (cdf) as follows: Definition: CDF of a X is a continuous random variable: The function FX (t) := P (X ≤ t) is called the cumulative distribution function of X. The only difference to the discrete case is that the cdf of a continuous variable is not a stairstep function. 1 Stat 330 (Spring 2015): slide set 12 Properties of FX The following properties hold for the cumulative distribution function FX for random variable X. • 0 ≤ FX (t) ≤ 1 for all t ∈ R • FX is monotone increasing, (i.e. if x1 ≤ x2 then FX (x1) ≤ FX (x2).) • limt→−∞ FX (t) = 0 and limt→∞ FX (t) = 1. However, there is slight difference from the discrete case: Definition: Probability Density Function For a continuous variable X with cumulative distribution function FX the density function of X is defined as: 0 fX (x) := FX (x). 2 Stat 330 (Spring 2015): slide set 12 Properties of density function f (x) A function fX is a density function of a random variable X, if (i) fX (x) ≥ 0 for all x, R∞ (ii) −∞ f (x)dx = 1. Relationship between fX and FX Since the density function fX is defined as the derivative of the cumulative distribution function, we can obtain the cumulative distribution function from the density by integrating: Rt • FX (t) = P (X ≤ t) = −∞ f (x)dx Rb • P (a ≤ X ≤ b) = a f (x)dx It follows that P (X = a) = P (a ≤ X ≤ a) = Ra a f (x)dx = 0. 3 Stat 330 (Spring 2015): slide set 12 Example: pdf Let Y be the time until the first major failure of a new disk drive. A possible density function for Y is f (y) = e−y 0 y>0 otherwise First, we need to check, that f (y) is actually a density function. Obviously, f (y) is a non-negative function on whole of <. The second condition, f must fulfill to be a density of Y is Z ∞ Z f (y)dy = −∞ ∞ e−y dy = −e−y |∞ 0 = 0 − (−1) = 1 0 4 Stat 330 (Spring 2015): slide set 12 Continuing the disk drive example... What is the probability that the first major disk drive failure occurs within the first year? Z P (Y ≤ 1) = 1 e−y dy = −e−y |10 = 1 − e−1 ≈ 0.63. 0 What is the cumulative distribution function of Y ? Z t FY (t) = Z f (y)dy = ∞ t e−y dy = 1 − e−t for all t ≥ 0. 0 5 Stat 330 (Spring 2015): slide set 12 Continuing the disk drive example... Density and Distribution functions of the random variable Y . 6 Stat 330 (Spring 2015): slide set 12 Compare discrete and continuous RVs discrete random variable image Im(X) finite or countable infinite cumulative distribution function: P FX (t) = P (X ≤ t) = k≤t pX (k) probability mass function: pX (x) = P (X = x) expected value: P E[h(X)] = x h(x) · pX (x) P E[X] = x x · pX (x) variance: 2 V ar[X] = E[(X − E[X]) ] P 2 x (x − E[X]) pX (x) continuous random variable image Im(X) uncountable Rt FX (t) = P (X ≤ t) = ∞ f (x)dx probability density function: 0 fX (x) = FX (x) R E[h(X)] = x h(x) · fX (x) R∞ E[X] = −∞ x · fX (x)dx = 2 V ar[X] = E[(X − E[X]) ] = R∞ (x − E[X])2fX (x)dx −∞ 7 Stat 330 (Spring 2015): slide set 12 Some special continuous density functions Uniform Density One of the most basic continuous density is the uniform density. The pdf is: 1 b−a if a < x < b 0 otherwise We say that X ∼ U (a, b) i.e., the random variable X is distributed as the Uniform distribution with parameters a and b f (x) = 8 Stat 330 (Spring 2015): slide set 12 Properties of the Uniform distribution The cumulative distribution function FX is 0 x−a Ua,b(x) := FX (x) = b−a 1 if x ≤ a if a < x < b if x ≥ b. We now compute the expected value and variance of a a uniform distribution on (a, b). Z b E[X] = x a 2 1 1 2b 1 dx = x |a = b−a b − a2 b − a2 1 = = (a + b). 2(b − a) 2 Z b a+b 2 1 (b − a)2 V ar[X] = (x − ) dx = . . . = . 2 b−a 12 a 9 Stat 330 (Spring 2015): slide set 12 Uniform distribution: Example The(pseudo) random number generator on my calculator is supposed to create realizations of U (0, 1) random variables. Define U as the next random number the calculator produces. What is the probability, that the next number is larger than 0.85? To answer that, we will compute P (U ≥ 0.85). We know the density function of U : fU (u) = Therefore Z 1 1−0 = 1. 1 P (U ≥ 0.85) = 1du = 1 − 0.85 = 0.15. 0.85 10