Popularity
1.5
Growing
Activity
0.0
Stable
0
2
0

Monthly Downloads: 6
Programming language: Haskell
License: LicenseRef-OtherLicense
Tags: Math    

staf alternatives and similar packages

Based on the "Math" category.
Alternatively, view staf alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of staf or a related project?

Add another 'Math' Package

README

Build Status Code Climate

Stats.Foldable

A pure Haskell module that implements a safe interface to a set of statistical computations for all Foldable containers. Folding (i.e. reducing or crushing) is a great fit for statistics, where a full data set has to be reduced to a single object that represents the set in a meaningful way.

Install

There are two standard ways of obtainig the module:

  • by cloning the GitHub repository: git clone https://github.com/lovasko/staf
  • by using the central Hackage server: cabal install staf

API

All staf functions use the Maybe type to represent a failure (e.g. an empty container provided as the input). All numerical arguments are limited to the least-assuming typeclass. The module exports the following 7 functions:

Arithmetic mean

amean :: (F.Foldable f, Floating a)
     => f a     -- ^ population
     -> Maybe a -- ^ arithmetic mean

Minimum

min :: (F.Foldable f, Ord a)
    => f a     -- ^ population
    -> Maybe a -- ^ minimal value

Maximum

max :: (F.Foldable f, Ord a)
    => f a     -- ^ population
    -> Maybe a -- ^ maximal value

Variance

var :: (F.Foldable f, Floating a)
    => f a     -- ^ population
    -> Maybe a -- ^ variance

Standard deviation

stddev :: (F.Foldable f, Floating a)
       => f a     -- ^ population
       -> Maybe a -- ^ standard deviation

Covariance

covar :: (F.Foldable f, Floating a)
      => f a     -- ^ first population
      -> f a     -- ^ second population
      -> Maybe a -- ^ covariance

Pearson correlation

correl :: (F.Foldable f, Floating a)
       => f a     -- ^ first population
       -> f a     -- ^ second population
       -> Maybe a -- ^ correlation

Numerical stability

There is no current stability guarantee in any of the provided algorithms.

License

The staf module is licensed under the [2-clause BSD license](LICENSE). In case that any other licensing is needed, feel free to contact the author.

Author

Daniel Lovasko [email protected]


*Note that all licence references and agreements mentioned in the staf README section above are relevant to that project's source code only.