<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 3, 2008, at 9:03 AM, Matthew Toseland wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Courier; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">Useful class, but I'm really not convinced it's statistically sound. You need<span class="Apple-converted-space"> </span><br>to normalize the stored value after every operation, otherwise as it gets<span class="Apple-converted-space"> </span><br>larger, you will get bigger jumps when values are reported. In order to do<span class="Apple-converted-space"> </span><br>this, you probably need to extend BDRA; put some hooks in.</span></blockquote><div><br></div><div><div>Hmmm... yes, in review you are right, as averaging is not linear as such:</div><div>assume: avg(a, b, c... x, y) = z</div><div>then: avg(a+1, b+1, c+1... x+1, y+1) != z+1</div><div><br></div></div><div>An implementation using normalized stored values is possible by adding a single package-hook: setCurrentValue(double d);</div><div>Then, in the averager, on report() to call avg.setCurrentValue(Location.normalize(avg.currentValue());</div><div><br></div><div>Implemented in r16855.</div><div><br class="webkit-block-placeholder"></div><div><div><div>--</div><div>Robert Hailey</div><div><br></div></div></div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Courier; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">On Wednesday 26 December 2007 20:51,<span class="Apple-converted-space"> </span><a href="mailto:robert@freenetproject.org">robert@freenetproject.org</a><span class="Apple-converted-space"> </span>wrote:<br><blockquote type="cite">Author: robert<br></blockquote><blockquote type="cite">Date: 2007-12-26 20:51:38 +0000 (Wed, 26 Dec 2007)<br></blockquote><blockquote type="cite">New Revision: 16817<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Added:<br></blockquote><blockquote type="cite"> trunk/freenet/src/freenet/support/math/DecayingKeyspaceAverage.java<br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite"> trunk/freenet/src/freenet/node/Location.java<br></blockquote><blockquote type="cite"> trunk/freenet/src/freenet/node/NodeStats.java<br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">implement keyspace-aware averager</blockquote></span></blockquote></div><br></body></html>