<<

ST 370 Probability and for Engineers Continuous Random Variables

Recall that when a takes values in an entire interval, the variable is called continuous.

Example: Flash unit recharge time The time that a flash unit takes to recharge could be any positive real number, in the interval (0, ∞).

1 / 19 Continuous Random Variables Probability Density Functions ST 370 Probability and Statistics for Engineers Probability Density Functions

Suppose that we measure a random quantity X like a recharge time, but only to limited precision (such as to a certain number of decimal places), with values x1, x2, ...

With no decimal places, x1 = 0, x2 = 1, ...

With one decimal place, x1 = 0.0, x2 = 0.1, ...

Then the measured variable Y is discrete, with a probability mass function fY (xi ) = P(Y = xi ).

2 / 19 Continuous Random Variables Probability Density Functions ST 370 Probability and Statistics for Engineers

Suppose that the probability mass function of Y can be approximated by a smooth function fX (x):

fY (xi ) ≈ δx fX (xi ), where δx is the spacing of the xi .

The cumulative distribution function of Y is X FY (x) = fY (xi )

xi ≤x X ≈ δx fX (xi )

xi ≤x Z x ≈ fX (u)du. −∞

3 / 19 Continuous Random Variables Probability Density Functions ST 370 Probability and Statistics for Engineers

As δx is made smaller, Y becomes a better approximation to X , and

FX (x) = P(X ≤ x) = lim P(Y ≤ x) δx→0 Z x = fX (u)du. −∞

4 / 19 Continuous Random Variables Probability Density Functions ST 370 Probability and Statistics for Engineers

The smooth function fX (x) is the probability density function (pdf) of X .

Probability density functions have the properties:

fX (x) ≥ 0; R ∞ −∞ fX (x) dx = 1; R b P(a ≤ X ≤ b) = a fX (x) dx.

Any function with the first two properties could be the probability density function of some random variable X .

By the fundamental theorem of calculus,

Z x dFX (x) FX (x) = fX (u)du ⇒ fX (x) = . −∞ dx

5 / 19 Continuous Random Variables Probability Density Functions ST 370 Probability and Statistics for Engineers and

Just as the cumulative distribution function is: a sum for a discrete random variable; an integral for a continuous random variable, the expected value of a continuous random variable is an integral: Z ∞ µX = E(X ) = xfX (x) dx. −∞

Similarly for the variance Z ∞ 2 2 σX = V (X ) = (x − µX ) fX (x) dx. −∞

6 / 19 Continuous Random Variables Expected Value and Variance ST 370 Probability and Statistics for Engineers

Expected value of a function of X If Z = h(X ) is a function of the random variable X , then Z is also a random variable, with expected value Z ∞ E(Z) = E[h(X )] = h(x)fX (x) dx. −∞

Note that in general

E[h(X )] 6= h[E(X )], except in the special case of a linear function h(x) = ax + b:

E(aX + b) = aE(X ) + b, which follows from the properties of integrals (and sums).

7 / 19 Continuous Random Variables Expected Value and Variance ST 370 Probability and Statistics for Engineers Continuous Uniform Distribution

