Algorithm X: An accelerated algorithm to compute the Qn robust statistic, with corrections to constants

The robust scale estimator Qn developed by Croux and Rousseeuw [3], for the computation of which they provided a deterministic algorithm, has proven to be very useful in several domains including in quality management and time series analysis. It has interesting mathematical (50% breakdown, 82% Asymptotic Relative Efficiency) and computing (O(nlogn) time, O(n) space) properties. While working on a faster algorithm to compute Qn, we have discovered an error in the computation of the d constant, and as a consequence in the dn constants that are used to scale the statistic for consistency with the variance of a normal sample. These errors have been reproduced in several articles including in the International Standard Organisation 13528 [12] document. In this article we fix the errors and present a new approach which includes a new algorithm, allowing computations to run 1.3 to 4.5 times faster when n grows from 10 to 100000.