0% found this document useful (0 votes)
24 views

Class Notes 5

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Class Notes 5

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Consider the events {X ≤ a} and {a < X ≤ b}.

These events are mutually exclusive, and

{X ≤ a} ∪ {a < X ≤ b} = {X ≤ b} .
So the addition law of probability (axiom A3)
gives:

Pr(X ≤ b) = Pr(X ≤ a) + Pr(a < X ≤ b) ,


or Pr(a < X ≤ b) = Pr(X ≤ b) − Pr(X ≤ a)
= FX (b) − FX (a) .

So, given the cdf for any continuous random


variable X, we can calculate the probability
that X lies in any interval.

Note: The probability Pr(X = a) that a


continuous rv X is exactly a is 0. Because of
this, we often do not distinguish between
open, half-open and closed intervals for
continous rvs.
Example: We gave earlier an example of a
continuous cdf:

 0, y < 0,
FY (y) =
 1 − e−y , y ≥ 0 .

This is the cdf of what is termed the


exponential distribution with mean 1.

For the case of that distribution, we can find

Pr(Y ≤ 1) = FY (1) = 1 − e−1 = 0.6322

Pr(2 ≤ Y ≤ 3) = FY (3) − FY (2)


= (1 − e−3) − (1 − e−2) = 0.0856

Pr(Y ≥ 2.5) = FY (∞) − FY (2.5)


= 1 − (1 − e−2.5) = 0.0821
Probability density function

If X is continuous, then Pr(X = x) = 0.


But what is the probability that ‘X is close to
some particular value x?’.
Consider Pr(x < X ≤ x + h), for small h.

d FX (x) F (x + h) − FX (x)
Recall: ' X .
dx h
So Pr(x < X ≤ x + h) = FX (x + h) − FX (x)
d FX (x)
' h .
dx

DEFINITION: The derivative (w.r.t. x) of


the cdf of a continous rv X is called the
probability density function of X.

The probability density function is the limit of


Pr(x < X ≤ x + h)
as h → 0 .
h
The probability density function

Alternative names: pdf,


density function,
density.

Notation for pdf: fX (x)


Recall: The cdf of X is denoted by FX (x)
d FX (x)
Relationship: fX (x) =
dx

Care needed: Make sure f and F cannot be


confused!

Interpretation
• When multiplied by a small number h,
the pdf gives, approximately, the probability
that X lies in a small interval, length h, close
to x.
• If, for example, fX (4) = 2 fX (7), then
X occurs near 4 twice as often as near 7.
Properties of probability density functions

Because the pdf of a rv X is the derivative of


the cdf of X, it follows that

• fX (x) ≥ 0, for all x,


Z ∞
• fX (x) dx = 1,
−∞
Z x
• FX (x) = fX (y)dy,
−∞
Z b
• Pr(a < X ≤ b) = fX (x)dx.
a
Mean and Variance

Reminder: for a discrete rv, the formulae for


mean and variance are based on the
probability function Pr(X = x). We need to
adapt these formulae for use with continuous
random variables.

DEFINITION:
For a continuous rv X with pdf fX (x), the
expectation of a function g(x) is defined as
Z ∞
E{g(X)} = g(x) fX (x) dx
−∞

Hence, for the mean:


Z ∞
E(X) = x fX (x) dx
−∞

Compare this with the equivalent definition


for a discrete random variable:
X X
E(X) = x Pr(X = x) , or E(X) = xpX (x) .
x x
For the variance, recall the definition.

Var(X) = E[{X − E(X)}2]


Z ∞
Hence Var(X) = (x − µ)2 fX (x) dx
−∞

As in the discrete case, the best way to


caclulate a variance is by using the result:

Var(X) = E(X 2) − {E(X)}2 .


In practice, we therefore usually calculate
Z ∞
E(X 2) = x2 fX (x) dx
−∞
as a stepping stone on the way to obtaining
Var(X).
The Uniform Distribution
Distribution of a rv which is equally likely to
take any value in its range, say a to b (b > a).

The pdf is constant:


6
fX (x)

1
b−a

a b
Because fX (x) is constant over [a, b] and
Z ∞ Z b
fX (x) dx = fX (x) dx = 1,
−∞ a

 1 , a < x < b,
