Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Normal or Uniform data using Fingerprints (II)
Replies: 4   Last Post: Apr 27, 2013 6:49 PM

 Messages: [ Previous | Next ]
 Luis A. Afonso Posts: 4,743 From: LIsbon (Portugal) Registered: 2/16/05
Normal or Uniform data using Fingerprints (II)
Posted: Apr 22, 2013 9:42 AM

Normal or Uniform data using Fingerprints (II)

The programs <MINN> and <MINERVA> shall provide the Fingerprints concerning the Normal and Uniform Distributions: therefore given a random sample, size n, we can solve the NHST displayed as H0: Normal versus Ha: Uniform.

_______NORMAL DATA (Frequencies)
________[000]___[001]___[010]___[011]___G____ U____V__
__n=50__0.761__ 0.022__ 0.187__ 0.031___1.62__3.92__3.44_
____60__0.762__ 0.023__ 0.186__ 0.029___1.62__3.91__2.44_
____70__0.760__ 0.024__ 0.189__ 0.028___1.63__3.90__3.45_
____80__0.769__ 0.024__ 0.183__ 0.024___1.63__3.91__3.47_
____90__0.763__ 0.024__ 0.188__ 0.026___1.64__3.90__2.52_
___100__0.764__ 0.026__ 0.189__ 0.022___1.64__3.90__3.52_
___150__0.752__ 0.031__ 0.195__ 0.022___1.64__3.88__3.56_
___200__0.755__0.030__ 0.196__ 0.019___1.64__3.87__3.59_

_______UNIFORM
________[000]___[001]___[010]___[011]__
__n=50__0.519__ 0.461__ 0.016__ 0.005__
____60__0.303__ 0.679__ 0.009__ 0.009__
____70__0.154__ 0.827__ 0.006__ 0.013__
____80__0.072__ 0.911__ 0.003__ 0.014__
____90__0.032__ 0.951__ 0.002__ 0.016__
___100__0.013__ 0.971__ 0.001__ 0.015__
___150__0.000__ 0.985__ 0.000__ 0.015__
___200__0.000__ 0.984__ 0.000__ 0.016__

Conclusion
The Fingerprint´s effectiveness is clear for sizes >=100:

____________________n=100____150____200______
__H0:_[000] or [010]___0.953____0.947___0.951___Normal
___________________ (0.014)___(0.000)__(0.000)____U
___________________ 0.026____0.030___ 0.030__Normal
____Ha:_[001]_______ (0.953)___(0.984)__(0.984)____U

Noticeably the Type I and Type II errors (and power) are estimated only by inspecting the two outputs/events: A=[000] or [010] and B=[010].
Luis A. Afonso

REM "MINN"
CLS
COLOR 13: PRINT : PRINT " <MINN> "
PRINT " NORMAL DISTRIBUTION "
PRINT " [ Geary , UALM , VALM ] "
DEFDBL A-Z
RANDOMIZE TIMER
COLOR 14
pi = 4 * ATN(1)
DATA 50,60,70,80,90,100,150,200
FOR k = 1 TO 8: READ n(k): NEXT k
DATA 1.62, 1.62, 1.63, 1.63, 1.64, 1.64
DATA 1.64,1.64
FOR j = 1 TO 8: READ zwcrit(j): NEXT j
DATA 3.92, 3.91, 3.90, 3.91, 3.90, 3.90
DATA 3.88,3.87
FOR j = 1 TO 8: READ Ucrit(j): NEXT j
DATA 3.44, 3.44, 3.45, 3.47, 3.48, 3.52
DATA 3.56,3.59
FOR j = 1 TO 8: READ Vcrit(j): NEXT j
INPUT " How many "; many
PRINT
DIM x(200)
PRINT : PRINT : PRINT
LOCATE 10, 10
PRINT " [000] [001] [010] [011] "
PRINT : PRINT
REM
FOR k = 6 TO 8
n = n(k)
REM
REM
REM
c1 = 6 * (n - 2) / ((n + 1) * (n + 3))
c2 = 3 * (n - 1) / (n + 1)
c = 24 * n * (n - 2) * (n - 3)
c3 = c / ((n + 1) ^ 2 * (n + 3) * (n + 5))
COLOR 7
REM
FOR j = 1 TO many
RANDOMIZE TIMER
LOCATE 8, 50: PRINT USING "#########"; many - j
REM
FOR i = 1 TO n
41 aa = SQR(-2 * LOG(RND))
IF aa < 1E-08 THEN GOTO 41
x(i) = aa * COS(2 * pi * RND)
NEXT i
REM
m2 = 0: m3 = 0: m4 = 0
absx = 0
FOR i2 = 1 TO n: d = x(i2) - m
m2 = m2 + d * d / n
m3 = m3 + d * d * d / n
m4 = m4 + d * d * d * d / n
absx = absx + ABS(d)
NEXT i2
REM
REM
s = m3 / (m2 ^ 1.5): U = s * s / c1
ki = m4 / (m2 * m2) - c2: V = ki * ki / c3
sigma = SQR(m2 / n)
tau = absx / n
omega = 13.29 * LOG(sigma / tau)
zww = SQR(n + 2) * ((omega - 3) / 3.54)
COLOR 7
REM
Gcrit = zwcrit(k)
Ucrit = Ucrit(k)
Vcrit = Vcrit(k)
REM
i1 = 0
IF zww > Gcrit THEN i1 = 1
i2 = 0
IF U > Ucrit THEN i2 = 1
i3 = 0
IF V > Vcrit THEN i3 = 1
W(i1, i2, i3) = W(i1, i2, i3) + 1
NEXT j
REM
LOCATE 12 + k, 10
PRINT USING " #.### "; W(0, 0, 0) / many; : W(0, 0, 0) = 0
PRINT USING "#.### "; W(0, 0, 1) / many; : W(0, 0, 1) = 0
PRINT USING "#.### "; W(0, 1, 0) / many; : W(0, 1, 0) = 0
PRINT USING "#.### "; W(0, 1, 1) / many; : W(0, 1, 1) = 0
REM PRINT USING "#.### "; W(1, 0, 0) / many; : W(1, 0, 0) = 0
REM PRINT USING "#.### "; W(1, 0, 1) / many; : W(1, 0, 1) = 0
REM PRINT USING "#.### "; W(1, 1, 0) / many; : W(1, 1, 0) = 0
REM
REM PRINT USING "#.### "; W(1, 1, 1) / many; : W(1, 1, 1) = 0
REM
W(0, 0, 0) = 0
W(0, 0, 1) = 0
W(0, 1, 0) = 0
W(0, 1, 1) = 0
PRINT USING " ### "; n;
PRINT USING "#.## #.## #.## "; zwcrit(k); Ucrit(k); Vcrit(k)
NEXT k
END

