On 2006-02-09 01:57:53 -0800, william(_at_)completewhois(_dot_)com wrote:
I do actually have quite a bit larger plans for all this and reputation
database of single ips is just first step in it. One of the things I ran
into is trying to decide what algorithm to use for calculating mean value
in real time. The obvious mean functions are arithmetic and harmonic mean
and there is also geometric mean, but its arithmetical complexity is not
likely to be worth it. The algorithms I thus intend to try are:
MA(n)*n + S(n+1)
MA(n+1)= ---------------- Where MA(x) is arithmetic mean at step x
n+1 with S(x) being actual score at step x
If n is constant, this doesn't really compute an arithmetic mean, but
the so-called "decaying average", where old values lose weight
exponentially with their age.
Of course, then the formula should be written as:
MA(i)*n + S(i+1)
MA(i+1)= ----------------
n+1
to make it clear. This algorithm is used for unix load averages, for
example.
I also think that some kind of multiplier should be applied so that latest
data has highier weight then previous one, so this endup being:
MA(n,w)*n + S(n+1)*w Where MA(x,w) is arithmetic mean
MA(n+1,w)= ------=------------- at step x with weight w (w>1)
n + w
For constant n, this is equivalent to the formula above. Just divide
both numerator and denominator by w:
MA(i,w)*n/w + S(i+1)*1
MA(i+1,w)= ------=-------------
n/w + 1
Then, you can just replace n/w with n and you have the same formula
again.
hp
--
_ | Peter J. Holzer | Ich sehe nun ein, dass Computer wenig
|_|_) | Sysadmin WSR | geeignet sind, um sich was zu merken.
| | | hjp(_at_)hjp(_dot_)at |
__/ | http://www.hjp.at/ | -- Holger Lembke in dan-am
pgpOHgD9SgHzZ.pgp
Description: PGP signature
_______________________________________________
Asrg mailing list
Asrg(_at_)ietf(_dot_)org
https://www1.ietf.org/mailman/listinfo/asrg