Computation of Sample Mean and Variance
In HFT, the first and second-order statistics often need to be determined. Necessarily, the algorithm that performs the computation must be O(1) and numerically stable. The sample mean and variance of a signal are signals given by Let and . Then Also, and so
This approach is known as Welford’s online algorithm and is numerically stable, O(1), and compuatble in one pass.
Biasedness of Estimation.
Under weak statistical assumption that the signal is a sequence of random variables with a stationary first moment , then , that is the estimator unbiased. If the random variables are uncorrelated and have a stationary finite variance, then , which is biased, but an easy fix can be made to obtain an unbiased estimator: . This is typically not a serious issue since the estimators are all asymptotically unbiased. To see this, note that
