22
lecture 5 1 Continuous distributions e important continuous distributions: niform distribution (contiuous) ormal distribution 2 –distribution [“ki-square”] -distribution -distribution

Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution 2 –distribution[“ki-square”]

Embed Size (px)

Citation preview

Page 1: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 51

Continuous distributions

Five important continuous distributions:

1. uniform distribution (contiuous)

2. Normal distribution

3. 2 –distribution [“ki-square”]

4. t-distribution

5. F-distribution

Page 2: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 52

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.

3.

f (x)

xba

P(a<X<b)

1)( dxxf

b

a

dxxfbXaP )()(

Page 3: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 53

Uniform distributionDefinition

Definition: Let X be a random variable. If the density function is given by

then the distribution of X is the (continuous) uniform distribution on the interval [A,B].

xA B

f (x)

BxAAB

xf

1

)(AB

1

Page 4: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 54

Uniform distributionMean & variance

Theorem:Let X be uniformly distributed on the interval [A,B]. Then we have:

• mean of X:

• variance of X: 12

)()(

2)(

2ABXVar

BAXE

Page 5: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 55

Normal distribution Definition

Definition:Let X be a continuous random variable. If the density function is given by

then the distribution of X is called the normal distribution with parameters and 2 (known).

My notation:

The book’s: for density function

xexf

x 222

1

22

1)(

),;(

),(~ 2

xn

NX

Page 6: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 56

Normal distributionExamples

The normal distribution is without doubt the most important continuous distribution, since many phenomena are well described by it.

IQ among AAU students Height among AAU students

90 100 110 120 130 140 1500

0.01

0.02

0.03

0.04

160 170 180 190 2000

0.02

0.04

0.06

0.08

Plotting in Matlab:>> x=90:1:150; y=normpdf(x,120,10); plot(x,y)

Page 7: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 57

Normal distributionMean & variance

Theorem:If X ~ N(,) then

• mean of X:

• variance of X:

Density function:

N(1,1)N(0,2)

N(0,1)

2)(

)(

XVar

XE

-4 -2 0 2 4

0.0

0.1

0.2

0.3

0.4

x

Page 8: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 58

Normal distributionStandard normal distribution

Standard normal distribution: Z ~ N(0,1)

Density function: Distribution function:

(see Table A.3)

Notice!! Due to symmetryP(Z z) = 1P(Z z)

2

2

1

2

1)(

zezf

zz

dxezZPzF2

2

1

2

1)()(

2

1

2

1 2

2

1)21( dzeZP

z

-3 -2 -1 0 1 2 3

0.0

0.1

0.2

0.3

0.4

Page 9: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 59

We typically have X~N() where and .

Normal distributionStandard normal distribution

Standard normal distribution, N(0,1), is the only normal distribution for which the distribution function is tabulated.

Example: X ~ N(1,4)

What is P( X 3 ) ?

-2 0 2 4

0.0

0.1

0.2

0.3

0.4

Page 10: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

1587.0)1(1)1()2

13

2

1()3(

ZPZP

XPXP

-2 0 2 4

0.0

0.1

0.2

0.3

0.4

-2 0 2 4

0.0

0.1

0.2

0.3

0.4

lecture 510

Normal distributionStandard normal distribution

Example cont.: X ~ N(1,4). What is P(X 3) ?

Theorem: Standardise

If X ~ N(,2) then

Z ~ N(0,1)X ~ N(1,4)

Equal areas = 0.1587

Z ~ N(0,1)

10~ ,NX

Page 11: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

Normal distributionStandard normal distribution

lecture 511

-2 0 2 4

0.0

0.1

0.2

0.3

0.4

15870841301)1(1)3(8413.0)1( ..ZPXPZP

Page 12: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

Normal distributionStandard normal distribution

lecture 512

1587.0)3(1)3( XPXPExample cont.: X ~ N(1,4). What is P(X 3) ?

Solution in Matlab: >> 1 – normcdf(3,1,2) ans =

0.1587

Cumulative distribution functionnormcdf(x,,)

Solution in R: > 1 - pnorm(3,1,2) [1] 0.1586553

Cumulative distribution functionpnorm(x,,)

Page 13: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 513

Normal distributionExample

Problem:The lifetime of a light bulb is normal distributed with mean 800 hours and standard deviation 40 hours:

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%

650 700 750 800 850 900 950

0.000

0.002

0.004

0.006

0.008

0.010

Page 14: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

Normal distributionExample

lecture 514

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. ...

Page 15: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 515

Normal distributionRelation to the binomial distribution

)1( pnp

npXZ

If X is binomial distributed with parameters n and p, then

is approximately normal distributed.

Rule of thumb:If np5 and n(p)5, then the approximation is good

0 5 10 15 20

0.00

0.05

0.10

0.15

Page 16: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 516

Normal distributionLinear combinations

Theorem: linear combinationsIf X1, X2,..., Xn are independent random variables, where

and a1,a2,...,an are constant, then the linear combination

where

, for ,n,,i,σμNX iii 21),(~ 2

,( ),~ 22211 YYnn NXaXaXaY

2222

22

21

21

2

2211

nnY

nnY

aaa

aaa

Page 17: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 517

The distributionDefinition

Definition: (alternative to Walpole, Myers, Myers & Ye)If Z1, Z2,..., Zn are independent random variables, where

Zi ~ N(0,1), for i =1,2,…,n,

then the distribution of

is the -distribution with n degrees of freedom.

Notation: Critical values: Table A.5

n

iin ZZZZY

1

2222

21

)(~ 2 nY

Page 18: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

0 2 4 6 8 10

0.0

0.1

0.2

0.3

0.4

0.5

The distributionDefinition

lecture 518

Definition: A continuous random variable X follows a -distribution with n degrees of freedom if it has density function

0

)2(2

1)( 212

2

xex

nxf xn

n for

Y ~ 2(1)

Y ~ 2 (3)

Y ~ 2 (5)

Antag Y ~ 2(n)

E(Y) = nVar(Y) = 2n

E(Y/n) = 1Var(Y/n) = 2/n

Page 19: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 519

t-distributionDefinition

Definition: Let Z ~ N(0,1) and V ~ (n) be two independent random variables. Then the distribution of

is called the t-distribution with n degrees of freedom.

Notation: T ~ t(n) Critical values: Table A.4

nV

ZT

Page 20: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

t-distributionCompared to standard normal

lecture 520

X ~ N(0,1)

T ~ T(3)

-3 -2 -1 0 1 2 3

0.0

0.1

0.2

0.3

0.4

T ~ T(1)

•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 t-distribution looks like a standard normal

Page 21: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

lecture 521

F-distribution Definition

Definition: Let U ~ 2(n1) and V ~ 2(n2) be two independent random variables. Then the distribution of

is called the F-distribution with n1 and n2 degrees of freedom.

Notation: F ~ F(n1 , n2) Critical values: Table A.6

2

1

nV

nU

F

Page 22: Lecture 5 1 Continuous distributions Five important continuous distributions: 1.uniform distribution (contiuous) 2.Normal distribution  2 –distribution[“ki-square”]

0 1 2 3 4

0.0

0.2

0.4

0.6

0.8

1.0

F-distribution Example

lecture 522

F ~ F(10,30)

F ~ F(6,10)

F ~ F(20,50)