(weight) constraint within constraint using fmincon
8 views (last 30 days)
Show older comments
I'm at the moment doing some optimal asset allocation while using fmincon.
For example if I have 8 assets, I use
max_alloc=[1;1;0.5;1;1;1;1;1];
as upper bound constraint which shows that the maximum allocation in every asset can be 100% besides the third which is capped at 50%. However, I would like to add an extra constraint which makes the cap on the fourth asset dependable on the max cap of the third asset.
Like,
if weights(3,1)>0.3
weights(4,1)<0.2
end
How do I add this in my fmincon function? Since my upperbound is just a 8x1 vector.
2 Comments
Sargondjani
on 10 May 2012
it looks non-differentiable to me. fmincon assumes differentiability of the constraint.
you could either:
1. see if the constraint would bind, and if so implement the constraint
2. replace the constraint with a differentiable constraint, for instance on the sum of the weigths of 3 and 4. That seems more sensible to me: i mean, if w3=0.3 then w4 can be 0.5 and when w3 goes to 0.30001 then w4 is forced to 0.2. That doesnt seem proper risk management to me...
Answers (2)
John D'Errico
on 10 May 2012
Then these are not simple bound constraints, are they?
That would make them inequalities. Can you write down what the form of what that relationship is? Is it linear? Is it nonlinear?
If it is not even differentiable, then fmincon cannot be used.
John
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!