clbustos/statsample — pull request #14 by monicadragan (2013-07-07 17:29:11+00:00)
Title: CodeReview Round 1

Hi Ankur,

Here are my comments after reading your code (pacf implementation):

Your code is well organized (small functions, you make use of methods in Enumerable) and easy to read. Also, you provide useful comments, with references.

Some suggestions:
- type error handling for function arguments (should be useful, as long as you're using a lot of predefined types from other modules)
- avoid return where not required (to be fair, I used returns myself too, but I think this is not ruby stile and also my reviewer commented on this)
- line 62: "ts = series". Not sure what you want to do here, but if you want to avoid mutation of the array you should clone the variable (i.e "ts = series.clone")
- line 73: r = Array.new(k + 1) { 0.0 } -> should be more elegant like this: "Array.new(k + 1, 0.0)"
- line 76: avoid for loops; you can use (1..k).each do |i| ... (you are avoiding this in other parts of the code, though)
- be consequent with using (or using not) parenthesis for the arguments of the functions

Hope this was useful. Btw, I was learning a lot reading your code!
You have an interesting and useful project, so very good luck!

Monica