Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Luis A. Afonso
Posts:
4,518
From:
LIsbon (Portugal)
Registered:
2/16/05


Skew, Kurt, Critical Values
Posted:
May 30, 2013 10:01 AM


Skew, Kurt, Critical Values
Just for fun I will evaluate the Skewness and Kurtosis given by Cristiano (thread: Skewness and kurtosis pvalues). A very small sample size, as n=10, is a limitation because the PC´s computing slowness. Literature http://mvpprograms.com/help/mvpstats/distributions/SkewnessCriticalValues http://mvpprograms.com/help/mvpstats/distributions/KurtosisCriticalValues The number, 4´000´000, of samples, takes 2 1/2 hors of calculation. Results: N=10/ 4´000´000
___SKEWNESS*___ _________________Table___ ___1.131__1.133__1.127__0.050, 0.950__ ___1.375__1.378__1.372__0.025, 0.975__ ___1.667__1.675__1.657__0.010, 0.990__ ___1.869__1.876__1.856__0.005, 0.995__ *relative to the two tails separately ___KURTOSIS________Table ___1.574__2.632___1.58__2.54__90% ___1.731__3.447___1.71__3.44__95% ___1.886__4.472___1.88__4.50__99% In order to check if the RNG is properly working the data 10 * 4000000 concerning the results above, was tested by Lilliefor´s Test ______DATA______ ____3.5___0.00023___3.5___0.99976__ ____3.0___0.00135___3.0___0.99866__ ____2.5___0.00620___2.5___0.99377__ ____2.0___0.02274___2.0___0.97724__ ____1.5___0.06681___1.5___0.93318__ ____1.0___0.15866___1.0___0.84134__ ____0.5___0.30856___0.5___0.69152__ ____ 0.0___ 0.50002__ Conclusion: The maximum difference relative to data was dmax=0.191 whereas the critical value, 95% confidence read on Tables amounts to 0.220. So, as expected, there is not sufficient evidence to reject data normality. The overall conclusion is that our Skew, Kurt critical values are in accordance with theory.
Luis A. Afonso REM "CHECK0" CLS DEFDBL AZ PRINT "________check0_____________________" PRINT PRINT pi = 4 * ATN(1) INPUT " N= "; n aw = SQR(n * (n  1)) / (n  2) bw = ((n  1) * (n + 1)) / ((n  2) * (n  3)) cw = 3 * ((n  1) * (n  1)) / ((n  2) * (n  3)) DIM x(n) DIM sk(8001), kt(8001) DIM cc(20) REM INPUT " How many "; many
REM REM FOR j = 1 TO many LOCATE 5, 50: PRINT USING "#######"; many  j RANDOMIZE TIMER m1 = 0 FOR i = 1 TO n aa = SQR(2 * LOG(RND)) x(i) = aa * COS(2 * pi * RND) x = x(i) m1 = m1 + x / n FOR ki = 1 TO 15: REM Normal items check p = 4 + ki * .5 IF x <= p THEN cc(ki) = cc(ki) + 1 / n NEXT ki NEXT i: REM the sample is got REM m(2) = 0: m(3) = 0: m(4) = 0 FOR k = 2 TO 4: ki = k FOR i = 1 TO n: d = x(i)  m1: uu = d ^ ki m(k) = m(k) + uu / n NEXT i NEXT k REM Skewness (sk) & Kurtosis (kt) sk = aw * m(3) / (m(2) ^ 1.5) kt = bw * m(4) / (m(2) * m(2)) + cw REM sk = sk + 4: kt = kt + 3 sk = INT(1000 * sk + .5) kt = INT(1000 * kt + .5) REM IF sk > 8000 THEN sk = 8000 IF sk < 0 THEN sk = 0 sk(sk) = sk(sk) + 1 REM IF kt > 8000 THEN kt = 8000 IF kt < 0 THEN kt = 0 kt(kt) = kt(kt) + 1 REM uww = INT((10 * j) / many) IF uww <> (10 * j) / many THEN GOTO 89 REM COLOR 7 v(0) = .05: v(1) = 1  v(0) v(2) = .025: v(3) = 1  v(2) v(4) = .01: v(5) = 1  v(4) v(6) = .005: v(7) = 1  v(6) LOCATE 7, 1 PRINT " SKEWNESS " FOR w = 0 TO 7 s = 0 FOR t = 0 TO 8000 s = s + sk(t) / j IF s > v(w) THEN GOTO 15 NEXT t 15 PRINT USING " ##.### "; t / 1000  4; v(w); IF w = 1 OR w = 3 OR w = 5 THEN PRINT NEXT w: PRINT PRINT : PRINT " KURTOSIS " FOR w = 0 TO 5 s = 0 FOR t = 0 TO 8000 s = s + kt(t) / j IF s > v(w) THEN GOTO 16 NEXT t 16 PRINT USING " ##.### "; t / 1000  3; v(w); IF w = 1 OR w = 3 THEN PRINT NEXT w PRINT : PRINT COLOR 14 FOR p = 1 TO 15 PRINT USING " ##.# #.####### "; 4 + .5 * p; cc(p) / j; NEXT p COLOR 7 89 NEXT j END _________________________________ REM "LILI10" REM CLS DEFDBL AZ DIM vview(15), ttab(15) DATA 0.00023,0.00135,0.00620,0.02274,0.06681 DATA 0.15866,0.30856,0.50002,0.69152,0.84134 DATA 0.93318,0.97724,0.99377,0.99866,0.99976 FOR i = 1 TO 15: READ vview(i): NEXT i DATA 0.00023,0.00135,0.00621,0.02275,0.06681 DATA 0.15866,0.30854,0.50000,0.68146,0.84134 DATA 0.93319,0.97725,0.99379,0.99865,0.99977 FOR i = 1 TO 15: READ ttab(i): NEXT i REM LILIEFORS TEST REM max[abs(vview(k1)ttab(k),abs(vview(k)ttab(k)] vview(0) = 0 FOR k = 1 TO 15 d1 = ABS(vview(k  1)  ttab(k)) d2 = ABS(vview(k)  ttab(k)) maxx = d1 IF d2 > maxx THEN maxx = d2 IF maxx > supper THEN supper = maxx NEXT k LOCATE 7, 20: COLOR 14 PRINT USING " This trial ##.### "; supper LOCATE 12, 20: COLOR 12 PRINT " 0.220 (95%) Lillieforïs Test" COLOR 7 END



