jakarta-taglibs-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: DataGrid and Common Math
Date Mon, 07 Jun 2004 17:56:02 GMT
Thought it would be good to expose this conversion on the Developers list.

-Mark

Nestor,

It should be easy to add.

The basic strategy behind the library is that you can implement your own
DescriptiveStatistics implementation backed by your data structures.
There are a couple classes in the test and experimental sections which
reflect this behavior. BeanListUnivariateStatistics and
ListUnivariateStatistics. So basically, if your already maintaining any
of the data in memory, you can implement a DescriptiveStatistics
implementation that wraps it.

http://jakarta.apache.org/commons/math/xref-test/index.html
http://jakarta.apache.org/commons/math/xref-test/org/apache/commons/math/stat/univariate/ListUnivariateImpl.html
http://jakarta.apache.org/commons/math/xref-test/org/apache/commons/math/stat/univariate/BeanListUnivariateImpl.html

These are Implementations of the "DescriptiveStatistics" interface below
http://jakarta.apache.org/commons/math/xref/index.html
http://jakarta.apache.org/commons/math/xref/org/apache/commons/math/stat/univariate/DescriptiveStatistics.html

Looking at your code thusfar, it seems you can only maintain one
aggregate per result column. If instead, there were one
DescriptiveStatistics object per column as the aggregation object, then
you could provide multiple statistical results in the footer of the
table per column. And, since the DescriptiveStatistics objects maintains
bean methods for retrieving those statistics, this would look very
reasonable in EL

DescriptiveStatistics results = DescriptiveStatistics.newInstance();

/* store it in the pageContext ... */
pageContext.putAttribute("results",results );

<%--Access it in EL--%>
${results.mean}
${results.variance}
${results.median}
${results.min}
...

-Mark

Nestor Boscan wrote:

>Hi Mark
>
>I can use the UniviariateStatistic.getN() method but that means that I will
>have to use wrappers on the different aggregate functions so I can call the
>"getN" method with the count aggregate and the "getResult" method with the
>other aggregate functions. If you have a count class I just map the datagrid
>directly with the common math libraries and use the "evaluate" and
>"getResult" methods.
>
>Regards,
>
>Néstor Boscán
>
>-----Mensaje original-----
>De: Mark R. Diggory [mailto:mdiggory@latte.harvard.edu] 
>Enviado el: Monday, June 07, 2004 11:23 AM
>Para: Nestor Boscan
>Asunto: Re: DataGrid and Common Math
>
>Hi Nestor,
>
>The count feature is actually part of the UnivariateStatistic Interface, any
>stat you can call UniviariateStatistic.getN() to retrieve the number of
>addValues that have occured. As well, if you use the SummaryStatistics or
>DescriptiveStatistics objects, then the also supply a getN property. If you
>require a separate "count" aggregate, I can add a simple one to the library.
>
>I noticed when I looked at your aggrigates that they were similar, I'm glad
>to see some reuse can occur. We are getting close to an actual version
>release. Until that time I recommend using the nightly builds.
>
>http://cvs.apache.org/builds/jakarta-commons/nightly/commons-math/
>
>-Mark
>
>Nestor Boscan wrote:
>
>  
>
>>Hi Mark
>> 
>>I just checked out the common math library. The statistical 
>>aggregations in the datagrid code works the same way that the common 
>>math library so integrating them will be very easy. The only function 
>>that I didn't see is the count aggregation that counts the number of 
>>values added. I see that the project doesn't have a release build. Do 
>>you know when a release build will be available?
>> 
>>Regards,
>> 
>>Néstor Boscán
>>    
>>
>
>
>
>
>  
>




Mime
View raw message