Goodness of Fit - Chi Square Test-1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

TESTING FOR GOODNESS

OF FIT BASED ON CHI


SQUARE DISTRIBUTION
BY,
21M126 – KIRUBHACHARAN G
21M127 – LOKESHWARAN PR
21M128 – LOKESHWARAN S
21M129 – MADHAN Y
21M130 – MADHUMITHRA E
21M132 – MITHUN PRANESH V
21M133 – MOHAMED BAYASKHAN M
GOODNESS OF FIT
• We describe a formal goodness-of-fit test procedure based on the
Chi-square distribution.
• The test procedure requires a random sample of size n from the
population whose probability distribution is unknown.
• These n observations are arranged in a frequency histogram, having k
class intervals.
• Let Oi be the observed frequency in the ith class interval. From the
hypothesized probability distribution, we compute the expected
frequency in the ith class interval, denoted Ei. The test statistic is

X02
• One point to be noted in the application of this test procedure concerns the
magnitude of the expected frequencies. If these expected frequencies are too
small, the test statistic will not reflect the departure of observed from
expected.

• There is no general agreement regarding the minimum value of expected


frequencies.

In our method, if the Expected frequency is less than 5, we combine with the
previous one.

Here the class interval k should also be altered accordingly.


CRITERIA TO REJECT H0:
X02> Xα,k-m2
Where
• X02 is the computed value of the test statistic
• Xα,k-m2 probability under the chi-square distribution with (k - m) degrees of
freedom
• k- No. of terms in the formula of X02 (or)
No. of class intervals.
• m represents the number of observed quantities of each class interval.
PROBLEM 1
• The number of defects in printed circuit boards is hypothesized to
follow a Poisson distribution. A random sample of n = 60 printed boards
has been collected, and the following number of defects observed

Number of Defects Observed Frequency


0 32
1 15
2 9
3 4

• Does the assumption of Poisson distribution seem appropriate as a


probability model for this data? Use α = 0.05.
Solution
• The mean number of defects per board

• To find the Probability p : (Poisson Distribution)


p() =
Take: =
ie p1= = 0.472 And = No. of Defects
p2 = = 0.354
p3 = = 0.133
p4 = 1 - ( p1+p2+p3) = 0.041

• The Expected Frequencies (Ei) are computed by multiplying the


sample size n = 60, times the probabilities pi. That is, Ei = npi.

No. of Probability Observed Expected No. of Probability Observed Expected


Defects Frequency Frequency Defects Frequency Frequency
0 0.472 32 28.32 0 0.472 32 28.32
1 0.354 15 21.24 1 0.354 15 21.24
2 0.133 9 7.98 2 (or more) 0.174 13 10.44
3 (or more) 0.041 4 2.46
Since the expected frequency in the last cell is less than 5, we
combine the last two cells.
• Testing of Hypothesis –
H0: The form of the distribution of defects is Poisson.
H1: The form of the distribution of defects is not Poisson.
Test Statistic:
X02
=+
X02 = 2.94
• Conclusion:
From the Table for Chi-Squared Distribution,
Xα,k-m 2 = X0.05,2 2 = 5.99
Here, α=0.05
Xα,k-m = 5.99
2
k=3
m=1
Here X02< Xα,k-m2 Then, k-m=2

ie. 2.94 < 5.99


Therefore we are unable to reject the null hypothesis,
that the distribution of defects in printed circuit boards
is Poisson
PROBLEM 2
The following is the distribution of the daily number of power failures reported in a western city
on 300 days:
Number of 0 1 2 3 4 5 6 7 8 9
power
failures
Number of 9 43 64 62 42 36 22 14 6 2
days

Test at the 0.05 level of significance whether the daily number of power failures in this city is a
random variable having the Poisson distribution with λ = 3.2.

POISSON DISTRIBUTION :p() =


EXPECTED VALUE: ∑oi x p()
Number of Number of poisson Expected value X02
power failures days(observed probability ∑oi x p()
value) p()
0 9 0.041 12.2 0.8
1 43 0.130 39 0.38
2 64 0.208 62.4 0.03
3 62 0.223 66.9 0.34
4 42 0.178 53.4 2.43
5 36 0.1140 34.2 0.09
6 22 0.0607 18.21 0.79
7 14 0.0277 8.31 3.914
8 6 0.0111 3.33 2.2
9 2 0.0039 1.17 0.736
∑oi=300 ∑Ei=299.12 X0211.71

7 22 0.0427 12.81 6.85


1. Null hypothesis : Random variable has a poisson distribution of λ=3.2
Alternate hypothesis : Random variable does not have the poisson distribution with λ=3.2
2. Level of significance : 0.05
3. Criteria : Reject null hypothesis if X02 > 14.07
(degree of freedom is 8- 1 = 7)
4.Calculation
test statistics : X02 = 11.71

5. Conclusion : Since X02 = 11.71 does not exceed 14.07, the null hypothesis cannot be rejected .
hence, we cannot reject that the poisson distribution with λ=3.2 provides a good fit at level of 5
percent.
PROBLEM 3
 Suppose that during 400 five-minute intervals the air-traffic control of an airport
received 0, 1, 2, . . . , or 13 radio messages with respective frequencies of 3, 15,
47, 76, 68, 74, 46, 39, 15, 9, 5, 2, 0 and 1..

With reference to the radio message data below , test at the 0.05 level of
significance whether the data can be looked upon as values of a random variable
having the Poisson distribution with λ = 4.6.
SOLUTION

1. Null hypothesis: Random variable has a Poisson distribution with λ = 4.6.

Alternative hypothesis: Random variable does not have the Poisson


distribution with λ = 4.6.

2. Level of significance: α = 0.05

3. Criterion: Reject the null hypothesis if χ2 > 16.919, the value of χ20.05 for

k − m = 10 − 1 = 9 degrees of freedom,

where χ2 is given by the formula


SOLUTION
4. Calculations: Substitution into the formula for χ2 yields

5. Decision: Since χ2 = 6.749 does not exceed 16.919, the null hypothesis cannot
be rejected; we cannot reject that the Poisson distribution with λ = 4.6 provides a
good fit at level α = 0.05.
THANK YOU..

You might also like