-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: patsy raises with zero constraint #89
Comments
See #90 I don't quite understand what you're trying to do here, but I guess I agree that there's no reason to rule out degenerate constraints like this. There's another similar case that we also error out on right now: constraint matrices with zero rows. Currently the patch in #90 alters patsy to allow for constraints to have a row with all-zero coefficients, but it still doesn't allow for constraints with no rows at all. But semantically, I guess this would be an "always true" constraint, similar to CC: @kshedden |
I never ran into the empty, zero rows constraints. But in many cases, the consistent empty array handling is convenient. In the case of t_test, after commenting out the zero rows check in patsy: repr and string summary of test results raises an exception, but all the computation look like they work correctly based on np.linalg and dot behavior with empty arrays. So, from the statsmodels side the zero row exception could also be removed. (we have to fix the string summary to fully support it)
the above is for OLS with just numpy arrays, but it works the same way with formulas. |
asides: all zeros constraint, that I ran in before but, AFAIR, wasn't needed in final design for that (constrained estimation): |
Why does patsy raise a ValueError in this case?
It looks like a perfectly valid degenerate case.
We are reusing t_test which uses patsy's constraint for other things that pure constraints.
statsmodels/statsmodels#3096
patsy\constraint.py", line 62:
(In my opinion patsy should not enforce statistics, but can warn instead.)
The text was updated successfully, but these errors were encountered: