Commit 6488bc5
committed
MATH-1671: Update stat.descriptive package to use Commons Statistics
Removes redundant classes.
descriptive.moment:
- FirstMoment
- FourthMoment
- GeometricMean
- Kurtosis
- SecondMoment
- Skewness
- StandardDeviation
- ThirdMoment
Mean + Variance have been changed to only implement the weighted
evaluation interface.
descriptive.rank:
- Min
- Max
descriptive.summary:
- Sum
- SumOfLogs
- SumOfSquares
Product has been changed to only implement the weighted evaluation
interface.
The utility class StatUtils has been updated to delegate all calls to
Commons Statistics. Legacy Math exceptions have been preserved. Removes
methods to compute the variance using an existing mean:
public static double variance(double[] values, double mean, int begin,
int length)
public static double variance(double[] values, double mean)
public static double populationVariance(double[] values, double mean,
int begin, int length)
public static double populationVariance(double[] values, double mean)
Note: StatUtils has inconsistent documentation of what to return for an
empty array. The documentation states NaN but StatUtilsTest requires
otherwise:
Sum-of-squares = 0
Product = 1
Sum-of-logs = 0
This is inconsistent and has been updated to NaN for all statistics.
The class MultivariateSummaryStatistics has been updated with partial
implementations of StorelessUnivariateStatistic that delegate to Commons
Statistics.
Some test classes have been updated to pass the build after removal of
the statistic implementations.1 parent e7ab52e commit 6488bc5
File tree
56 files changed
+970
-4524
lines changed- commons-math-legacy/src
- main/java/org/apache/commons/math4/legacy
- ml/clustering
- evaluation
- optim/nonlinear/scalar
- stat
- correlation
- descriptive
- moment
- rank
- summary
- regression
- test/java/org/apache/commons/math4/legacy
- distribution/fitting
- stat
- correlation
- descriptive
- moment
- rank
- summary
- regression
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+970
-4524
lines changedLines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
431 | 430 | | |
432 | 431 | | |
433 | 432 | | |
434 | | - | |
| 433 | + | |
435 | 434 | | |
436 | | - | |
| 435 | + | |
437 | 436 | | |
438 | | - | |
| 437 | + | |
439 | 438 | | |
440 | 439 | | |
441 | 440 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments