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
{{ message }}
Repository navigation
BUG: RLM fit with start_params raises if only one parameter #9233
if start_params = np.array([5]) one element, 1-dim array, then the squeeze removes the 1-dim which then raises exception in shape check
statsmodels_gh\statsmodels\statsmodels\robust\robust_linear_model.py in fit(self, maxiter, tol, scale_est, init, cov, update_scale, conv, start_params, start_scale)
264 else:
265 start_params = np.asarray(start_params, dtype=np.double).squeeze()
--> 266 if (start_params.shape[0] != self.exog.shape[1] or
267 start_params.ndim != 1):
268 raise ValueError('start_params must by a 1-d array with {} '
IndexError: tuple index out of range
I ran into this for the constant only regression for resistant estimators in #9227
I don't know why there is the squeeze.
If we want or need to keep the squeeze, then a fix is to add start_params = np.atleast_1d(start_params),
I will fix it this way in my PR, where I need it now
Activity
BUG/ENH: fix RLM start_params closes statsmodels#9233. enable RLMDetS…
BUG/ENH: fix RLM start_params closes statsmodels#9233. enable RLMDetS…