I am very new to matlab and trying to solve portfolio optimization problem (minimizing the variance) using quadprog:
minW = quadprog(t_covar, v0, [], [], e, ub, lb, [], []);
where t_covar is the covariance matrix, v0 is a zero vector, e is the identity vector, ub = 1 and lb is a zero vector. It seems to work fine but I get this warning:
Warning: Trust-region-reflective algorithm does not solve this type of problem, using active-set algorithm. You could also try the interior-point-convex algorithm: set the Algorithm option to interior-point-convex and rerun.
Am I doing something wrong ? Should I worry about this warning ?
Hope I was clear thanks
I think you are doing something wrong. The most recent version of
quadproghas this argument set:If you're using the most recent version of Matlab, then your function call has $e$, $ub$, and $lb$ being stuffed into the $Aeq$, $beq$, and $lb$ parameters, respectively. I don't think that's what you want, as (for example) $beq$ is supposed to be the right-hand side of an equality constraint, while $ub$ is your upper bound.
You're getting the warning message because you didn't specify a particular algorithm for the
quadprogfunction to use, and soquadprogis trying the default algorithm, which is the trust-region-reflective algorithm. That algorithm apparently doesn't work on your problem. This is probably because of the parameter passing issue I mentioned above, as the trust-region-reflective algorithm works when the problem has "only bounds, or only linear equality constraints (but not both)." (For more information, see "Choosing a solver" in the Matlab documentation.)Since the trust-region-reflective algorithm doesn't work,
quadprogis trying the next algorithm in line, which is apparently the active-set algorithm. Then it's telling you that you might get better results with the interior-point-convex algorithm.Matlab's general recommendations for the algorithm for the
quadprogfunction areFor more information, see "Using Quadratic Programming on Portfolio Optimization Problems" in the Matlab documentation.