b−a

fX (x) =
 0

elsewhere.
Uniform Distribution: cdf

For this distribution the cumulative


distribution function (cdf) is
Z x
FX (x) = fX (y) dy
−∞



 0, x < a,


= x−a , a ≤ x ≤ b ,

 b−a



1, x > b.

FX (x)
1 

 





 -
0
a b
Uniform Distribution: Mean and Variance
Z b
1
E(X) = µ = x dx
a b−a
= 1
2 (a + b).

Var(X) = σ 2 = E(X 2) − µ2

(a + b)2
Z b
1
= x2 dx −
a b−a 4

1
= (b − a)2.
12

For example, if a random variable is uniformly


distributed on the range (20,140), then
a = 20 and b = 140, so the mean is 80. The
variance is 1200, so the standard deviation is
34.64.
The exponential distribution

A continuous random variable X is said to


have an exponential distribution if its range is
(0, ∞) and its pdf is proportional to e−λx, for
some positive λ.

That is,

 0, x < 0,
fX (x) =
 ke−λx , x ≥ 0 ,

for some constant k. To evaluate k, we use


the fact that all pdfs must integrate to 1.

Hence
Z ∞ Z ∞
fX (x) dx = ke−λx dx
−∞ 0
kh −λx
i∞
= −e
λ 0
k
=
λ

Since this must equal 1, k = λ.


Properties of the exponential distribution

The distribution has pdf



 λe−λx, x ≥ 0 ,
fX (x) =
 0, x < 0.
and its cdf is given by
Z x
FX (x) = λe−λy dy
0
= 1 − e−λx, x > 0.

Mean and Variance


Z ∞
−λx 1
E(X) = x λe dx = .
0 λ
For the variance, we use integration by parts
to obtain
Z ∞
2
E(X 2) = x2 λe−λx dx = 2 .
0 λ

Hence Var(X) = E(X 2) − {E(X)}2


 2
2 1 1
= 2− = 2.
λ λ λ
The Normal Distribution

DEFINITION: A random variable X with


probability density function
2
1 − (x−µ)
fX (x) = √ e 2σ 2 ,
σ 2π
for all x, is said to have the Normal
distribution with parameters µ and σ 2.
It can be shown that E(X) = µ, Var(X) = σ 2.
We write: X ∼ N(µ, σ 2) .

Shape of the density function (pdf):


The pdf is symmetrical about x = µ.
It has a single mode at x = µ.
It has points of inflection at x = µ ± σ.
‘A bell-shaped curve,’ tails off rapidly.
Cumulative distribution function
If X ∼ N(µ, σ 2), the cdf of X is the integral:
2
− (x−µ)
Z x
1
FX (x) = √ e 2σ 2 dx.
−∞ σ 2π
This cannot be evaluated analytically.
Numerical integration is necessary: extensive
tables are available.
The Standardised Normal Distribution

The Normal distribution with mean 0 and


variance 1 is known as the standardised
Normal distribution (SND). We usually
denote a random variable with this
distribution by Z. Hence

Z ∼ N(0, 1).
Special notation φ(z) is used for the pdf of
N(0, 1). We write
1 − 1 z2
φ(z) = √ e 2 , −∞ < z < ∞.

The cdf of Z is denoted by Φ(z). We write
Z z
Φ(z) = φ(x) dx
−∞
1 − 1 x2
Z z
= √ e 2 dx
−∞ 2π

Tables of Φ(z) are available in statistical


textbooks and computer programs.
Brief extract from a table of the SND

Z Φ(z)
0.0 0.5000
0.5 0.6915
1.0 0.8413
1.5 0.9332
2.0 0.9772

Tables in textbooks and elsewhere contain


values of Φ(z) for z = 0, 0.01, 0.02, and so
on, up to z = 4.0 or further.
But the range of Z is (−∞, ∞), so we need
values of Φ(z) for z < 0. To obtain these
values we use the fact that the pdf of N(0, 1)
is symmetrical about z = 0.
This means that

Φ(z) = 1 − Φ(−z).
This equation can be used to obtain Φ(z) for
negative values of z.
For example, Φ(−1.5) = 1 − 0.9332 = 0.0668.

You might also like