Test for randomness : Chi square test

Slides:



Advertisements
Similar presentations
1 Chi-Square Test -- X 2 Test of Goodness of Fit.
Advertisements

Lecture (11,12) Parameter Estimation of PDF and Fitting a Distribution Function.
Chi Squared Tests. Introduction Two statistical techniques are presented. Both are used to analyze nominal data. –A goodness-of-fit test for a multinomial.
Sections 7-1 and 7-2 Review and Preview and Estimating a Population Proportion.
Outline input analysis input analyzer of ARENA parameter estimation
Inference about the Difference Between the
Hypothesis Testing IV Chi Square.
© 2010 Pearson Prentice Hall. All rights reserved The Chi-Square Test of Independence.
Statistics.
Random Number Generation
A second example of Chi Square Imagine that the managers of a particular factory are interested in whether each line in their assembly process is equally.
Chapter 16 Chi Squared Tests.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 14 Goodness-of-Fit Tests and Categorical Data Analysis.
7-2 Estimating a Population Proportion
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Lecture Slides Elementary Statistics Eleventh Edition and the Triola Statistics Series by.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on Categorical Data 12.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Sections 6-1 and 6-2 Overview Estimating a Population Proportion.
Population All members of a set which have a given characteristic. Population Data Data associated with a certain population. Population Parameter A measure.
Chapter 7 Estimates and Sample Sizes
Tests for Random Numbers Dr. Akram Ibrahim Aly Lecture (9)
Basic Concepts in Number Theory Background for Random Number Generation 1.For any pair of integers n and m, m  0, there exists a unique pair of integers.
Chi-Square Procedures Chi-Square Test for Goodness of Fit, Independence of Variables, and Homogeneity of Proportions.
Chapter-8 Chi-square test. Ⅰ The mathematical properties of chi-square distribution  Types of chi-square tests  Chi-square test  Chi-square distribution.
Sections 7-1 and 7-2 Review and Preview and Estimating a Population Proportion.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. All Rights Reserved. Section 7-1 Review and Preview.
Randomness Test Fall 2012 By Yaohang Li, Ph.D.. Review Last Class –Random Number Generation –Uniform Distribution This Class –Test of Randomness –Chi.
Tests of Random Number Generators
Business Statistics: A First Course, 5e © 2009 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests Business Statistics: A First Course Fifth Edition.
Analysis of Experimental Data; Introduction
Chi-Square Test (χ 2 ) χ – greek symbol “chi”. Chi-Square Test (χ 2 ) When is the Chi-Square Test used? The chi-square test is used to determine whether.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 12 Tests of Goodness of Fit and Independence n Goodness of Fit Test: A Multinomial.
Richard Kass/F02P416 Lecture 6 1 Lecture 6 Chi Square Distribution (  2 ) and Least Squares Fitting Chi Square Distribution (  2 ) (See Taylor Ch 8,
MONTE CARLO METHOD DISCRETE SIMULATION RANDOM NUMBER GENERATION Chapter 3 : Random Number Generation.
Chi-Två Test Kapitel 6. Introduction Two statistical techniques are presented, to analyze nominal data. –A goodness-of-fit test for the multinomial experiment.
10.Deterministic Randomness 1.Random Sequences Random Sequences A sequence of numbers r 1, r 2,... is random if there are no discernible patterns.
Chi Square Chi square is employed to test the difference between an actual sample and another hypothetical or previously established distribution such.
Sampling and Sampling Distributions
Chapter 11 – Test of Independence - Hypothesis Test for Proportions of a Multinomial Population In this case, each element of a population is assigned.
Chapter Eight Estimation.
Chapter 11 Chi-Square Tests.
Chapter 12 Tests with Qualitative Data
John Loucks St. Edward’s University . SLIDES . BY.
Chapter 5 Sampling Distributions
Testing Goodness of Fit
Goodness of Fit Tests The goal of goodness of fit tests is to test if the data comes from a certain distribution. There are various situations to which.
Goodness of Fit Tests The goal of χ2 goodness of fit tests is to test is the data comes from a certain distribution. There are various situations to which.
Statistics for Business and Economics (13e)
Determining the distribution of Sample statistics
CS 475/575 Slide set 4 M. Overstreet Old Dominion University
Chapter 7 Random-Number Generation
Chi Square Distribution (c2) and Least Squares Fitting
Properties of Random Numbers
An Online CNN Poll.
Econ 3790: Business and Economics Statistics
Discrete Event Simulation - 4
Statistical Inference about Regression
Chapter 11 Chi-Square Tests.
Inference on Categorical Data
Chapter 5 Sampling Distributions
Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007
Chi2 (A.K.A X2).
Copyright © Cengage Learning. All rights reserved.
Random Number Generation
The Binomial Distributions
Chapter 8 Estimation.
Chapter 11 Chi-Square Tests.
15 Chi-Square Tests Chi-Square Test for Independence
MATH 2311 Section 8.5.
Presentation transcript:

Test for randomness : Chi square test We can say how probable or improbable certain types of events are. The difference between observed Ys and expected nps V = (Y2 – np2) 2 + (Y3 – np3) 2 + … + (Y12 – np12) 2 What is the probability what V is this high using true dice? December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana Suppose that every observation can fall into one of k categories. We take n independent observations. Let ps be the probability that each observation falls into category s, and let Ys be the number of observations that actually do fall into category s. Weighted by the prob. of occurrence nps December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana Expanding (Ys – nps) 2 = Y2 – 2nps Ys + n2 ps 2 and Y1 + Y2 + … Yk = n p1 + p2 + … pk = 1 v = k –1 the number of degree of freedom is k – 1. December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana Chi-square distribution table says “The quantity V will be less than or equal to x with approximate probability p, if n is large enough”. How large should n be? Rule of thumb is nps >= 5 December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana Example five Chi-square test on three data of four generators. December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana B : x0 = 0, a = 3141592653, c = 2718281829, m = 2 35 C : x0 = 0, a = 2 7 + 1 , c = 1, m = 2 35 D : x0 = 47194118, a = 23, c = 0, m = 10 8 + 1 F : x0 = 314159265, a = 2 18 + 1, c = 1, m = 2 35 Conclusion, B and D are satisfactory, C is on the borderline, F is unsatisfactory. December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana Other tests Kolmogorov-Smirnov test (available in SPSS package) Frequency test, serial test, gap test, Poker test (partition test), Coupon’s collector test, permutation test, run test, maximum-of-t test, collision test, serial correlation test, tests on subsequences Spectral test December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana Advise for RNG The seed number X0 may be chosen arbitrarily. The number m should be large. The computation (aX + c) mod m must be done exactly with no roundoff error. If m is the power of 2, pick a so that a mod 8 = 5 to ensure max period and high potency. December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana The muliplier a should preferably be chosen between .01m and .99m and is binary digits should not have a simple, regular pattern. The value of c is immaterial when a is a good multiplier, except that c must be no factor in common with m. The least significant (right-handed) digits of X are not very random. It is generally best to think of X as a random fraction X/m between 0 and 1. December 1999 Prabhas Chongstitvatana

Prabhas Chongstitvatana Some good RNG a, m 137, 256 3141592221, 235 5 15, 2 35 17059465, 2 35 1664525, 2 32 314159269, 2 31 - 1 31167285, 2 48 6364136223846793005, 2 64 December 1999 Prabhas Chongstitvatana