You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: fit_collinear, unit tests and make public, advertise #8580
We need something public that drops collinear columns.
Main work will be to add unit tests for extra keywords in model.__init__ for _fit_zeros which is also private and not in docs.
possible solution: add public fit_collinear only to models that we have checked, unit tested, but not generically in base.
current fit_collinear uses a single QR decomposition.
In a multicollinearity PR, I also have sequential dropping, new QR after dropping a column (AFAIR)
I was trying out scipy pivoting QR q, r, p = linalg.qr(a, mode='economic', pivoting=True)
but again it looks kind of arbitrary which columns need to be dropped
bump
we had a new question/proposal for dropping on mailing list "Elimination of singular variables from linear regressions"
we have unit test for _fit_collinear in base test_generic_methods, but it only verifies params table (params, bse, tvalues, pvalues) and predict.
related:
fit_constrained is missing in linear regression models, AFAIR
OLS has partially implemented offset, used for regularized coordinate descend for elastic net, only internal kwd
(AFAICS, mainly in loglike and not in fit)
needs more unit test
and degrees of freedom in F/Wald test needs to be fixed.
Based on an example, I don't get the correct df for the constraints in wald_test_terms and anova_lm in OLS.
I did not check again the examples with GLM and discrete (which were my main working cases in the previous times)
otherwise it looks like it works fine for OLS
same with _fit_zeros
aside: linear models, OLS don't have fit_constrained, but I don't find an issue for it.
I thought we had and issue.
Main point I got stuck with before was no offset in linear models to directly correct for affine constraints.
Activity
josef-pkt commentedon Mar 6, 2023
for linear models like OLS
I guess if users have to explicitly request method - "qr-piv" or "qr-seq", then it is explicit enough that there are multi- or perfect collinearities.
related discussion, PR in scipy scipy/scipy#18097
josef-pkt commentedon Jun 7, 2024
bump
we had a new question/proposal for dropping on mailing list "Elimination of singular variables from linear regressions"
we have unit test for
_fit_collinearin basetest_generic_methods, but it only verifies params table (params, bse, tvalues, pvalues) and predict.related:
fit_constrained is missing in linear regression models, AFAIR
OLS has partially implemented offset, used for regularized coordinate descend for elastic net, only internal kwd
(AFAICS, mainly in loglike and not in
fit)josef-pkt commentedon Nov 5, 2025
bump
needs more unit test
and degrees of freedom in F/Wald test needs to be fixed.
Based on an example, I don't get the correct df for the constraints in wald_test_terms and anova_lm in OLS.
I did not check again the examples with GLM and discrete (which were my main working cases in the previous times)
otherwise it looks like it works fine for OLS
same with
_fit_zerosaside: linear models, OLS don't have
fit_constrained, but I don't find an issue for it.I thought we had and issue.
Main point I got stuck with before was no offset in linear models to directly correct for affine constraints.