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.
On Fri, April 27, 2007 7:02 pm, Murali Menon wrote:> 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?No. Under the null hypothesis, the p-value is a uniformly-distributed random variable, with range 0 to 1. Cheers, Andrew> 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. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >Andrew Robinson Senior Lecturer in Statistics Tel: +61-3-8344-9763 Department of Mathematics and Statistics Fax: +61-3-8344 4599 University of Melbourne, VIC 3010 Australia Email: a.robinson at ms.unimelb.edu.au Website: http://www.ms.unimelb.edu.au
Murali Menon schrieb:> 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?Yes.> Surely the p-val should be close to 1 for each test?No. The p-value should rather be uniformly distributed on [0;1]. You can try library(lawstat) ttt<-numeric(1000) for (i in 1:length(ttt)) ttt[i]<-rjb.test(rnorm(10000))$p.value hist(ttt) to confirm that the combination of rnorm and rjb.test seems to behave correctly here. Regards, Martin> > Are 100,000 variates sufficient for this test? >[...]> Please advise. Thanks, > > Murali > > _________________________________________________________________ > MSN is giving away a trip to Vegas to see Elton John. Enter to win > today. > > ------------------------------------------------------------------------ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >