Linear objective with quadratic constraint
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hey guys!
I'm trying to solve a portfolio optimization problem with a maximum return strategy, which implies that I try to maximize the return for a given level of std.deviation. As far as I know this kind of problem involves Fmincon as optimizer.
I have used the following set up but i'm facing some challenges; http://se.mathworks.com/help/optim/ug/linear-or-quadratic-problem-with-quadratic-constraints.html?refresh=true
I would like to maximize the portfolio return s.t. to a given level of std. deviation, therefore I have done the following:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161520/image.png)
I've set Q=zero(2,2) (as I have a portfolio of two assets) and c = zero(1,1) which implies that I end up with the problem to minimize f'x (which should be negative in order to maximize it). In my constraint I have set k equal to zero and d equal to minus my maximum level of daily std. deviation.
This should as far is i'm aware do the job, but when I try to run the optimization I get the following error message:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161522/image.png)
As far as i'm aware my dimension should be fine, as my f vektor is a 2x1 which is transposed and therefor f'x is 1x1. H is a 2x2 and x should be a 2x1, which should imply that the dimension in the constraint should be fine.
I would really appreciate if someone could point out where the error lies.
I could poste the entire code, but I thought that it would be to much and that's why I referred to the link above.
Best regards,
Kristian Lunow Nielsen
0 Commenti
Risposte (2)
Torsten
il 18 Apr 2016
Take a look at the documentation of fmincon about the form of the functions "fun" and "nonlconstr".
Best wishes
Torsten.
0 Commenti
Steve Grikschat
il 18 Set 2020
As of R2020b, Optimization Toolbox now has a dedicated solver for second-order cone programming, which can be used to solve quadratic constrained problems.
https://www.mathworks.com/help//optim/ug/convert-qp-to-socp.html
Function reference:
coupled with a function to make a second-order cone constraint
For an example see
0 Commenti
Vedere anche
Categorie
Scopri di più su Get Started with Optimization Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!