REM "MINERVA"
CLS
COLOR 13: PRINT : PRINT " <MINERVA> "
PRINT " UNIFORM DISTRIBUTION "
PRINT " [ Geary , UALM , VALM ] "
DEFDBL A-Z
RANDOMIZE TIMER
COLOR 14
DATA 50,60,70,80,90,100,150,200
FOR k = 1 TO 8: READ n(k): NEXT k
DATA 1.62, 1.62, 1.63, 1.63, 1.64, 1.64
DATA 1.64,1.63
FOR j = 1 TO 8: READ zwcrit(j): NEXT j
DATA 3.92, 3.91, 3.90, 3.91, 3.90, 3.90
DATA 3.88,3.87
FOR j = 1 TO 8: READ Ucrit(j): NEXT j
DATA 3.44, 3.44, 3.45, 3.47, 3.48, 3.52
DATA 3.56,3.59
FOR j = 1 TO 8: READ Vcrit(j): NEXT j
INPUT " How many "; many
PRINT
DIM x(200)
PRINT : PRINT : PRINT
PRINT " [000] [001] [010] [011] "
PRINT : PRINT
REM
FOR k = 6 TO 8
n = n(k)
REM
REM
REM
c1 = 6 * (n - 2) / ((n + 1) * (n + 3))
c2 = 3 * (n - 1) / (n + 1)
c = 24 * n * (n - 2) * (n - 3)
c3 = c / ((n + 1) ^ 2 * (n + 3) * (n + 5))
COLOR 7
REM
FOR j = 1 TO many
RANDOMIZE TIMER
REM
FOR i = 1 TO n
x(i) = 6 * (RND - .5)
NEXT i
REM
m2 = 0: m3 = 0: m4 = 0
absx = 0
FOR i2 = 1 TO n: d = x(i2) - m
m2 = m2 + d * d / n
m3 = m3 + d * d * d / n
m4 = m4 + d * d * d * d / n
absx = absx + ABS(d)
NEXT i2
REM
REM
s = m3 / (m2 ^ 1.5): U = s * s / c1
ki = m4 / (m2 * m2) - c2: V = ki * ki / c3
sigma = SQR(m2 / n)
tau = absx / n
omega = 13.29 * LOG(sigma / tau)
zww = SQR(n + 2) * ((omega - 3) / 3.54)
COLOR 7
REM
Gcrit = zwcrit(k)
Ucrit = Ucrit(k)
Vcrit = Vcrit(k)
REM
i1 = 0
IF zww > Gcrit THEN i1 = 1
i2 = 0
IF U > Ucrit THEN i2 = 1
i3 = 0
IF V > Vcrit THEN i3 = 1
W(i1, i2, i3) = W(i1, i2, i3) + 1
NEXT j
REM
PRINT USING " #.### "; W(0, 0, 0) / many; : W(0, 0, 0) = 0
PRINT USING "#.### "; W(0, 0, 1) / many; : W(0, 0, 1) = 0
PRINT USING "#.### "; W(0, 1, 0) / many; : W(0, 1, 0) = 0
PRINT USING "#.### "; W(0, 1, 1) / many; : W(0, 1, 1) = 0
REM PRINT USING "#.### "; W(1, 0, 0) / many; : W(1, 0, 0) = 0
REM PRINT USING "#.### "; W(1, 0, 1) / many; : W(1, 0, 1) = 0
REM PRINT USING "#.### "; W(1, 1, 0) / many; : W(1, 1, 0) = 0
REM
REM PRINT USING "#.### "; W(1, 1, 1) / many; : W(1, 1, 1) = 0
REM
W(0, 0, 0) = 0
W(0, 0, 1) = 0
W(0, 1, 0) = 0
W(0, 1, 1) = 0
PRINT USING " ### "; n;
PRINT USING "#.## #.## #.## "; zwcrit(k); Ucrit(k); Vcrit(k)
NEXT k
END

Date Subject Author
4/22/13 Luis A. Afonso
4/25/13 Luis A. Afonso
4/25/13 Luis A. Afonso
4/27/13 Luis A. Afonso
4/27/13 Luis A. Afonso