Help with the function fmincon for optimizing a portfolio
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Andrew Burns
am 4 Jan. 2017
Kommentiert: Andrew Burns
am 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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Programming and Mixed-Integer Linear Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!