commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: [math] API changes for RC2
Date Mon, 27 Sep 2004 16:27:34 GMT
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


Mime
View raw message