Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: RLM fit history uses WLS scale and not the robust scale estimate #9219

Open
josef-pkt opened this issue Apr 18, 2024 · 0 comments
Open

Comments

@josef-pkt
Copy link
Member

update history in RLM uses WLS scale instead of robust scale.

That's a bug but without much consequence.

AFAICS, the only problem is if convergence criterion is 'sresid', and that is only relevant for detecting when there are no changes anymore.

history['scale'] doesn't seem to be used and is only as information or results during iteration loop.
This seems to be the only misleading part here.

    def _update_history(self, tmp_results, history, conv):
        history['params'].append(tmp_results.params)
        history['scale'].append(tmp_results.scale)
        if conv == 'dev':
            history['deviance'].append(self.deviance(tmp_results))
        elif conv == 'sresid':
            history['sresid'].append(tmp_results.resid / tmp_results.scale)

It's unlikely that we need to check also the robust scale estimate for convergence.
(It might not have converged in some corner cases, even when params has converged at tol. scale estimate should be continuous in params, so small changes in params should only have small changes in scale.)

scale.Huber for simultaneous mean-scale estimation checks convergence of both mean and scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant