Quadprog - variable values zero or higher than particular value
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Miroslav Strba
el 24 de Ag. de 2017
Comentada: Miroslav Strba
el 25 de Sept. de 2017
Hello,
I am trying to use quadprog in Matlab to solve quadratic problem with particular constraints. Here are they:
1.) x has to be weights vector, so sum of x has to be 1. This includes also constraint, that all values of x have to be from interval (0,1), including 0
2.) x * vector1 = particular value. (vector1 is known, and particular value is set in constraint)
Everything works great and setting constraints wasn't that hard.... but my vector x contains approximately 6000 variables. That makes values of almost all of those variables to be less than 10^-4. I would like to make them zero or higher than some value (for example 0.01). Is it possible? Right now, if I extract 20 most biggest values and make new weight vector depending on sum of their values from result of quadprog, second constraint is not satisfied anymore, there is really big difference. Even the minimum of 1/2*x*H*x is totally bad. Is there any other way to do what i need?
Thanks a lot :)
0 comentarios
Respuesta aceptada
Alan Weiss
el 25 de Sept. de 2017
Editada: Alan Weiss
el 25 de Sept. de 2017
I believe that something like your requirement is satisfied in the latest release Mixed-Integer Quadratic Programming Portfolio Optimization: Problem-Based. Or, for earlier toolbox versions, see Mixed-Integer Quadratic Programming Portfolio Optimization: Solver-Based.
Alan Weiss
MATLAB mathematical toolbox documentation
Más respuestas (1)
Matt J
el 24 de Sept. de 2017
Editada: Matt J
el 24 de Sept. de 2017
Well, you can't do it with quadprog. The additional constraints can be handled by making this a mixed integer optimization, i.e., by reformulating your original variables x(i) as
x(i)=b(i)*y(i), y(i)>L
where b(i) are binary variables and y(i) are continuous variables with lower bound L=1e-4. The ga() solver in the Global Optimization Toolbox will let you specify such a problem, but I suspect the solver may just attack it like one big combinatoric optimization.
0 comentarios
Ver también
Categorías
Más información sobre Linear Programming and Mixed-Integer Linear Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!