Giter Club home page Giter Club logo

statistics's Introduction

Fast Statistic functions for Lists of Float and Int

This package provides functions to get common statistic functions over lists of numbers.

If you need a function that is currently not included, please let me know by creating an Issue in Github or send me an email at [email protected]. Same thing for performance improvements, ideas, sponsoring and job offers.

Performance tests and comparision to other libraries can be found in the benchmark directory or at f0i.de/projects/elm-statistics.

Install

elm install f0i/statistics

Examples

$ elm repl

> import List.Statistics as Stats
-- This is the test data for the following examples:
> data = [1, 1, 2, 2, 4, 8, 8, 9]
[1,1,2,2,4,8,8,9]

> data |> Stats.avg
Just 4.375 : Maybe Float

> data |> Stats.mean -- alias for avg
Just 4.375 : Maybe Float

> data |> Stats.occurrences
Dict.fromList [(1,2),(2,2),(4,1),(8,2),(9,1)]
    : Dict.Dict number Int

> data |> Stats.minmax
Just (1,9) : Maybe ( number, number )

> data |> Stats.stdDeviation
Just 3.1991209730174317 : Maybe Float

-- Get the element 25% into the list (interpolated between closest values)
> data |> Stats.percentile 0.25
Just 1.75 : Maybe Float

-- Some functions have a separate implementation for list of Int
> data |> Stats.percentileInt 0.75
Just 8 : Maybe Int

>

The complete list of function definitions can be found in the package documentation

Development

This package uses elm-test and elm-benchmark. There are make inside the makefile to run these tests whenever a file changes.

Alternatives

There are some other libraries which provide statistics functions:

See https://f0i.de/projects/elm-statistics for performance comparision.

statistics's People

Contributors

f0i avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

statistics's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.