Skip to content

BUG: support model-aware RLM scale callbacks - #10191

Merged
bashtage merged 2 commits into
statsmodels:mainfrom
bashtage:fix-rlm-scale-callback-gh9171
Aug 25, 2026
Merged

bashtage merged 2 commits into
statsmodels:mainfrom
bashtage:fix-rlm-scale-callback-gh9171

Conversation

@bashtage

@bashtage bashtage commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Allow callable scale estimators to accept the fitted model and residuals while preserving existing single-argument callback behavior.

Closes #9171

AI Disclosure

Contributions must comply with the statsmodels AI Policy.

If using AI tools, edit the second option to explain which tool was selected and
how the tool's output was used.

Please complete one of the following:

  • No AI tools were used to develop this pull request.
  • AI tools were used.
    Tool(s): Copilot?
    Used for: Based on another PR, looks like critten using copilot
    I have personally read, understood, and can explain every line of this diff, and
    have verified the statistical/numerical correctness of the change.
Details

Notes:

  • It is essential that you add a test when making code changes. Tests are not
    needed for doc changes.
  • When adding a new function, test values should usually be verified in another package (e.g., R/SAS/Stata).
  • When fixing a bug, you must add a test that would produce the bug in main and
    then show that it is fixed with the new code.
  • New code additions must be well formatted. Changes should pass flake8. If on Linux or OSX, you can
    verify you changes are well formatted by running
    git diff upstream/main -u -- "*.py" | flake8 --diff --isolated
    
    assuming flake8 is installed. This command is also available on Windows
    using the Windows System for Linux once flake8 is installed in the
    local Linux environment. While passing this test is not required, it is good practice and it help
    improve code quality in statsmodels.
  • Docstring additions must render correctly, including escapes and LaTeX.
  • If AI tools were used to help write this PR, see the
    AI Policy for what disclosure
    and review is expected of you before submitting.

deepakganesh78 and others added 2 commits August 25, 2026 10:35
Allow callable scale estimators to accept the fitted model and residuals while preserving existing single-argument callback behavior.

Closes statsmodels#9171

Co-authored-by: Copilot <[email protected]>
Use try except to avoid inspect
Add examples to docs
Add test of equivalence
@bashtage
bashtage merged commit 32fe225 into statsmodels:main Aug 25, 2026
13 checks passed
@bashtage
bashtage deleted the fix-rlm-scale-callback-gh9171 branch August 25, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG/ENH: broken code in RLM._scale_est, scale callback option is missing

2 participants