PowerPoint

advertisement
Continuous distributions
Five important continuous distributions:
1. uniform distribution (contiuous)
2. Normal distribution
3. c2 –distribution
[“ki-square”]
4. t-distribution
5. F-distribution
1
lecture 5
A reminder
Definition:
Let X: S  R be a continuous random variable.
A density function for X, f (x), is defined by:
1. f (x)  0 for all x
2.

f ( x ) dx  1

3. P ( a  X  b ) 
b

a
2
P(a<X<b)
f (x)

f ( x ) dx
a
b
x
lecture 5
Uniform distribution
Definition
Definition:
Let X be a random variable. If the
density function is given by
f ( x) 
1
BA
1
B A
A x B
then the distribution of X is the
(continuous) uniform distribution on
the interval [A,B].
3
f (x)
A
B
lecture 5
x
Uniform distribution
Mean & variance
Theorem:
Let X be uniformly distributed on the interval [A,B].
Then we have:
• mean of X:
• variance of X:
4
E(X ) 
AB
2
Var ( X ) 
( B  A)
2
12
lecture 5
Normal distribution
Definition
Definition:
Let X be a continuous random variable.
If the density function is given by
f ( x) 

1
2 s
e
1
2s
2

xm 
2
  x
2
then the distribution of X is called the normal distribution
with parameters m and s2 (known).
My notation:
The book’s:
5
X ~ N (m ,s )
2
n ( x; m , s )
for density function
lecture 5
Normal distribution
Examples
The normal distribution is without doubt the most important
continuous distribution, since many phenomena are well
described by it.
IQ among AAU students
0.04
0.08
0.03
0.06
0.02
0.04
0.01
0.02
0
90
6
Height among AAU students
100
110
120
130
140
150
0
160
170
180
190
Plotting in Matlab:
>> x=90:1:150; y=normpdf(x,120,10); plot(x,y)
m s
200
lecture 5
Normal distribution
Mean & variance
Theorem:
If X ~ N(m,s2) then
• mean of X:
E(X )  m
• variance of X:
Var ( X )  s
2
Density function: 0.4
0.3
N(0,1)
N(1,1)
N(0,2)
0.2
0.1
0.0
7
-4
-2
0
x
2
4
lecture 5
Normal distribution
Standard normal distribution
Standard normal distribution: Z ~ N(0,1)
Density function:
Distribution function:

1
f (z) 
2
e
1
z
z
2
F ( z)  P (Z  z) 
2


1
2

e
1
z
2
0.4
(see Table A.3)
0.3
0.2
Notice!! Due to symmetry
P(Z  z) = 1 P(Z  z)
0.1
0.0
-3
-2
-1
0
1
2
3
P (1  Z  2) 
8
2

1
1
2

e
1
2
z
2
dz
lecture 5
2
dx
Normal distribution
Standard normal distribution
Standard normal distribution, N(0,1), is the only normal
distribution for which the distribution function is tabulated.
We typically have X~N(m,s2) where m  0 and s2  1.
Example:
X ~ N(1,4)
0.4
0.3
What is P( X > 3 ) ?
0.2
0.1
0.0
-2
9
0
2
4
lecture 5
Normal distribution
Standard normal distribution
Theorem: Standardise
X m
If X ~ N(m,s2) then
~ N 0 ,1 
s
Example cont.: X ~ N(1,4). What is P(X >3) ?
P ( X > 3)  P (
X 1
>
2
3 1
)  P ( Z > 1)  1  P ( Z  1)  0 . 1587
2
0.4
Z ~ N(0,1)
X ~ N(1,4)
0.3
0.4
0.2
Equal areas = 0.1587
0.2
0.1
0.1
0.0
0.0
-2
10
0
2
Z ~ N(0,1)
0.3
4
-2
0
2
lecture 5
4
Normal distribution
Standard normal distribution
0.4
0.3
0.2
0.1
0.0
-2
P ( Z  1)  0 . 8413
11

