jbtest(x: array): number
Performs the Jarque-Bera test for normality.
Tests the null hypothesis that the input data follows a normal distribution with an unknown mean and variance. The test statistic combines skewness and excess kurtosis.
Example 1
Example 1
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039];
Compute the Jarque-Bera test statistic for normality
Compute the Jarque-Bera test statistic for normality
import { assertEquals } from "jsr:@std/assert"; const x = [0.003, 0.026, 0.015, -0.009, 0.014, 0.024, 0.015, 0.066, -0.014, 0.039]; assertEquals(jbtest(x), 0.6360604293924916);
Compute JB test statistic for a dataset with more variation
Compute JB test statistic for a dataset with more variation
import { assertEquals } from "jsr:@std/assert"; assertEquals(jbtest([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), 0.6244872972145701);
x: array
The dataset (array of values).