[R] Jarque-Bera and rnorm()
Murali Menon
feanor0 at hotmail.com
Fri Apr 27 11:02:58 CEST 2007
Folks,
I'm a bit puzzled by the fact that if I generate 100,000 standard normal
variates using rnorm() and perform the Jarque-Bera on the resulting vector,
I get p-values that vary drastically from run to run. Is this expected?
Surely the p-val should be close to 1 for each test?
Are 100,000 variates sufficient for this test?
Or is it that rnorm() is not a robust random number generator? I looked at
the skewness and excess kurtosis, and the former seems to be unstable, which
leads me to think that is why JB is failing.
Here are my outputs from successive runs of rjb.test (the robust Jarque Bera
from the lawstat package).
>set.seed(100)
>y <- rnorm(100000);rjb.test(y);skewness(y)[1];kurtosis(y)[1]
Robust Jarque Bera Test
data: y
X-squared = 1.753, df = 2, p-value = 0.4162
[1] -0.01025744
[1] 0.0008213325
>y <- rnorm(100000);rjb.test(y);skewness(y)[1];kurtosis(y)[1]
Robust Jarque Bera Test
data: y
X-squared = 0.1359, df = 2, p-value = 0.9343
[1] -0.001833042
[1] -0.002603599
>y <- rnorm(100000);rjb.test(y);skewness(y)[1];kurtosis(y)[1]
Robust Jarque Bera Test
data: y
X-squared = 4.6438, df = 2, p-value = 0.09809
[1] -0.01620776
[1] -0.005762349
Please advise. Thanks,
Murali
_________________________________________________________________
MSN is giving away a trip to Vegas to see Elton John. Enter to win today.
More information about the R-help
mailing list