MAINT: Cleanup dead code, address FIXMEs, and fix Kalman filter prediction corner case #9740 #9741
Open
un1u3 wants to merge 1 commit intostatsmodels:mainfrom
Open
MAINT: Cleanup dead code, address FIXMEs, and fix Kalman filter prediction corner case #9740 #9741un1u3 wants to merge 1 commit intostatsmodels:mainfrom
un1u3 wants to merge 1 commit intostatsmodels:mainfrom
Conversation
Contributor
Author
|
@bashtage any updates on this PR |
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.
PR for Issue #9740
This PR performs a broad cleanup of the statsmodels codebase to improve maintainability and addresses a specific corner case in Kalman filter predictions. Key changes include removing dead code, implementing missing convergence warnings, and refining diffuse initialization logic.
Detailed Changes
1. Bug Fixes & Improvements
kalman_filter.py): Fixed a corner case where dynamic/out-of-sample predictions were incorrectly initialized if the filter hadn't exited the diffuse phase. Now usesInitialization.from_componentswith the diffuse covariance whenpredicted_diffuse_state_covis non-zero.innovations.py): AddedConvergenceWarningtoinnovations_mlewhen the nonlinear optimizer fails (success=False).2. Dead Code Removal (Library)
regressionplots.py: Removed internal helper_partial_regressionwhich was unused and redundant.3. Test Suite Cleanup
test_glm.py: Removed extensive commented-out test blocks relying on obsoleterpy2infrastructure.test_regression.py: Removed multiple unusedcheck_confidenceintervalsmethods and associated FIXME comments.test_var.py: Removed the unusedCheckVARclass and brokengenerate_varfunctions.test_data.py: Removed the commented-outTestDatesclass.4. Documentation & Annotation
kernels.py: Removed a staleFIXMEinaitchison_aitken_cdf. The logic was verified to be correct for joint CDF definitions of encoded discrete variables.Verification Plan
predictnow correctly passesPinfwhen initializing the forecast model during the diffuse phase.pytest.