Optimization problem with constraints
Afficher commentaires plus anciens
Hi all. Supposing I've a matrix A(n,m) of daily returns where 'n' are daily observations and 'm' are number of assets and that SR(1,m) is a vector of Sharpe Ratios, calculated on the above matrix. My target is to find the optimal weights w(1,m) which maximize sum(SR.*w,2) given the constraints that the weigths sum up to 1 (sum(w,2)=1) and that all weights are >=0. It's pretty simple in Excel with the Solver tool but i'm not so familiar with the optimization functions in Matlab. Thank you very much in advance for your kind support. Regards
Réponses (1)
Alan Weiss
le 22 Sep 2015
0 votes
I am not familiar with the financial model you discuss. However, it is likely that fmincon can do what you want. If you have Optimization Toolbox, just follow the steps to shoehorn your problem into the syntax it expects. See the Getting Started example.
In particular, the constraint that the weights add up to 1 and are nonnegative are easily handled by a linear equality constraint and bounds respectively.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Catégories
En savoir plus sur Get Started with Optimization Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!