Repository navigation
ENH: Follow up on #10502, export compare_vuong and complete its docs - #10560
Merged
Merged
Conversation
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 statsmodelsgh-10502. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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 statsmodelsgh-10502. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Use default_rng, move imports to module level and test the one-sided alternatives against scipy.stats.norm. Follow up to statsmodelsgh-10502. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
Follow up to #10502 (
compare_vuong). It addresses the points left in the review of that PR.compare_vuongis exported fromstatsmodels.stats.api, next tocompare_cox,compare_jandcompare_encompassing.docs/source/stats.rstalready lists it.versionaddedon the function and the result class;correctionandalternativeuse, optionaland give the default in the text;VuongTestResulthas a one-line docstring likeNonNestedTestResult; the Examples block prints the result; the Notes were checked against R. The uncorrected statistic, and the corrected ones for models with the same number of parameters (Poisson against zero-inflated Poisson, Logit against Probit), agree withpscl::vuong. For negative binomial the corrected statistics differ becausepscldoes not count the dispersion parameter and statsmodels counts every estimated parameter.nonnest2::vuongtestdivides byn, so its statistic is larger bysqrt(n / (n - 1)). The Notes also say that Vuong's preliminary test ofomega^2 = 0(needed for nested and overlapping models) is not performed and what happens whenomegais exactly 0. The unverified statement that Stata uses the same divisor was removed, and the references are attributed to the sections that contain the formulas.test_compare_vuong_alternativecompares"larger"and"smaller"withscipy.stats.normfor one positive and one negative statistic, and the module-level imports anddefault_rngfollow the conventions.Not changed: support for OLS and GLM, and a warning for a near-zero
omega.The release note is in the single 0.15.1 draft.
AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s): Claude Code (Claude Sonnet 5.5).
Used for: reviewing the merged PR, checking the statistic against R, drafting the docstring and test changes.
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.
🤖 Generated with Claude Code