commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz (JIRA)" <>
Subject [jira] Commented: (MATH-384) DescriptiveStatistics based on double[]
Date Mon, 27 Sep 2010 01:11:33 GMT


Phil Steitz commented on MATH-384:

Looks good.  I have a couple of comments, which I will address in the commit if we agree on

1. The addition to DoubleArray interface should only be applied to the 3.0 branch

2. I am not sure we want/need the constructor, DescriptiveStatistics(ResizeableDoubleArray);
the version just taking a double[] is probably sufficient and better from maintainability
and API simplicity standpoint (in case we ever dump the current internal store).

3. I need to add some tests to confirm, but I don't think the expansion criteria newSize >=
numElements + 1 is correct, unless you first force a contract().  Remember that there could
be unused elements at the beginning of the array if "rolling" has occurred since the last
contraction.  I am also wondering whether you really need to mimic the behavior of expand()
in this method.  There is no invariant that says expansion needs to always happen in lumps
as defined by the expansion mode.  This machinery is there to eliminate the need to expand
on every single value addition.  Seems to me that we could just shove the new values to the
end of the array and update numElements.  Am I missing something?

> DescriptiveStatistics based on double[]
> ---------------------------------------
>                 Key: MATH-384
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: Mikkel Meyer Andersen
>            Priority: Minor
>             Fix For: 2.2
>         Attachments: patch-MATH-384-2, ResizableArrayInstantiatedByArray
>   Original Estimate: 2h
>  Remaining Estimate: 2h
> Right now the DescriptiveStatistics is for ResizableDoubleArray, but if the user has
the double[] data she wishes to get DescriptiveStatistics for there is no way of doing this
(besides the inefficient way of creating a ResizableDoubleArray from the double[]).
> It would be possible to use StatUtils, but it does not contain near as much functionality
as DescriptiveStatistics.
> Idea: Create a DescriptiveStatistics for double[] also. I'm not sure which way of implementing
it would be the best, but one way would be to make DescriptiveStatistics abstract with all
but the apply-method implemented as now. The apply-method should be made as abstract which
then has to implemented in the extensions together with a field containing the values. (addValue,
windowSize etc. has to go in the ResizableDoubleArray-extension.) The double[]-extension should
then have a constructor taking double[] as a parameter.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message