Skip to main content

StatsJBTest

StatsJBTest [/ALPH=alpha /T=k /Z/Q] srcWave

The StatsJBTest operation performs the Jarque-Bera test on srcWave. Output is to the W_JBResults wave in the current data folder.

Flags

/ALPH=valSets the significance level (default val =0.05).
/DEST=wrWaveSpecify the destination wave for the Jarque-Bera test results. If you do not use this flag, the operation saves the output in the wave W_JBResults in the current data folder.
This flag was added in Igor Pro 10.00.
/FREECreates the user-specified destination wave as a free wave.
/FREE is allowed only in functions, and only if the destination waves are simple names or wave reference structure fields.
See Free Waves for more discussion.
The /FREE flag was added in Igor Pro 10.00.
/QNo results printed in the history area.
/T=kDisplays results in a table. k specifies the table behavior when it is closed.
k =0:Normal with dialog (default).
k =1:Kills with no dialog.
k =2:Disables killing.
/ZIgnores errors. V_flag will be set to -1 for any error and to zero otherwise.

Details

StatsJBTest computes the Jarque-Bera statistic

JB=n6(S2+K24),\displaystyle J B=\frac{n}{6}\left(S^{2}+\frac{K^{2}}{4}\right),

where S is the skewness, K is the kurtosis, and n is the number of points in the input wave. We can express S and K terms of the jth moment of the distribution for n samples Xi

μj=1ni=1n(XiXˉ)j\displaystyle \mu_{j}=\frac{1}{n} \sum_{i=1}^{n}\left(X_{i}-\bar{X}\right)^{j}

as

S=μ3(μ2)3/2,\displaystyle S=\frac{\mu_{3}}{\left(\mu_{2}\right)^{3 / 2}},

and

K=μ4(μ2)23.\displaystyle K=\frac{\mu_{4}}{\left(\mu_{2}\right)^{2}}-3 .

The Jarque-Bera statistic is asymptotically distributed as a Chi-squared with two degrees of freedom. For values of n in the range [7,2000] the operation provides critical values obtained from Monte-Carlo simulations. For further details or if you would like to run your own simulation to obtain critical values for other values of n, use the JarqueBeraSimulation example experiment.

StatsJBTest reports the number of finite data points, skewness, kurtosis, Jarque-Bera statistic, asymptotic critical value, and the critical value obtained from Monte-Carlo calculations as appropriate; it ignores NaNs and INFs.

References

Jarque, C., and A. Bera, A test of normality of observations and regression residuals, International Statistical Review, 55, 163-172, 1987.

See Also

Statistical Analysis, StatsKSTest, WaveStats, StatsCircularMoments

Demos

Open Jarque-Bera Simulation.pxp