Professional Documents
Culture Documents
Outline
n Goodness of Fit
n Squared Error
n Chi-Square Statistic
2
Readings
3
Goodness of Fit
4
Example
n Assume we observed the # of people
obtaining grades A, B, C, D, E last year in
Simulation class:
A B C D E
Observed # 20 15 12 3 0
A B C D E
Observed # 20 15 12 3 0
Postulated probability 0.2 0.2 0.2 0.2 0.2
Expected # 10 10 10 10 10
A B C D E
Observed # 20 15 12 3 0
Postulated probability 0.2 0.2 0.2 0.2 0.2
Expected # 10 10 10 10 10
n ∑$
!"#(𝑁! − 𝑛𝑝! )
%
9
Squared Error Example
n (20 − 10)! +(15 − 10)! +(12 − 10)!
+(3 − 10)! +(0 − 10)! = 278
10
Squared Error Example 2
12
Squared Error Example 2
A B C D E
Observed # 20 15 12 3 0
Postulated probability 0.4 0.2 0.2 0.2 0
Expected # 20 10 10 10 0
13
Squared Error Example
n (20 − 10)! +(15 − 10)! +(12 − 10)!
+(3 − 10)! +(0 − 0)! = 78
14
Two Issues with Squared Error
15
Solution to Scale Issue
% " !
!
(𝑁 − 𝑛𝑝" )
𝑋 =#
𝑛𝑝"
"#$
16
Solution to Quality Issue
17
Squared Error Example 3
n Given the following data: 102, 112, 131,
107, 114, 95, 133, 145, 139, 117
18
Squared Error Example 3
19
Chi-Square Test
n Main idea: evaluate how extreme this Chi-
Square statistic is!
20
Chi-Square Test
n Null hypothesis
n 𝐻" : The observed data is following the
postulated distribution
n We need to evaluate
P ( observing a value as large or greater than
the current chi-square statistic | 𝐻& is true )
=P(𝑋 ! ≥t)=p-value
If low (typically ≤ 0.05), then
we have evidence to reject H0 21
'
$ #
(𝑁 − 𝑛𝑝$ )
𝑋# = $
Chi-Square Test $%&
𝑛𝑝$
22
Chi-Square Distribution
Degrees of
freedom
https://commons.wikimedia.org/wiki/File:Chi-square_pdf.svg 23
Chi-Square Table
24
So how do we use the Chi-
Square distribution?
n Assume a significance level, alpha
n Frequently assumed 0.05
26
Method 1: Critical Value
n Determine the Chi-Square critical value for
the given alpha and df
n If Chi-Square statistic > critical value,
reject null hypothesis
n Otherwise, do not have evidence to reject
null hypothesis
2.Find df
3.Determine alpha
33
Steps in Input Analysis
1. Data Collection
2. Data Analysis
a) Plots (especially histogram!)
b) Summary Statistics & Observations
c) Independence Tests
3. Fitting a Distribution
4. Goodness of Fit (GOF) Tests
5. Return to Step 1, 2 or 3 ifGOFispoor!
34
CAUTION!
n Input Analyzer cannot always give us
conclusive evidence
n What if the p-value of the best fit
distribution is very low?
35
So…
n You need to perform all steps
previously described!
36
Questions?
37