means: calculate varieties of mean/average using semigroup.

[ data, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

calculate varieties of mean/average using semigroup.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4 && <5), semigroups (>0.18) [details]
License MIT
Copyright 2016 Winterland
Author winterland1989
Maintainer winterland1989@gmail.com
Category Data
Source repo head: git clone https://github.com/winterland1989/means.git
Uploaded by winterland at 2016-06-13T04:47:14Z
Distributions NixOS:0.1.0.0
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1022 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-06-13 [all 1 reports]

Readme for means-0.1.0.0

[back to package description]

means

Hackage Travis-CI

This package provide following mean calculations using semigroup:

  • Arithmetic/ Weighted Arithmetic mean:

AM

  • Geometric mean:

GM

  • Harmonic mean:

HM

  • Quadratic mean(RMS):

QM

  • Cubic mean:

CM

  • Midrange mean:

MM

Check wikipedia for details.

Example

*Data.Semigroup.Means> getAM . foldr1 (<>) . map am $ [4, 36, 45, 50, 75]
42.0
*Data.Semigroup.Means> getGM . foldr1 (<>) . map gm $ [4, 36, 45, 50, 75]
30.000000000000007
*Data.Semigroup.Means> getHM . foldr1 (<>) . map hm $ [4, 36, 45, 50, 75]
15.0
*Data.Semigroup.Means> :m + Data.Ratio
*Data.Semigroup.Means Data.Ratio> getMM . foldr1 (<>) . map mm $ [4, 36, 45, 50, 75] :: Ratio Int
79 % 2
*Data.Semigroup.Means Data.Ratio> getAM . foldr1 (<>) . map am $ [4, 36, 45, 50, 75] :: Ratio Int
42 % 1