The simplest probability density function is that of the continuous uniform distribution, which is a constant over some interval [a, b]: ( 1 a ≤ x ≤ b f (x) = b−a 0 otherwise.

R graphs x <- c(-1, 0, 0, 0, 1, 1, 1, 2); pdf <- c(0, 0, NA, 1, 1, NA, 0, 0); cdf <- c(0, 0, 0, 0, 1, 1, 1, 1); par(mfrow = c(2, 1)); (x, pdf, type = "l"); plot(x, cdf, type = "l")

8 / 19 Continuous Random Variables Continuous Uniform Distribution ST 370 Probability and Statistics for Engineers

Expected value:

Z b  2  b 1 1 x a + b E(X ) = x dx = = . a b − a b − a 2 a 2 Variance: Z b 2 1 2 (b − a) V (X ) = (x − µX ) dx = . a b − a 12

9 / 19 Continuous Random Variables Continuous Uniform Distribution ST 370 Probability and Statistics for Engineers

The special case a = 0, b = 1 plays a central role in simulation of random variables.

If U is uniformly distributed on [0, 1] and FX (x) is any cumulative distribution function, then the random variable

−1 X = FX (U) has that cumulative distribution function.

So if we have a mechanism for simulating U (such as a pseudo-random number generator), and we can efficiently calculate −1 FX (u), we can simulate variables with any distribution (continuous or discrete).

10 / 19 Continuous Random Variables Continuous Uniform Distribution ST 370 Probability and Statistics for Engineers

The exponential distribution has the probability density function ( λe−λx x ≥ 0, f (x) = 0 x < 0. and cumulative distribution function Z x  λe−λudu = 1 − e−λx x ≥ 0, F (x) = 0 0 x < 0.

It is the continuous analog of the .

11 / 19 Continuous Random Variables Exponential Distribution ST 370 Probability and Statistics for Engineers

R graphs x <- c(-1, -0.001, NA, seq(from = 0, to = 3, length = 101)); pdf <- dexp(x); cdf <- pexp(x); par(mfrow = c(2, 1)); plot(x, pdf, type = "l"); plot(x, cdf, type = "l")

12 / 19 Continuous Random Variables Exponential Distribution ST 370 Probability and Statistics for Engineers

Note that 1 F −1(u) = − log(1 − u) λ so we can simulate an exponentially distributed random variable as 1 X = − log(1 − U) λ where U has the uniform distribution on [0, 1].

Since V = 1 − U is also uniformly distributed on [0, 1], we could write this more simply as 1 X = − log(V ). λ

13 / 19 Continuous Random Variables Exponential Distribution ST 370 Probability and Statistics for Engineers

Expected value: Z ∞ 1 E(X ) = xλe−λx dx = 0 λ Variance: Z ∞ 2 −λx 1 V (X ) = (x − λ) λe dx = 2 0 λ

14 / 19 Continuous Random Variables Exponential Distribution ST 370 Probability and Statistics for Engineers

Poisson process The Poisson process is a model for points distributed randomly on a line, such as the arrival times of customers in a queuing model.

It is characterized by the properties: The number of points that appear in an interval of length T has the with parameter θ = λT for some rate constant λ > 0; The numbers of points appearing in disjoint intervals are independent of each other.

15 / 19 Continuous Random Variables Exponential Distribution ST 370 Probability and Statistics for Engineers

Let X be the time of the first arrival. Then

FX (x) = P(X ≤ x) = 1 − P(X > x) = 1 − P(no points in [0, x]) = 1 − e−λx

So X is exponentially distributed with parameter λ; we can also show that the time from any arrival to the next arrival is exponentially distributed, with the same parameter.

The exponential distribution is often used to model inter-arrival times of events like customer arrivals, major oil spills, shipping accidents, and many others.

16 / 19 Continuous Random Variables Exponential Distribution ST 370 Probability and Statistics for Engineers

The probability density function of the Gamma distribution is

λr x r−1e−λx f (x) = x > 0 Γ(r) where Γ(r) is the , and λ > 0 and r > 0 are parameters of the distribution.

If r is an integer, the waiting time until the r th event in a Poisson process has this distribution, which in this case (r an integer) is called the distribution.

The exponential distribution is the special case r = 1.

17 / 19 Continuous Random Variables Gamma Distribution ST 370 Probability and Statistics for Engineers

Expected value: r E(X ) = λ Variance: r V (X ) = λ2

The Gamma distribution is the continuous time analog of the negative .

18 / 19 Continuous Random Variables Gamma Distribution ST 370 Probability and Statistics for Engineers

Another family that generalizes the exponential distribution is the Weibull distribution family, often used in reliability theory to model time to failure of some item or piece of equipment.

The probability density function is complicated, as are the formulas for the expected value and variance.

The properties of a Weibull random variable can be derived from the fact that, if X has the standard exponential distribution, and δ and β are positive, then W = δ × X 1/β has a Weibull distribution.

So if β = 1, X is an exponentially distributed random variable, and, if β 6= 1, X is some positive power of an exponentially distributed random variable.

19 / 19 Continuous Random Variables Weibull Distribution