Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: Constrained vs. unconstrained optimization
Posted:
Jun 13, 2012 1:20 PM
|
|
"Sargondjani" wrote in message <jqc7lh$f9e$1@newscl01ah.mathworks.com>... > you could try the following things: > - provide an analytical gradient. this might take quite some time to program, but it will greatly enhance the convergence (especially given small portfolio weights and small change in sharpe ratio). i would seriously recommend this, if feasible > > - if you dont want this, at least use central difference ('FinDiffType', 'central'). this takes more calculations per step, but the convergence is faster (quadratic compared to linear) > - scale problem (in sqp: 'ScaleProblem', 'obj-and-constr' or you can do this yourself. try to get the magnitudes of the gradients to be similar) > - it may also help to set the size of the finite difference steps. check the DiffMinChange and FinDiffRelStep (this last one was only recently introduced in matlab, in 2011 or 2012 i think)
Thanks for your advice! Providing the analytical gradient helped reduce instances of error, and I actually scaled the whole problem by multiplying 1e12 to the obj fcn so that the fvals were not moving at something less than machine epsilon, and this reduced the errors a lot too. But for some combinations of assets, the problem still exists :(
|
|
|
|