```Date: Oct 1, 2013 8:40 AM
Author: Luis A. Afonso
Subject: A power exercise: Chi-squared df under Jarque-Bera Test

A power exercise: Chi-squared df under Jarque-Bera TestProgram <ama>____n=sample size, 40000 samples Results________n=20____ 35_____50______75___________3.7954__4.5929__4.9757__5.2777__5% c.v. _df chi____10____21.5%___36.6___48.2____ 67.5______7____27.5 ____44.8___61.3____ 81.3______5____34.9____ 56.8___74.5____ 91.9______4____40.2____ 65.5___82.5____ 96.1________________________________________________n=100____ 150_____________5.4300___5.5984_____df chi____10____81.8%____95.9_____7____92.8_____ 99.4_____5____98.2____ 100.0_____4____99.5____ 100.0__(\$) Precise finite-sample quantiles of the Jarque-Bera adjusted Lagrange multiplier test Diethelm Wuertz, Helmut G. KatzgraberComment : as it was expected JB is a not efficient fit test, it needs a lot of data and if the distribution approaches to normality (chi with pretty large degrees of freedom) the power tends to be low. What, of course, is very common in whatever fit test.Luis A, Afonso   REM "AMA"        CLS        PRINT "  ------------- < AMA > ------------- "        PRINT " 5% significance Jarque-Bera Test     "        PRINT " 2.5247(size=10) , 3.7954(20), ";        PRINT " 4.5929(35) , 4.9757(50) , 5.2777(75) "        PRINT " 5.4300(100), 5.5984(150)             "        DEFDBL A-Z        RANDOMIZE TIMER        pi = 4 * ATN(1)        PRINT : PRINT        INPUT "    size            "; n        INPUT " JB crit (N data)   "; crit        INPUT "       r            "; r        INPUT "     all            "; all        u = 2 / (9 * r)        DIM chi(n), W(8001)REM        FOR j = 1 TO all        LOCATE 15, 50: PRINT USING "#########"; all - j        mean = 015      FOR i = 1 TO n        chi = 0        FOR uu = 1 TO r        aa = SQR(-2 * LOG(RND))        z = aa * COS(2 * pi * RND)        chi = chi + z * z        NEXT uu        mean = mean + chi / n        chi(i) = chi        NEXT i        m2 = 0: m3 = 0: m4 = 0        FOR i = 1 TO n: d = chi(i) - mean        m2 = m2 + d * d / n        m3 = m3 + d * d * d / n        m4 = m4 + d * d * d * d / n        NEXT iREM        skew = m3 / (m2 ^ 1.5)        kurt = m4 / (m2 * m2)        u = skew * skew: v = (kurt - 3) * (kurt - 3)        jb = (n / 6) * (u + v / 4)        IF jb < crit THEN trash = trash + 1 / all        ji = INT(1000 * jb + .5)        IF ji > 8000 THEN ji = 8000        W(ji) = W(ji) + 1REM        PRINT USING "##.####   "; jb;        NEXT j        REM44      REM        PRINT USING " power%  ##.#   "; 100 * (1 - trash)        END
```