Help with the function fmincon for optimizing a portfolio

2 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Walter Roberson
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)

Kategorien

Mehr zu Linear Programming and Mixed-Integer Linear Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by