Comment 1 for bug 521229

Revision history for this message
joep (josef-pktd) wrote :

We cannot replace asarray with asanyarray in any conversion!

statsmodels calculations are written to work with arrays, using matrices including sparse matrices would change multiplication and axis reduction (eg. in mean()). I expect that this would break things all over the place.

Enabling sparse matrix calculations would require a lot of changes to the internal code.

For the specific case of a sparse full sized covariance matrix, or it's cholesky (or other) decomposition, it might be worthwhile to specialcase this. As an alternative for GLS, we could use a callback function for whiten, that could then handle sparse calculations. But I'm not sure, and we have to check if changing only whiten is enough (I think it might work, since all GLS calculations go through whiten).

However, this would not be enough if we want to have exog sparse as for example for system of equations regression.