[SciPy-user] Ols for np.arrays and masked arrays

Bruce Southey bsouthey at gmail.com
Mon Jan 19 11:53:11 EST 2009


Hi,
I do not want to sound overly critical as I would like to assist with this.

I am not sure of what your design goal is and what should the Regression 
class actually contain and do.  Do you want something like an R lm object?

But, I do not like that your _init_ function does so much work that 
probably does not belong there. I would have thought that it would just 
initialize certain important variables including the solutions (b). One 
reasons is perhaps you just want to update the input arrays but this 
design forces you to create a new object.

At what stage should you check for valid inputs and the correct 
dimensions of x?

I would also prefer the object having the standard errors of the 
solutions and eventually other 'useful' statistics like sum of squares, 
R-squared. However, I do not know how to the standard errors using 
linalg.lstsq (I vaguely recall there is another way that would work). 
The others are easy to get probably on demand like R's summary function.

Bruce
 









More information about the SciPy-User mailing list