Repository navigation
ENH: Add Vuong test for non-nested model comparison - #10502
Merged
Merged
Conversation
This was referenced Oct 24, 2026
bashtage
added a commit
that referenced
this pull request
Oct 25, 2026
Add compare_vuong next to compare_cox, compare_j and compare_encompassing. The Sphinx entries in docs/source/stats.rst already exist. Follow up to gh-10502. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
bashtage
added a commit
that referenced
this pull request
Oct 25, 2026
Add versionadded, use optional for default markers, document the parameter count convention versus pscl and nonnest2, the missing preliminary variance test and the omega == 0 case, correct the reference attribution, and show the example output. Follow up to gh-10502. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
bashtage
added a commit
that referenced
this pull request
Oct 25, 2026
Use default_rng, move imports to module level and test the one-sided alternatives against scipy.stats.norm. Follow up to gh-10502. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
bashtage
added a commit
that referenced
this pull request
Oct 25, 2026
ENH: Follow up on #10502, export compare_vuong and complete its docs
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.
NumPy's guide.
Adds
compare_vuong, the Vuong (1989) test for non-nested likelihood models, as requested in #3897.The test compares two models estimated on the same data through their observation-wise log-likelihoods and returns a z-statistic and p-value, with optional AIC/BIC corrections and one- or two-sided alternatives. It follows the API pattern of the existing
compare_coxandcompare_jfunctions.Design notes:
Test values were verified against the
vuongfunction of the R package pscl 1.5.9 (the R code is recorded in the test module) on the randhie data shipped with statsmodels, covering Poisson / NegativeBinomial / ZeroInflatedPoisson / Logit / Probit pairings, one-sided alternatives, symmetry under argument swapping, and all error cases.AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following.
Tool(s):
Claude.Used for:
drafting the implementation, writing the tests, editing the docstring, debugging.I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.