Continuous Distributions
Continuous Distributions
Continuous Distributions
2. Normal distribution
3. χ2 –distribution [“ki-square”]
4. t-distribution
5. F-distribution
1 lecture 5
A reminder
Definition:
Let X: S → R be a continuous random variable.
2. ∫ f ( x) dx = 1
−∞ b
3. P (a < X < b) = ∫ f ( x) dx
a a b x
2 lecture 5
Uniform distribution
Definition
Definition:
Let X be a random variable. If the f (x)
density function is given by 1
1 B− A
f ( x) = A≤ x≤ B
B− A x
A B
then the distribution of X is the
(continuous) uniform distribution on
the interval [A,B].
3 lecture 5
Uniform distribution
Mean & variance
Theorem:
Let X be uniformly distributed on the interval [A,B].
Then we have:
A+ B
• mean of X: E( X ) =
2
( B − A) 2
• variance of X: Var ( X ) =
12
4 lecture 5
Normal distribution
Definition
Definition:
Let X be a continuous random variable.
If the density function is given by
1 −
1
( x − µ )2
f ( x) = 2σ
−∞ < x < ∞
2
e
2πσ 2
My notation: X ~ N (µ ,σ 2 )
The book’s: n( x; µ , σ ) for density function
5 lecture 5
Normal distribution
Examples
The normal distribution is without doubt the most important
continuous distribution, since many phenomena are well
described by it.
0.03 0.06
0.02 0.04
0.01 0.02
0 0
90 100 110 120 130 140 150 160 170 180 190 200
Plotting in Matlab:
>> x=90:1:150; y=normpdf(x,120,10); plot(x,y)
µ σ
6 lecture 5
Normal distribution
Mean & variance
Theorem:
If X ~ N(µ,σ2) then
• mean of X: E( X ) = µ
• variance of X: Var ( X ) = σ 2
0.3
N(0,1)
0.2
N(1,1)
0.1 N(0,2)
0.0
7 -4 -2 0 2 4 lecture 5
x
Normal distribution
Standard normal distribution
Standard normal distribution: Z ~ N(0,1)
Density function: Distribution function:
z 1
1 1 − 2 z2
∫
1 − z2
f ( z) = e 2 F ( z ) = P( Z ≤ z ) = e dx
2π −∞ 2π
0.4
0.3
(see Table A.3)
0.2
0.1
Notice!! Due to symmetry
0.0
P(Z ≤ −z) = 1− P(Z ≤ z)
-3 -2 -1 0 1 2 3
2 1
1 − 2 z2
P (−1 ≤ Z ≤ 2) = ∫
−1 2π
e dz
8 lecture 5
Normal distribution
Standard normal distribution
0.3
0.1
0.0
-2 0 2 4
9 lecture 5
Normal distribution
Standard normal distribution
Theorem: Standardise
X −µ
If X ~ N(µ,σ2) then ~ N (0 ,1)
σ
Example cont.: X ~ N(1,4). What is P(X >3) ?
X −1 3 −1
P( X > 3) = P( > ) = P( Z > 1) = 1 − P( Z ≤ 1) = 0.1587
2 2
0.4 0.4
Z ~ N(0,1)
Z ~ N(0,1)
0.3
X ~ N(1,4) 0.3
0.2 0.2
Equal areas = 0.1587
0.1 0.1
0.0 0.0
-2 0 2 4 -2 0 2 4
10 lecture 5
Normal distribution
Standard normal distribution
0.4
0.3
0.2
0.1
0.0
-2 0 2 4
11 lecture 5
Normal distribution
Standard normal distribution
Example cont.: X ~ N(1,4). What is P(X >3) ?
P( X > 3) = 1 − P( X ≤ 3) = 0.1587
Solution in Matlab:
Cumulative distribution function
>> 1 – normcdf(3,1,2)
normcdf(x,µ,σ)
ans =
0.1587
Solution in R:
> 1 - pnorm(3,1,2) Cumulative distribution function
[1] 0.1586553 pnorm(x,µ,σ)
12 lecture 5
Normal distribution
Example
0.010
Problem: 0.008
0.002
standard deviation 40 hours: 0.000
13 lecture 5
Normal distribution
Example
Solution in Matlab:
1. P(750 < X < 850) = ?
>> normcdf(850,800,40)-normcdf(750,800,40)
2. ?
3. ...
Solution in R:
1. P(750 < X < 850) = ?
> pnorm(850,800,40)-pnorm(750,800,40)
2. P(X > b) = 0.90 ⇔ P(X ≤ b) = 0.10
> qnorm(0.1,800,40)
3. ...
14 lecture 5
Normal distribution
Relation to the binomial distribution
If X is binomial distributed with parameters n and p,
then
X − np
Z=
np (1 − p )
0
.1
5
is approximately normal distributed.
0
.1
0
0
.0
5
Rule of thumb:
If np>5 and n(1−p)>5, then
0
.0
0
0 5 10 15 20
15 lecture 5
Normal distribution
Linear combinations
Theorem: linear combinations
If X1, X2,..., Xn are independent random variables, where
X i ~ N ( μi ,σ i2 ), for i = 1,2 , ,n,
and a1,a2,...,an are constant, then the linear combination
Y = a1 X 1 + a2 X 2 + + an X n ~ N ( µY , σ Y ),
2
where
µY = a1µ1 + a2 µ 2 + + an µ n
σ Y2 = a12σ 12 + a22σ 22 + + an2σ n2
16 lecture 5
The χ2 distribution
Definition
i =1
2
is the χ -distribution with n degrees of freedom.
17 lecture 5
The χ2 distribution
Definition
Definition: A continuous random variable X follows a χ2-
distribution with n degrees of freedom if it has density
function 1 n 2 −1 − x 2
f ( x) = x e for x > 0
2 Γ(n 2)
n2
18 lecture 5
t-distribution
Definition
Definition:
2
Let Z ~ N(0,1) and V ~ χ (n) be two independent
random variables. Then the distribution of
Z
T=
V
n
is called the t-distribution with n degrees of freedom.
19 lecture 5
t-distribution
Compared to standard normal
0.4
X ~ N(0,1)
0.3
0.2
T ~ T(3)
0.1 T ~ T(1)
0.0
-3 -2 -1 0 1 2 3
Definition:
Let U ~ χ (n1) and V ~ χ (n2) be two independent random
2 2
21 lecture 5
F-distribution
Example
F ~ F(20,50)
1.0
0.8 F ~ F(10,30)
0.6
0.4
F ~ F(6,10)
0.2
0.0
0 1 2 3 4
22 lecture 5