Uploaded image for project: 'Commons Statistics'
  1. Commons Statistics
  2. STATISTICS-84

Create the Mean from array input using a summation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Implemented
    • None
    • 1.1
    • descriptive
    • None
    • Easy

    Description

      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.

      Attachments

        1. mean_double_4096.png
          1.03 MB
          Alex Herbert
        2. mean_float_4096-1.png
          995 kB
          Alex Herbert
        3. mean_float_4096.png
          1.08 MB
          Alex Herbert

        Activity

          People

            Unassigned Unassigned
            aherbert Alex Herbert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: