jarqueBeraTest
Performs the Jarque-Bera goodness-of-fit test for normality.
The null hypothesis is that sample was drawn from a normal distribution. The test checks whether the sample has the skewness (zero) and kurtosis (three) expected of a normal distribution. It combines squared skewness and scaled squared excess kurtosis into a single statistic that asymptotically follows a chi-squared distribution with 2 degrees of freedom. Uses population (biased) moment estimates.
If all values are identical (zero variance), returns JB = 0.0 and p-value = 1.0.
Example:
val result = jarqueBeraTest(data)
result.statistic // JB statistic
result.pValue // chi-squared p-value (df = 2)
result.additionalInfo["skewness"] // population skewness (biased)
result.additionalInfo["kurtosis"] // population excess kurtosis (biased)
result.isSignificant() // true if data deviates significantly from normalityContent copied to clipboard
Return
a TestResult containing the JB statistic, p-value, degrees of freedom (2.0), and additional info with "skewness" and "kurtosis".
Parameters
sample
the observed values. Must have at least 3 elements.