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/05 12:47:00 UTC
[jira] [Updated] (STATISTICS-84) Create the Mean from array input using a summation
[ https://issues.apache.org/jira/browse/STATISTICS-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Herbert updated STATISTICS-84:
-----------------------------------
Attachment: mean_float_4096.png
> Create the Mean from array input using a summation
> --------------------------------------------------
>
> Key: STATISTICS-84
> URL: https://issues.apache.org/jira/browse/STATISTICS-84
> Project: Commons Statistics
> Issue Type: Improvement
> Components: descriptive
> Reporter: Alex Herbert
> Priority: Trivial
> Attachments: mean_float_4096.png
>
>
> The creation of the Mean from an array uses the rolling mean algorithm. This requires a divide for each input value. The algorithm is slow when compared to a simple sum of the values and a divide of the sum. The advantage is that the algorithm is overflow safe and computes the mean in a single pass (useful for streams).
> In the majority of use cases a sum will not overflow. Change the array construction to attempt a sum to compute the mean, reverting to the rolling mean if this fails.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)