Repository navigation
DOC: document params ordering in zero-inflated model docstrings - #11289
Open
wangkangmao wants to merge 2 commits into
Open
wangkangmao wants to merge 2 commits into
wangkangmao wants to merge 2 commits into
Conversation
|
Thanks for the pull request! The PR description has no AI Disclosure section. If you replaced the pull request template with your own description, please add the section below. Per the AI Policy, every pull request must state whether AI tools were used. Please edit the PR description so it includes the section below, tick exactly one box, and, if AI tools were used, replace the placeholders with the tool name(s) and how they were used. #### AI Disclosure
Contributions must comply with the statsmodels [AI Policy](https://www.statsmodels.org/devel/dev/ai-policy.html).
- [ ] No AI tools were used to develop this pull request.
- [ ] AI tools were used.
Tool(s): `<name(s), e.g. Copilot, Claude, ChatGPT>`.
Used for: `<e.g. drafting an implementation, writing tests, debugging, editing docstrings>`.
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.This check re-runs automatically when the description is edited. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9319
Issue
The docstrings of the multi-part (zero-inflated) count models do not say how the
paramsvector is composed or ordered. This matters for users supplyingstart_paramstofit, becausefitinherits its docstring from the base model and carries no model-specific information aboutparams.Root cause
GenericZeroInflated.__init__prepends the inflation-model names toexog_names:and
ZeroInflatedGeneralizedPoisson/ZeroInflatedNegativeBinomialPappendalphaat the end. The likelihood, score and Hessian methods consistently splitparamsatk_inflate, but none of the four class docstrings documented this, so the correct order was only discoverable by instantiating a model and inspectingexog_names.Change
Add a shared
Notessection (_doc_params_order) stating that inflation parameters come first, count-model parameters follow, andalphais last for the Generalized Poisson / Negative Binomial variants. Referenceexog_namesas the authoritative source and include a concrete example. Inject it into the class docstrings ofGenericZeroInflated,ZeroInflatedPoisson,ZeroInflatedGeneralizedPoissonandZeroInflatedNegativeBinomialP.Docs-only change: no runtime behavior is modified.
Verification
Confirmed the documented order against a live model instance:
All four class docstrings render the new Notes section, and the changed module's test suite passes: