I just pushed the latest version of psMathStats to GitHub. It had been sitting on the shelf 95% done for probably a year, but it is out at last. There are some new methods and while the syntax is almost exactly the same, it isn’t a drop-in replacement for 1.0 as it now uses my ps namespace.
A full breakdown of all the methods and functions of 2.0 are available on GitHub, but these are some of the new features.
Probably the biggest new feature is the ability to do sampling for any of the Array methods using Array.sample. It returns a randomly sampled array of any length less than or equal to the source array length. You can use it to quickly do calculations over large datasets (1MM+ rows) very quickly while sacrificing only a small amount of accuracy.
Here is an example:
// This will take a long time (many seconds) to run. // Makes the browser become unresponsive tenMillionRowArray.stdDev(); // Takes only a few milliseconds to run, and the // returned value is almost exactly the same. tenMillionRowArray.sample(20000).stdDev();