For k=1, the program is running and giving me good results.When k=2,3...and so on the program runs without any errors but with inaccurate results and am getting this message:
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.222894e-016.
> In C:\Program Files\MATLAB\R2009b\toolbox\optim\optim\private\backsolveSys.p>backsolveSys at 11
In C:\Program Files\MATLAB\R2009b\toolbox\optim\optim\private\solveKKTsystem.p>solveKKTsystem at 9
In C:\Program Files\MATLAB\R2009b\toolbox\optim\optim\private\computeTrialStep.p>computeTrialStep at 60
In C:\Program Files\MATLAB\R2009b\toolbox\optim\optim\barrier.p>barrier at 326
In fmincon at 763
In test_2 at 225
This message repeats itself alot but the RCOND changes...
Also, am getting:
No feasible solution found.
fmincon stopped because the size of the current step is less than
the default value of the step size tolerance but constraints were not
satisfied to within the default value of the constraint tolerance.
Optimization stopped because the norm of the current step , 1.371838e-009,
is less than options.TolX = 1.000000e-010, but the maximum constraint
violation, 6.705445e-001, exceeds options.TolCon = 1.000000e-006.
Optimization Metric Options
norm(step) = 1.37e-009 TolX = 1e-010 (default)
max(constraint violation) = 6.71e-001 TolCon = 1e-006 (default)
I hope somebody would have some ideas about because it does not seem to be a technical error and am out of ideas.
Ali
Your problem might be very hard to solve. There are a few things to try.
1. Look at the suggestions in
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/br44iv5-1.html
There are quite a few suggestions, perhaps some will help.
2. Try setting the InitBarrierParam option to a large value, perhaps
1e10. This can help with feasibility.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Any help is appreciated.
Ali.
If I understand what you are asking, you need to set a vector of lower
bounds of 0:
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-11.html#brhkghv-13
This will keep the components of your X vector positive, especially if
you use the interior-point algorithm
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/f12471.html#bsbwxm7
If your question was how do you keep the objective function positive,
well, you need to write a nonlinear constraint whose value is the
negative of the objective function.
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-11.html#brhkghv-16
But I'm not sure why anyone would do this.