Help with the function fmincon for optimizing a portfolio
2 views (last 30 days)
Show older comments
Andrew Burns
on 4 Jan 2017
Commented: Andrew Burns
on 4 Jan 2017
Hi. Simple Q ...
I'm optimizing the weights in the DOW30 for that past 100 weeks (a 100x30 matrix). The constraints are that each of the constituent weights has to be between 0 and 1 AND the total of the 30 weights = 1. Simple.
I'm having a hard time understanding the arguments passed to fmincon. X0,A,B,Aeq,Beq. I get that UB=1, LB=0. But which argument caps the total weight to 1? And which arguments do I not use?
Thanks a ton.
0 Comments
Accepted Answer
Walter Roberson
on 4 Jan 2017
Use Aeq = ones(1,number_of_variables) and beq = 1 and lb = zeros(1, number_of_variables) and ub = ones(1, number_of_variables) and A empty and b empty
This will express that the sum of 1 times each of the variables, must exactly total 1
More Answers (0)
See Also
Categories
Find more on Linear Programming and Mixed-Integer Linear Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!