Quantile estimator
Biased Quantiles over Data Streams

Common Lisp Implementation of Graham Cormode and S. Muthukrishnan's Effective Computation of Biased Quantiles over Data Streams in ICDE’05.

(let ((estimator (make-estimator))) (estimator.observe estimator 0.8) (estimator.observe estimator 0.4) (estimator.observe estimator 0.9) (estimator.observe estimator 0.6) (is (estimator.query estimator 0.5) 0.6) (is (estimator.query estimator 0.9) 0.8) (is (estimator.query estimator 0.99) 0.8))
Github

Mathematics