Optimization problem with constraints
이전 댓글 표시
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
답변 (1개)
Alan Weiss
2015년 9월 22일
0 개 추천
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
카테고리
도움말 센터 및 File Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!