On 8/16/07, Darren Cook <[EMAIL PROTECTED]> wrote:
> Calculating the mean of a stream of numbers [1] is easy: just keep track
> of the sum and the count, and divide at the end. But what about the
> median?

> I think I always need to buffer at least half the numbers

A counter for each unique value should always suffice and may be less
than half the numbers in the stream. If you don't require huge
precision you can save a lot by increasing the bin-size (just maintain
a histogram).

> , but does anyone know for sure, or know a clever algorithm [2]?

Not sure, but I guess you could look for an incremental update of any
probability density approximation that has sufficient complexity for
your purposes.

An even more simplistic approach might be to compare incoming samples
to the current estimate and increment/decrement by a small constant
depending on whether it's higher or lower (but that may be too crude
for your purposes).

Best,
Erik
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to