Skip to content

DOC: improve math formulas in robust.norms docstrings - #9876

Merged
bashtage merged 1 commit into
statsmodels:mainfrom
Lakshmi786:doc/improve-robust-norms-docstrings
Jul 1, 2026
Merged

bashtage merged 1 commit into
statsmodels:mainfrom
Lakshmi786:doc/improve-robust-norms-docstrings

Conversation

@Lakshmi786

Copy link
Copy Markdown

Summary

Improves docstrings in statsmodels/robust/norms.py by moving mathematical formulas out of the Returns description and into proper reStructuredText .. math:: blocks placed before the Parameters section.

This makes the rendered HTML docs consistent with the style already used in HuberT.rho, HuberT.weights, AndrewWave.rho, and RamsayE.rho.

Classes updated:

  • LeastSquares — rho, psi, weights, psi_deriv
  • HuberT — psi
  • RamsayE — psi, weights
  • AndrewWave — psi, weights
  • TrimmedMean — psi, weights

Closes #8807

Move piecewise formulas from the Returns section into proper
reStructuredText math blocks (.. math::) before the Parameters
section, matching the style already used in HuberT.rho and
AndrewWave.rho.

Affected classes: LeastSquares, HuberT, RamsayE, AndrewWave,
TrimmedMean — methods rho, psi, weights, psi_deriv.

Closes statsmodels#8807
@Lakshmi786

Copy link
Copy Markdown
Author

Hi team,

I picked up issue #8807 which has been open since 2020. The ask was to move inline formulas out of the Returns description into proper .. math:: reStructuredText blocks placed before Parameters, matching the style already used in HuberT.rho and AndrewWave.rho.

Classes updated: LeastSquares, HuberT, AndrewWave, RamsayE, TrimmedMean, covering rho, psi, weights, and psi_deriv. No logic was changed, only docstrings. I confirmed all norm functions still return correct values after the edit.

Happy to adjust the LaTeX formatting or add aligned equations for the piecewise cases if the rendered output needs tweaking.

@bashtage

bashtage commented Jul 1, 2026

Copy link
Copy Markdown
Member

LGTM. Thanks.

@bashtage
bashtage merged commit 92c2361 into statsmodels:main Jul 1, 2026
8 checks passed
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.

DOC: docstrings in robust.norms, improve, reorganize

2 participants