Re: Algorithm for approximating a "moving" percentile statistic?




chessaurus@xxxxxxxxx wrote:
I've seen clever algorithms for computing "moving" means
and variances (without requiring complete recalculation
for each window position). Do similar algorithms exist for
computing or approximating a "moving percentile"?
Any help will be greatly appreciated.

I think that a method adapted from "staircase procedures"
used (for example) in some psychophysical experiments may
be helpful to you. I'll try to recreate it from memory, but I may
have some of the signs wrong.

Suppose you want to estimate the p'th percentile for the
distribution of X.

Start with a rough guess, G, and a step size, S
(I assume you know enough about the distribution
to come up with reasonable values for these in advance.
If not, you may based them on the first 100 numbers).

Each time you obtain a new observed value of X,
revise your estimate G as follows:
If X < Old G, New G = Old G - (1-p)*S
Else New G = Old G + p*S

Note that if Old G sits at the p'th percentile,
the expected change from OldG to New G is:
p*[-(1-p)*S] + (1-p)*p*S = 0
So, for many common distributions of X, G will
tend to converge toward the p'th percentile.
This method requires no sorting and no storage of
previous X values (you must store G and S,
of course). Convergence can be quite slow,
however.

If you want a bit more sophistication, you can let S
decrease with the number of X's you have already seen
(to make G sit more stably close to the true p'th
percentile). Another possibility is to take as your
percentile estimate a running average of the (recent)
G values. Some simulations may help you determine
what works best in your case.

Hope that helps,

.



Relevant Pages

  • Algorithm for approximating a "moving" percentile statistic?
    ... I've seen clever algorithms for computing "moving" means and variances ... Do similar algorithms exist for computing or approximating a "moving ... I'd like to be able to compute a percentile transform for a given value ...
    (sci.stat.math)
  • Re: CONFIDENCE LIMITS AROUND A PERCENTILE
    ... CONFIDENCE LIMITS AROUND A PERCENTILE ... Fot the normal distribution, it's based on the ... CONFIDENCE INTERVALS FOR QUANTILES ... This algorithm is based on the Normal Distribution ...
    (sci.stat.math)
  • Re: Ranking values of a set
    ... I computed from 3 different methods of ranking. ... Percentile, Weighted Percentile, and Normal Cumulative Distribution ... Why not show, instead, the fraction of total sales that are ...
    (sci.stat.math)
  • Re: Distribution of a Percetile
    ... > You would be better advised to assume a distribution, ... and test estimates of the parameters. ... > testing a percentile you are throwing away information. ... discussions that ".05" has in hypothesis testing. ...
    (sci.stat.math)
  • Re: Distribution of a Percetile
    ... You sort all the speeds from each distribution to see where 85% is. ... 85th percentile from each day and determine the distribution of that ... These daily speed measurements ...
    (sci.stat.math)