0
2
4
P ( X > 3 )  1  P ( Z  1)  1  0 .8413  0 .1587
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:
>> 1 – normcdf(3,1,2)
ans =
0.1587
Solution in R:
> 1 - pnorm(3,1,2)
[1] 0.1586553
12
Cumulative distribution function
normcdf(x,m,s)
Cumulative distribution function
pnorm(x,m,s)
lecture 5
Normal distribution
Example
Problem:
The lifetime of a light bulb is normal
distributed with mean 800 hours and
standard deviation 40 hours:
0.010
0.008
0.006
0.004
0.002
0.000
650
700
750
800
850
900
1. Find the probability that the lifetime of a bulb is between
750-850 hours.
2. Find the number of hours b, such that the probability of a
bulb having a lifetime longer than b is 90%.
3. Find a time period symmetric around the mean so that the
probability of a lifetime in this interval has probability 95%
13
lecture 5
950
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
np (1  p )
Rule of thumb:
If np>5 and n(1p)>5, then
the approximation is good
15
0 .0 0
0 .0 5
is approximately normal distributed.
0 .1 5
X  np
0 .1 0
Z 
0
5
10
15
lecture 5
20
Normal distribution
Linear combinations
Theorem: linear combinations
If X1, X2,..., Xn are independent random variables, where
X
~ N ( μ i ,σ i ), for i  1 ,2 , ,n ,
2
i
and a1,a2,...,an are constant, then the linear combination
Y  a 1 X 1  a 2 X 2    a n X n ~ N ( m Y , s Y ),
2
where
m Y  a1 m 1  a 2 m 2    a n m n
s Y  a1 s 1  a 2 s 2    a n s n
2
16
2
2
2
2
2
2
lecture 5
The c2 distribution
Definition
Definition: (alternative to Walpole, Myers, Myers & Ye)
If Z1, Z2,..., Zn are independent random variables, where
for i =1,2,…,n,
Zi ~ N(0,1),
then the distribution of
n
2
2
2
Y  Z1  Z 2    Z n 

Zi
2
i 1
2
is the c -distribution with n degrees of freedom.
Notation:
17
Y ~ c (n)
2
Critical values: Table A.5
lecture 5
The c2 distribution
Definition
Definition: A continuous random variable X follows a c2distribution with n degrees of freedom if it has density
function
1
n 2 1  x 2
f ( x) 
2
n 2
 (n 2)
e
Y ~ c2(1)
0.5
0.4
Y ~ c2 (3)
0.3
0.2
Y ~ c2 (5)
0.1
0.0
0
18
x
2
4
6
8
10
for x > 0
Antag Y ~ c2(n)
E(Y)
Var(Y)
=n
= 2n
E(Y/n) = 1
Var(Y/n) = 2/n
lecture 5
t-distribution
Definition
Definition:
Let Z ~ N(0,1) and V ~ c2(n) be two independent
random variables. Then the distribution of
T 
Z
V
n
is called the t-distribution with n degrees of freedom.
Notation: T ~ t(n)
19
Critical values: Table A.4
lecture 5
t-distribution
Compared to standard normal
0.4
X ~ N(0,1)
0.3
T ~ T(3)
0.2
T ~ T(1)
0.1
0.0
-3
-2
-1
0
1
2
3
•The t-distribution is symmetric around 0
•The t-distribution is more flat than the standard normal
•The more degrees of freedom the more the tdistribution looks like a standard normal
20
lecture 5
F-distribution
Definition
Definition:
Let U ~ c2(n1) and V ~ c2(n2) be two independent random
variables. Then the distribution of
U
F 
n1
V
n2
is called the F-distribution with n1 and n2 degrees of
freedom.
Notation: F ~ F(n1 , n2)
21
Critical values: Table A.6
lecture 5
F-distribution
Example
F ~ F(20,50)
1.0
F ~ F(10,30)
0.8
0.6
F ~ F(6,10)
0.4
0.2
0.0
0
22
1
2
3
4
lecture 5
Download