Ankur Goel

On hunt of awesomeness!

StatSample

Statsample is a statistical library for Ruby and is actively developed by folks at SciRuby. Currently, Statsample is supported with Ruby 1.8.7, 1.9.1, 1.9.2 and ruby-head.

Statsample is currently makes use of Ruby/GSL which uses NArray for vector and matrix operations. It conflicts with the SciRuby’s NMatrix which also uses the same class names - NMatrix and NVector. Thus, this conflict makes Statsample unusable for system which already has NMatrix. To aid this, SciRuby developed a fork of rb-gsl which makes use of NMatrix instead of NArray. I went through it’s code structure and found it to be great. Devs did a great job in removing many references of NArray and made use of NMatrix in lieu of that.

Statsample is purposed idea for Google Summer of Code 2013 program. And, I am excited about making Statsample more flexible by covering various aspects:

  • Make Statsample compatible for Ruby 1.9.3+
  • Enable Statsample to require rb-gsl fork instead.
  • Add more tests to the code and cover the documentation using existing style of NMatrix.
  • Implement modules for Generalized Linear Models(GLM) and Time Series Analysis.

I have been playing around with existing codebase by writing few examples and test cases from few days and had discussion about this with fellow folks at SciRuby (John Woods, Claudio Bustos and Carlos Agarie). I’m very grateful for their response and persuasion. The discussion with them helped me to clarify many aspects which were a little obscure earlier. :)

Just before writing down this blog-entry, I was trying out TimeSeries class and it’s methods. I simply loved it - the ease with which I was able to compute the operations, I learnt back in Digital Signal processing such as lagging of series, autocorrelation, exponential moving average etc is mindblowing. It currently supports many basic operations, which after the successful execution of this project can definitely be expanded.

I will be delighted to work on Statsample in this summer, if given an opportunity.

Cheers!
- Ankur Goel

PS: I will try to blog with example codes in next posts.