From: mohamad ali on 23 Jun 2010 21:42 Hey,I was doing a minimization problem in which I was using FMINCON function to optimize my objective function.For a certain value of k the number of constraints would change and the number of variables would get bigger. 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
From: Alan Weiss on 24 Jun 2010 08:59 On 6/23/2010 9:42 PM, mohamad ali wrote: > 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. 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
From: mohamad ali on 27 Jun 2010 23:42 Thanks Alan, your suggestion gave me some sort of good results.Anyways,I had a question.My fmincon is breaking when the size of the current step is less than the selected value of the step size tolerance.I did increase the InitBarrierParameter to 1e40 and as i mentioned the fmincon gave some OK results.Now what is happening is that when i set k=4 and above (k is parameter in my software for which some constraints would change) the fmincon is now minimizing below zero.How can i limit my fmincon to be strictly positive and let the fmincon breaks at the smallest positive value of Xs which consequently would get the smallest positive value of fval. Any help is appreciated. Ali.
From: Alan Weiss on 28 Jun 2010 08:49 On 6/27/2010 11:42 PM, mohamad ali wrote: > Thanks Alan, your suggestion gave me some sort of good results.Anyways,I > had a question.My fmincon is breaking when the size of the current step > is less than the selected value of the step size tolerance.I did > increase the InitBarrierParameter to 1e40 and as i mentioned the fmincon > gave some OK results.Now what is happening is that when i set k=4 and > above (k is parameter in my software for which some constraints would > change) the fmincon is now minimizing below zero.How can i limit my > fmincon to be strictly positive and let the fmincon breaks at the > smallest positive value of Xs which consequently would get the smallest > positive value of fval. > > 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. Alan Weiss MATLAB mathematical toolbox documentation
|
Pages: 1 Prev: data input of coxphfit function Next: Thresholding Color Images |