Popularity
3.3
Declining
Activity
0.0
Stable
3
2
1

Monthly Downloads: 10
Programming language: Haskell
License: MIT License
Tags: Math     Mathematics    
Latest version: v0.2.0.0

moving-averages alternatives and similar packages

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

Do you think we are missing an alternative of moving-averages or a related project?

Add another 'Math' Package

README

moving-averages

This is a library for calculating moving averages on lists of numbers.

Usage

import qualified Data.MovingAverage as MA

resultValues :: Floating a => MA.SmoothedResults a -> [a]
resultValues = map MA.srSmoothedValue . MA.srsResults

-- window of 2
resultValues <$> MA.simple 2 [5, 10, 20, 2]
-- Right [5.0, 7.5, 15.0, 11.0]

-- alpha of 0.5
resultValues <$> MA.singleExponential 0.5 [1, 2, 3, 4, 5]
-- Right [1, 1.5, 2.25, 3.125, 4.0625]

-- alpha of 0.5, beta of 0.1
resultValues <$> MA.doubleExponential 0.5 0.1 [3, 1, 4, 6, 8]
-- Right [3.0, 1.0, 1.5, 2.875, 4.71875]

License

Copyright 2017 Josh Clayton. See the [LICENSE](LICENSE).


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