You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> yy2 = [150.4, 28.8, 46.6, 40.2, 46.5]
>>> rob.Huber()(yy2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new\statsmodels\statsmodels\robust\scale.py", line 146, in __call__
return self._estimate_both(a, scale, mu, axis, est_mu, n)
File "e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new\statsmodels\statsmodels\robust\scale.py", line 190, in _estimate_both
raise ValueError('joint estimation of location and scale failed to converge in %d iterations' % self.maxiter)
ValueError: joint estimation of location and scale failed to converge in 30 iterations
I have the same issue with scale. Would be willing to consider a systematic overhaul for clarity (likely after getting 0.5-final out the door).
These functions may need a little touching up / style-type changes for expected inputs, input names, etc.. They're mostly left untouched since nipy and before.
Until now they were mostly used internally, but with some cleanup we could advertise them better.
One possibility for using them would be to make a copy of outliers_influence.outlier_test that uses robust mean and scale.
I didn't get huber_scale to work on the example (I didn't try to dig, just try "obvious" way of using it)
Agreed. I underestimated usefulness of robust methods. Difference between textbooks and "real" work maybe. Some examples in the robust tutorial on using but needs more.
Huber uses mad as initial value, which uses center=median independent of mu.
For example when I want to fix mu at zero, Huber produces 0 variance, if I use initscale mad with center=0
also Huber and HuberScale for fixed mu are the same, except for ddof
unittest for Huber has test names reversed return is loc, scale and not scale, loc
Huber docstring explains the M-estimation, but from that I don't see where gamma comes from
Activity
josef-pkt commentedon Oct 29, 2012
using initscale solve the failure to converge problem, but initscale needs to be ndarray.
(I never know whether scale is var or std.)
jseabold commentedon Oct 29, 2012
I have the same issue with scale. Would be willing to consider a systematic overhaul for clarity (likely after getting 0.5-final out the door).
These functions may need a little touching up / style-type changes for expected inputs, input names, etc.. They're mostly left untouched since nipy and before.
josef-pkt commentedon Oct 29, 2012
Until now they were mostly used internally, but with some cleanup we could advertise them better.
One possibility for using them would be to make a copy of outliers_influence.outlier_test that uses robust mean and scale.
I didn't get huber_scale to work on the example (I didn't try to dig, just try "obvious" way of using it)
np.repeat(yy) didn't help
jseabold commentedon Oct 29, 2012
Agreed. I underestimated usefulness of robust methods. Difference between textbooks and "real" work maybe. Some examples in the robust tutorial on using but needs more.
josef-pkt commentedon Jan 27, 2014
continuing from comments in #55
Huber uses mad as initial value, which uses center=median independent of mu.
For example when I want to fix mu at zero, Huber produces 0 variance, if I use initscale mad with center=0
also Huber and HuberScale for fixed mu are the same, except for ddof
unittest for Huber has test names reversed return is loc, scale and not scale, loc
Huber docstring explains the M-estimation, but from that I don't see where gamma comes from
extra bug: mu needs to be an ndarray or we get exceptions.
tools.unsqueeze(mu, axis, a.shape)requires mu to be array