Basic statistics algorithms in ruby available as a mixin or standalone class
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
README.md
Rakefile
mathstats.gemspec

README.md

Mathstats

Mathstats is a simple statistics library.

Goals

  1. Support for basic statistics equations
  2. No dependencies
  3. Rails integration
  4. Usable as a mixin: [4,8,15,16,23,42].variance
  5. Usable as a library: Mathstats.variance([4,8,15,16,23,42])

Installation

$ gem install mathstats

Usage

require 'mathstats'

Mathstats.attach_to(Array) # => Array.send :include, Mathstats::Mixin
[4,8,15,16,23,42].variance

# Or if you don't want to mess with the Array class
Mathstats.variance([4,8,15,16,23,42])

Methods available

  • mean, average
  • standard_deviation
  • sum
  • variance