The problem is:
Original Problem |
---|
min∑ixisd(x)<αxi∈{0,1} |
Notes:
- Here sd is the standard deviation.
- We assume x has n components.
- Of course, < is problematic in optimization. So the equation should become a ≤ constraint.
- The standard formula for the standard deviation is: √∑i(xi−ˉx)2n−1 where ˉx is the average of x.
- This is an easy problem. Just choose xi=0.
- When we use max∑ixi things are equally simple. In that case choose xi=1.
- There is symmetry: sd(x)=sd(1−x).
- A more interesting problem is to have sd(x)≥α.
Updated problem
A slightly different problem, and somewhat reformulated is:
MIQCP problem |
---|
minˉxˉx=∑ixin∑i(xi−ˉx)2n−1≥α2xi∈{0,1} |
First, we replaced < by ≥ to make the problem more interesting. Furthermore I got rid of the square root. This removes a possible problem with being non-differentiable at zero. The remaining problem is a non-convex quadratically constrained (MIQCP=Mixed Integer Quadratically Constrained Problem). The non-convexity implies we want a global solver.
This model solves easily with solvers like Baron or Couenne.
Integer variable
When we look at the problem a bit more, we see we are not really interested in which xi's are zero or one. Rather, we need only to worry about the number. Let k=∑ixi, Obviously ˉx=k/n. But more interestingly: sd(x)=√k(1−ˉx)2+(n−k)(0−ˉx)2n−1 The integer variable k is restricted to k=0,2,…,n.
Thus we can write:
MINLP problem |
---|
minkk(1−k/n)2+(n−k)(k/n)2n−1≥α2k=0,1,…,n |
The constraint can be simplified into k−k2/nn−1≥α2 This is now so simple we can do this by enumerating k=0,…,n, check the constraint, and pick the best.
Because of the form of the standard deviation curve (note the symmetry), we can specialize the enumeration loop and restrict the loop to k=1,…,⌊n/2⌋. Pick the first k that does not violate the constraint (and when found exit the loop). For very large n we can use something like a bisection to speed things up even further.
So this example optimization problem does not really need to use optimization at all.
References
- Constrained optimisation with function in the constraint and binary variable, https://stackoverflow.com/questions/57850149/constrained-optimisation-with-function-in-the-constraint-and-binary-variable
- Another problem that minimizes the standard deviation, https://yetanothermathprogrammingconsultant.blogspot.com/2017/09/minimizing-standard-deviation.html
No comments:
Post a Comment