Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 78437 invoked from network); 27 Sep 2004 16:27:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Sep 2004 16:27:59 -0000 Received: (qmail 77700 invoked by uid 500); 27 Sep 2004 16:27:55 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 77605 invoked by uid 500); 27 Sep 2004 16:27:55 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 77592 invoked by uid 99); 27 Sep 2004 16:27:55 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [140.247.210.252] (HELO latte.harvard.edu) (140.247.210.252) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 27 Sep 2004 09:27:51 -0700 Received: from [140.247.212.206] (lorien.fas.harvard.edu [::ffff:140.247.212.206]) (AUTH: PLAIN mdiggory, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by latte.harvard.edu with esmtp; Mon, 27 Sep 2004 12:27:47 -0400 Message-ID: <41583F76.8010804@latte.harvard.edu> Date: Mon, 27 Sep 2004 12:27:34 -0400 From: "Mark R. Diggory" Reply-To: mark_diggory@harvard.edu User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: Re: [math] API changes for RC2 References: <95F1CCA52E317C49AB7AA71B16E8988B0C2387@mail2.tsd.biz> In-Reply-To: <95F1CCA52E317C49AB7AA71B16E8988B0C2387@mail2.tsd.biz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I see now from Kim's previous example that the population/sample strategy shouldn't be a problem in this regard and could be done on the fly. Where is bias reduction used in the calculation? -Mark Phil Steitz wrote: > Hmm... Technically, just for variance / std dev, the adjustment could be made on the fly in getResult() (possibly bad numerics, have to look into this), but I think that I agree with the principle that allowing reconfiguration after data has been added to the storeless stats may be a bad idea. I am OK making the biasReduction property immutable. I don't know if there are use cases where both might be needed. Kim? > > For the Variance / Std. Dev., should the property be boolean or floating point? > > Phil > > -----Original Message----- > From: Mark R. Diggory [mailto:mdiggory@latte.harvard.edu] > Sent: Mon 9/27/2004 9:12 AM > To: Jakarta Commons Developers List > Cc: > Subject: Re: [math] API changes for RC2 > > > > > > Al Chou wrote: > > > > So someone please lay out a real(istic) use case. Would you ever make two > > successive (or closely separated, anyway) method calls to get both the sample > > and population result for the same dataset? Or do you usually just use one and > > not the other? In pseudo-code, do you ever need to do this: > > > > StandardDeviation sd = new StandardDeviation( ... ) ; > > sd.getResult() ; > > sd.getPopulationResult() ; > > > > or is it sufficient functionality if you have to say something like: > > > > > > StandardDeviation sd = new StandardDeviation( ... ) ; > > sd.Result() ; > > sd.populationResult = true ; > > sd.Result() ; > > > > I realize that it's only one extra line of code, but if you're calling these > > statistics often, one extra line per invocation could be enough to make the API > > unnecessarily awkward. > > > > > > Al > > Al, > > I address this in my other response. The real issue is that in the > storeless case, any of these approaches is not possible because the > statistic up to that point has been calculated using the earlier > approach. You can't go back and recalculate it. The more logical > approach is this: > > StandardDeviation pop = new StandardDeviation(population_flag) ; > StandardDeviation sample = new StandardDeviation(sample_flag) ; > > ... add a bunch of values to both > > double p = pop.getResult(); > double s = sample.getResult(); > > Not only that, in this example its very clear which "Object" your > working with, The statistics still stay separate Objects and the > Variation in behavior is still encapsulated in the one implementation of > StandardDeviation. > > -Mark > > -- > > > > > ------------------------------------------------------------------------ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org -- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org