BlueMountainCapital/Deedle — pull request #180 by tpetricek (2014-03-22 20:18:49+00:00)
Title: Review and document the Stats module.

I have not done any major changes in the implementation, so this checkin mainly just adds documentation to the functions etc. (I will add separate documentation page in an upcoming commit).

The notable changes are:

* I removed `Array.copy` from `movingWindowFn`. This function is internal and none of our uses mutates the array, so this is safe (it speeds things up only a little though). I also made some functions `inline`, but this also does not add that much.

* In `initSumsSparse`, I replaces `Seq.filter` and `Seq.map` with single `Array.choose`. This actually makes things a bit faster

* When calculating expanding variance and standard deviation, I changed the code to return `nan` when there are less than 2 elements (before, this returned 0 for no elements and `nan` for 1 elements, which, I think, does not make sense).

* I added "normal" versions of all the functions so that you can use e.g. `Stat.mean` to get mean of a series. I think we should move all statistics into the `Stat` module (for consistency and to cleanup the namespaces).

* I also added a couple of tests comparing our statistics with those reported by Math.NET. Curiously, [Wolfram Alpha returns some of the numbers differently](https://twitter.com/tomaspetricek/status/447466666814107648) but Deedle matches Math.NET, so this must be some oddity.