Question #277923

X = [0.01, 0.36, 0.97, 0.44, 0.86, 0.49, 0.02, 0.19, 0.54, 0.63, 0.69, 0.27, 0.21, 0.55, 0.54, 0.1 , 0.02, 0.49 , 0.42, 0.79], is a list of 20 random numbers generated from a pseudo-random number generator G.


a. What is a uniformity test?

b. Using Chi-square Goodness-of-fit test with 4 bins, test whether X belongs to U(0, 1) based on 5% significant level. 

c. Can we conclude G generates truly random numbers following the distribution U(0, 1)?


1
Expert's answer
2021-12-10T13:21:45-0500

a.

χ2\chi^2 squared test for uniformity can be formulated by binning the ranks 0: M into J bins and testing that the bins all have roughly the expected number of draws in them.

If bj is the number of ranks that fall into bin j and ej is the number of ranks expected to fall into

bin j, the test statistic is


χ2=(bjej)2ej\chi^2=\sum \frac{(b_j-e_j)^2}{e_j}


b.

H0:H_0: X belongs to U(0, 1)

Ha:H_a: X does not belong to U(0, 1)


X=[0.01,0.02,0.02,0.1,0.19,0.21,0.27,0.36,0.42,0.44,0.49,0.49,X=[0.01, 0.02, 0.02, 0.1, 0.19, 0.21, 0.27, 0.36, 0.42, 0.44, 0.49, 0.49,

0.54,0.54,0.55,0.63,0.69,0.79,0.86,0.97]0.54, 0.54, 0.55, 0.63, 0.69, 0.79, 0.86, 0.97]

4 bins:

[0,0.25],[0.25,0.5],[0.5,0.75],[0.75,1][0,0.25],[0.25,0.5],[0.5,0.75],[0.75,1]


χ2=(bjej)2ej\chi^2=\sum \frac{(b_j-e_j)^2}{e_j}


expected number of values in each interval is

ej=20/4=5e_j=20/4=5

then:


χ2=(65)2+(65)2+(55)2+(35)25=6/5=1.2\chi^2=\frac{(6-5)^2+(6-5)^2+(5-5)^2+(3-5)^2}{5}=6/5=1.2


df=41=3df=4-1=3


critical value:

χcrit2=0.216\chi^2_{crit}=0.216


c.

Since χ2>χcrit2\chi^2>\chi^2_{crit} we accept the null hypothesis. X belongs to U(0, 1)


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS