Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
PHP 2510 Continuous random variables Important continuous distributions • Uniform • Exponential • Normal • chi-square Density functions Calculations using the normal distribution PHP 2510 – Oct 1, 200 1 Continuous random variables A continuous random variable X can take values over a continuum. In many cases this will be an interval on the real line R = {−∞, +∞}. The distribution of a continuous random variable is characterized by a density function f (x). The density function characterizes relative frequency. Unlike a mass function, a density function can take values greater than 1; therefore it should not be interpreted as a probability (more on this later). PHP 2510 – Oct 1, 200 2 Properties of density functions Let f (x) be the density function for a random variable X. Then 1. Probabilities are calculated in terms of area under the curve Z k2 f (x) dx P (k1 < X < k2 ) = k1 2. The density function integrates to 1 over the interval R Z ∞ f (x) dx = 1 −∞ 3. The cumulative distribution function is Z F (k) = P (X < k) = k f (x) dx −∞ These ideas are best illustrated with examples. PHP 2510 – Oct 1, 200 3 Uniform distribution The uniform distribution takes values in an interval [a, b]. Each of the values has the same relative frequency. The density function is f (x) = 1 b−a for values in the interval [a, b]. For values outside the interval, f (x) = 0. PHP 2510 – Oct 1, 200 4 Example. Suppose X has a uniform distribution on the interval [0, 5]. Find the following: • P (X < 2) • P (1.5 < X < 2) • The CDF • the average value E(X) PHP 2510 – Oct 1, 200 5 0.20 0.15 f.x 0.25 Uniform (0,5) 0 1 2 3 4 5 x PHP 2510 – Oct 1, 200 6 0.20 0.15 f.x 0.25 P(X<2) 0 1 2 3 4 5 x PHP 2510 – Oct 1, 200 7 0.20 0.15 f.x 0.25 P(1.5<X<2) 0 1 2 3 4 5 x PHP 2510 – Oct 1, 200 8 0.0 0.2 0.4 P(X<k) 0.6 0.8 1.0 P(X<k) 0 1 2 3 4 5 k PHP 2510 – Oct 1, 200 9 Uniform distribution f (x) = 1 5 Z P (X < 2) 2 1 2 dx = 5 5 2 .5 1 dx = = .1 5 5 = 0 Z P (1.5 < X < 2) = 1.5 Z F (k) = P (X ≤ k) = 0 k 1 x = 5 5 What is the average value of this uniform R.V.? PHP 2510 – Oct 1, 200 10 Exponential distribution The exponential distribution is useful for modeling waiting times on a continuous scale. It is characterized by a parameter θ, which represents the average waiting time. Its density is f (x) = 1 −x/θ e θ A more useful function is the survivor function, which captures the proportion remaining at time t S(t) = = = PHP 2510 – Oct 1, 200 P (X > t) Z ∞ 1 −x/θ e dx θ t e−t/θ 11 0.5 1.0 f1.x 1.5 2.0 Exponential Density Functions 0.0 0.2 0.4 0.6 0.8 1.0 x PHP 2510 – Oct 1, 200 12 0.6 0.2 0.4 S1.x 0.8 1.0 Exponential Survivor Fns 0.0 0.2 0.4 0.6 0.8 1.0 x PHP 2510 – Oct 1, 200 13 Normal distribution The normal (Gaussian) distribution is useful for describing the behavior of a continuous random variable. • Sometimes the normal model is used to describe a single random variable such as age, weight, blood pressure, IQ score, etc. • Distribution is symmetric and shaped like a bell (hence ‘bell shaped curve’) • It also can be used to describe the distribution of certain summary statistics, such as a sample mean. In fact the normal distribution is used far more often for applications of this type, than as a model for a single random variable. PHP 2510 – Oct 1, 200 14 Density function of the normal distribution A density function represents relative frequency of individual values of a random variable, and does not represent probability per se. A random variable X having a normal distribution is characterized by its mean µ and variance σ 2 . Its density function is given by the function · ¸ 2 1 (x − µ) √ f (x) = exp − 2σ 2 σ 2π (notice here that π represents the constant 3.14159....). PHP 2510 – Oct 1, 200 15 0.2 0.0 0.1 f.x 0.3 0.4 N(0,1) density −4 −2 0 2 4 x PHP 2510 – Oct 1, 200 16 0.4 0.0 0.2 f2.x 0.6 0.8 Normal Density, Sigma=1.5 and 0.5 −4 −2 0 2 4 x PHP 2510 – Oct 1, 200 17 0.2 0.0 0.1 f.x 0.3 0.4 P(X>2) −4 −2 0 2 4 x PHP 2510 – Oct 1, 200 18 Some properties of the normal distribution Mean and variance Z ∞ E(X) = x f (x) dx = µ −∞ ∞ Z var(X) = (x − µ)2 f (x) dx = σ 2 −∞ (No need to prove. ) Linear function of a normal random variable is normal. That is, if X ∼ N (µ, σ 2 ), then aX + b also follows a normal distribution. PHP 2510 – Oct 1, 200 19 Standard normal distribution The standard normal distribution has mean zero and variance one. A random variable having standard normal distribution is usually denoted by Z ∼ N (0, 1). Its density function is ½ 2 1 z f (z) = √ exp − 2 2π Tail areas are probabilities Z P (Z > z) = z ∞ ½ ¾ 2 1 z √ exp − 2 2π ¾ dz Tail areas are difficult to compute by hand but exist in tables PHP 2510 – Oct 1, 200 20 (Table A1, p. 744 in ABM), or can be computed using Stata etc. PHP 2510 – Oct 1, 200 21 Some probabilities associated with Z Areas in the right hand tail (from Table A.1) P (Z > 0) = 0.500 P (Z > 1) = 0.159 P (Z > 2) = 0.223 Can use symmetry to calculate other probabilities PHP 2510 – Oct 1, 200 P (Z < 0) = ··· P (Z < −1) = ··· P (Z < 1) = ··· P (−1 < Z < 2) = ··· 22 Standardizing a normal random variable If a random variable X is normally distributed with mean µ and variance σ 2 , then X −µ Z= σ has a standard normal distribution with mean zero and variance one. This allows us to calculate probabilities associated with any normal distribution. PHP 2510 – Oct 1, 200 23 Example – distribution of heights (From book). Let X denote height in cm of men randomly sampled from some population. Suppose the mean height is 173 and the standard deviation is 6.25. µ = σ2 = 173 6.252 We write X ∼ N (173, 6.252 ). PHP 2510 – Oct 1, 200 24 0.06 0.05 0.04 0.03 0.02 0.01 0.00 140 150 160 170 180 190 200 Height PHP 2510 – Oct 1, 200 25 Computations with the normal distribution To compute probabilities associated with X, must first convert to standard normal deviate Z. The standard normal deviate is tabulated in Appendix A.1. Suppose X ∼ N (µ, σ 2 ). Then X −µ ∼ N (0, 1) Z= σ Consequence: µ P (X > x) = P PHP 2510 – Oct 1, 200 x−µ Z> σ ¶ 26 Examples Suppose X ∼ N (173, 6.252 ). Find the following. P (X > 180) = · · · = P (Z > 1.20) = 0.115 P (X < 180) = · · · = 0.885 P (165 < X < 175) = · · · = P (−1.20 < Z < 0.40) = 0.54 What is the 90th percentile for heights? Ans = 181. PHP 2510 – Oct 1, 200 27