Search All of the Math Forum:

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

Topic: A power exercise: Chi-squared df under Jarque-Bera Test
Replies: 0

 Luis A. Afonso Posts: 4,758 From: LIsbon (Portugal) Registered: 2/16/05
A power exercise: Chi-squared df under Jarque-Bera Test
Posted: Oct 1, 2013 8:40 AM

A power exercise: Chi-squared df under Jarque-Bera Test

Program <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. Katzgraber

Comment : 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 = 0
15 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 i
REM
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) + 1
REM PRINT USING "##.#### "; jb;
NEXT j
REM
44 REM
PRINT USING " power% ##.# "; 100 * (1 - trash)
END