Constraints not meeting the parameters?
Show older comments
Hello:

This is what my code looks like for the the linear equality constraints. However, run I run the code it does not meet the constraints.
in swtOther_Aeq1, the first constraint is to make stocks 1,3,7 comprise 22% of the portfolio.
the second constraint is to make the portfolio return equal to a certain return in the grid (ERGRid).
the third constraint is to have the total weights sum up to one for the portfolio.
However, none of these requirements are being met.
I am confused as to why.
Help would be appreciated. thanks.
Answers (1)
Exitflag=-2 means that no feasible point was found, as output.message also tells you. It means fmincon thinks there is no point satisfying your constraints.
10 Comments
Sameer
on 30 May 2014
No, exitflag has to be an integer and output has to be a structure. You just called fmincon with the output arguments named in the wrong order. It doesn't matter. This output,
iterations: 29
funcCount: 337
constrviolation: 9.3468
stepsize: 7.6372e-11
algorithm: 'interior-point'
firstorderopt: 0.059526
cgiterations: 58
message: 'No feasible solution found.
gives a message clearly stating 'No feasible solution found'. It tells us everything we need to know.
I heard there are options you may use to modify the tolerance of the constraints?
This is the TolCon option. However, I would first consider whether you have entered the data for the constraints incorrectly.
You can also try LCON2VERT to find the vertices of the region defined by your A,b,Aeq,beq,ub,lb constraint data. If the set of vertices V is empty, you know that your constraints are infeasible. Note, however, that you would have to convert your ub,lb data to ineqaulity constraint form.
Sameer
on 31 May 2014
Sameer
on 31 May 2014
Sameer
on 1 Jun 2014
Sameer
on 1 Jun 2014
Categories
Find more on Quadratic Programming and Cone 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!