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!