The functions in this section estimate quantiles dynamically without storing the entire dataset, using the algorithm of Jain and Chlamtec, 1985. Only five points (markers) are stored which represent the minimum and maximum of the data, as well as current estimates of the p/2-, p-, and (1+p)/2-quantiles. Each time a new data point is added, the marker positions and heights are updated.
This function allocates a workspace for the dynamic estimation of p-quantiles, where p is between 0 and 1. The median corresponds to p = 0.5. The size of the workspace is O(1).
This function frees the memory associated with the workspace w.
This function resets the workspace w to its initial state, so it can begin working on a new set of data.
This function updates the estimate of the p-quantile with the new data point x.
This function returns the current estimate of the p-quantile.