Performs the Anderson-Darling test for normality by computing the \(A^2\) test statistic:
$$A^2 = n\int_{-\infty}^{\infty}\frac{(F_n(x)-F(x))^2F'(x)}{F(x)(1-F(x))}dx$$
The Anderson-Darling test evaluates whether a sample comes from a normal distribution by computing an integral over the empirical cumulative distribution function (ECDF) and comparing it against the normal distribution's CDF.
Interpretation:
When \(A^2/n\) approaches zero as sample size increases, the normality hypothesis is supported
When \(A^2/n\) converges to a positive finite value, the normality hypothesis lacks support
Important: The input data vector x must be sorted in ascending order. Unsorted
data will trigger an error.
See also
Boost Documentation for more details on the mathematical background.