You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Alex Herbert (Jira)" <ji...@apache.org> on 2024/01/01 10:08:00 UTC

[jira] [Commented] (STATISTICS-81) Implement descriptive statistics for integer types

    [ https://issues.apache.org/jira/browse/STATISTICS-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17801522#comment-17801522 ] 

Alex Herbert commented on STATISTICS-81:
----------------------------------------

Added aggregate statistics for int[] and long[] in commit:

3afb93d2b17182c5d4cf07839c6fe2e39eb3da54

> Implement descriptive statistics for integer types
> --------------------------------------------------
>
>                 Key: STATISTICS-81
>                 URL: https://issues.apache.org/jira/browse/STATISTICS-81
>             Project: Commons Statistics
>          Issue Type: Improvement
>          Components: descriptive
>            Reporter: Alex Herbert
>            Priority: Minor
>
> The descriptive module defines the DoubleStatistic as a composite interface:
> {code:java}
> public interface DoubleStatistic extends DoubleConsumer, DoubleSupplier{code}
> The implementations compute on a stream of {{double}} values, and provide factory methods to compute on a {{{}double[]{}}}.
> The moment based statistics use a rolling algorithm for numerical stability. The moment based statistics (mean, variance, skewness, kurtosis) perform a double pass computation over array data.
> Several of the statistics can be efficiently computed for integer types using different algorithms. For example:
> {noformat}
> mean = sum(x) / n
> variance = 1/n * [ sum(x^2) - (sum(x))^2 / n ]
> {noformat}
> These can operate using a single-pass and are not subject to loss of precision if the sums are accumulated with enough integer bits of precision. For a stream the sums must be able to accept up to 2^63 observations. In the case of an array the maximum number of observations is ~2^31 allowing some optimisation. Sums can avoid using BigInteger with special implementations of signed and unsigned summation arithmetic. The final statistic can be computed using extended floating-point precision (e.g. double-double).
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)