You are on page 1of 11

Outline

Introduction
Hypothesis testing
Exercises

Chapter 13 - Lecture 2
Goodness of fit tests

Andreas Artemiou

April 28th, 2010

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline
Introduction
Hypothesis testing
Exercises

Introduction

Hypothesis testing
Test for multinomial experiments
Multinomial experiments with underlying discrete distribution
Multinomial experiments with underlying continuous
distribution
Multinomial experiments with underlying distribution that has
unknown parameters

Exercises

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline
Introduction
Hypothesis testing
Exercises

Review

I We will see some tests, which are used to test if a random


variable fits a specific distribution.
I If we go back to Chapter 9, we have seen how to test if we
have a fair coin (Coin is a binomial experiment) since it has
only two outcomes.
I Now we will see how to make the test if we have multiple
outcomes, for example rolling a die (this is a multinomial
experiment since there are more than two possible outcomes)

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline Test for multinomial experiments
Introduction Multinomial experiments with underlying discrete distribution
Hypothesis testing Multinomial experiments with underlying continuous distribution
Exercises Multinomial experiments with underlying distribution that has un

Hypothesis test

I Null Hypothesis: Null Hypothesis: H0 : p1 = p10 , . . . , pk = pk0


I Alternative Hypothesis: HA : not H0
k
X (Oi Ei )2
I Test statistic: 2 =
Ei
i=1
I Rejection Region: 2 2,k1
I The conditions so that the test is valid, is to ensure that in
every cell Ei 5.
I If this is not true then we can merge cells together.

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline Test for multinomial experiments
Introduction Multinomial experiments with underlying discrete distribution
Hypothesis testing Multinomial experiments with underlying continuous distribution
Exercises Multinomial experiments with underlying distribution that has un

Construction of test for multinomial experiments through


example

I Assume that we roll a die, 120 times and we want to see if the
die is fair at significance level 0.01.

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline Test for multinomial experiments
Introduction Multinomial experiments with underlying discrete distribution
Hypothesis testing Multinomial experiments with underlying continuous distribution
Exercises Multinomial experiments with underlying distribution that has un

Example

I The probabilities in a multinomial experiment might come


from a distribution and they do not have to be equal.
I For example. Assume that every day that I drive to the
university I have 3 traffic lights on my way. I believe that the
probability of each traffic light to be red is 0.2.
I What is the distribution of X?
I For 300 days, I record the data of the traffic lights that I see
red. 100 days I find no traffic lights red. 80 days I find 1 red
traffic light, 60 days 2 red traffic lights and the rest I find all
three traffic lights red. At significance level 0.025 is there
evidence from the data that my believe for the distribution for
X is correct?

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline Test for multinomial experiments
Introduction Multinomial experiments with underlying discrete distribution
Hypothesis testing Multinomial experiments with underlying continuous distribution
Exercises Multinomial experiments with underlying distribution that has un

Example

I Let assume that I believe the midterm scores follow normal


distribution with mean 75 and variance 400.
I I want to make a test using 6 categories.
I My class has 100 students from which 10 scored below 55.6,
25 between 55.6 and 66.4, 20 between 66.4 and 75, 22
between 75 and 83.6, 13 between 83.6 and 94.4 and the rest
more than 94.4.
I At significance level 0.01 is there evidence from the data that
my believe for the distribution of the scores is correct?

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline Test for multinomial experiments
Introduction Multinomial experiments with underlying discrete distribution
Hypothesis testing Multinomial experiments with underlying continuous distribution
Exercises Multinomial experiments with underlying distribution that has un

Hypothesis test

I Null Hypothesis: Null Hypothesis: H0 : p1 = p10 , . . . , pk = pk0


I Alternative Hypothesis: HA : not H0
k
2
X (Oi Ei )2
I Test statistic: =
Ei
i=1
I Rejection Region: 2
2,k1p
I The conditions so that the test is valid, is to ensure that in
every cell Ei 5.
I If this is not true then we can merge cells together.
I p is the number of estimated parameters. To estimate them,
we use the MLE method.

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline Test for multinomial experiments
Introduction Multinomial experiments with underlying discrete distribution
Hypothesis testing Multinomial experiments with underlying continuous distribution
Exercises Multinomial experiments with underlying distribution that has un

Example

I M and Ms packages contain yellow, green and red colored M


and Ms. The distribution is described as: pY = 2 ,
pG = 2(1 ), pR = (1 )2 .
I Perform a test to see if the above model is correct given that I
counted 1000 M and Ms found in packages and I had 300
yellow, 400 green and 300 red. Use significance level 0.05.

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline Test for multinomial experiments
Introduction Multinomial experiments with underlying discrete distribution
Hypothesis testing Multinomial experiments with underlying continuous distribution
Exercises Multinomial experiments with underlying distribution that has un

Example

I The Midterm 1 scores are: 38, 39, 43, 43, 46, 46, 46, 47, 51,
52, 53, 54, 58, 58, 60, 63, 64, 66, 66, 67, 67, 68, 69, 75, 76,
76, 78, 78, 79, 82, 83, 85, 87, 96, 97, 99.
I The
P 2average of the 36 numbers are 65.4 and the
xi = 164137.
I Test to see if they come from normal distribution at
significance level 0.05 using 5 categories.

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests


Outline
Introduction
Hypothesis testing
Exercises

Exercises

I Section 13.1 page 714


I Exercises 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11.
I Section 13.2 page 726
I Exercises 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22

Andreas Artemiou Chapter 13 - Lecture 2 Goodness of fit tests

You might also like