Algostream_analytics.RollingFixed-window rolling statistics with periodic full recompute.
The naive sliding-Welford trick (subtract the outgoing point's contribution from M2) suffers catastrophic cancellation on long-running streams. Each module here keeps the most recent window samples in a circular buffer and runs an O(window) full recompute every recompute_every ticks. Between recomputes, an incremental update is applied for cheap reads, but the contract is: the value returned at recompute boundaries is exact; intermediate values are bounded-error approximations.
module Rolling_mean : sig ... endmodule Rolling_var : sig ... endmodule Rolling_cov : sig ... endmodule Rolling_corr : sig ... end