statsmodels/statsmodels — pull request #1341 by josef-pkt (2014-01-28 20:27:17+00:00)
Title: REF/ENH RLM and robust scale for almost perfect prediction

see #55

This makes the code more robust for the cases where we have almost perfect prediction, or where mad of the sample or residual is zero.

There are also small fixes to missing asarray and integer division in robust/scale

The code adds some extra calculation `if scale == 0:`

Explicit, verifying test for `HuberScale` are still missing. I get the same results with an independent new implementation.
New unit tests include a "sanity" check for all norm, scale combinations:
no exceptions, params is reasonably (no nan, close to median) estimated in RLM in all examples
a few nans in bse, and in standalone scale estimates for some corner cases