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 would like to maximize the portfolio return s.t. to a given level of std. deviation, therefore I have done the following:
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:
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.
Kristian Lunow Nielsen