-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
COBYLA successful termination when constraints violated #2891
Comments
To add insult to injury, in |
PR merged |
I would like to raise some doubt to the validity of this update. Granted, I have not checked the magnitude of the constraint violations, but reading the documentation in the original Fortran 77 file cobyla2.f (available in this package), lines 38 and 39, it is stated:
If I interpret the scipy API documentation for fmin_cobyla correctly, If the observed constraint violations are less than
|
Please check the added example case and the stackoverflow message. |
If you decide to it, thanks! One thing less on my kilometer long todo list. |
I am not really a python user, I came across this scipy issue since a similar issue had been reported in the C# COBYLA2 repository that I maintain. But looking at the source code provided in the StackOverflow question, I cannot immediately see that the defined |
The constraint violation in the test case added in gh-2893 is 0.35 (the characteristic sizes of constraints c1,c2,c3 are 500,5,5, so the error is larger than rhoend even if it is relative tolerance). Moreover, the error cannot be made smaller by using a smaller |
OTOH, using a smaller |
I have tested the gh-2893 test case myself now running Python 2.7, and yes, I stand corrected. I agree with incorporating this pull request, although I think it might be reasonable to sync the constraint violation analysis with As you also have noted, one solution to avoiding constraint violations in this particular case is to start with a smaller |
The
fmin_cobyla
algorithm can terminate without actually satisfying the constraints.Indeed, it has a
maxcv
return value that reports the constraint violation.See e.g. http://stackoverflow.com/questions/18782092/python-scipy-optimization-issue-fmin-cobyla-one-constraint-is-not-respected http://pastebin.com/gjbeePgt
This is quite surprising behavior, and definitely not adequately documented.
The COBYLA wrappers probably should check the constraint violation, and return with a failed status if it is bigger than some allowed tolerance.
The text was updated successfully, but these errors were encountered: