fmincon stuck at an intermidiate value

Hi,fellows I am using fmincon to maximize the sum of likelihood(sumllh), which is part of a simulation. So I know the optimized value should be around 172. But it seems fmincon have worked from around more than 700 to 523 and then can't go on. It has been working more than 10 hours now. So I think there must be some problem here. Could you offer some advice I will show you the result in command window.
if true
%sumllh =
523.2640
sumllh =
523.2640
sumllh =
523.2640
sumllh =
523.2640
sumllh =
539.0686
sumllh =
523.2640
sumllh =
523.2640
sumllh =
523.2640
sumllh =
523.2640
First-order Norm of
Iter F-count f(x) Feasibility optimality step
0 9 5.232640e+002 0.000e+000 2.100e+005
sumllh =
658.7498
sumllh =
705.4196
sumllh =
606.7836
sumllh =
598.1732
sumllh =
678.4877
sumllh =
713.2264
sumllh =
609.5137
sumllh =
599.1704
sumllh =
543.3757
sumllh =
545.6598
sumllh =
534.0842
sumllh =
528.5852
sumllh =
525.9029
sumllh =
524.5781
sumllh =
523.9197
sumllh =
523.5915
sumllh =
523.4276
sumllh =
523.3458
sumllh =
523.3048
sumllh =
523.2844
sumllh =
523.2742
sumllh =
523.2691
sumllh =
523.2665
sumllh =
523.2652
sumllh =
523.2646
sumllh =
523.2643
sumllh =
523.2641
sumllh =
523.2640
sumllh =
523.2640
sumllh =
523.2640
sumllh =
523.2639
sumllh =
523.2639
sumllh =
523.2640
sumllh =
523.2640
sumllh =
523.2629
sumllh =
523.2639
sumllh =
523.2639
sumllh =
523.2639
sumllh =
523.2639
1 48 5.232639e+002 0.000e+000 6.802e+004 1.468e-010
sumllh =
523.2639
sumllh =
523.2639 end

1 Kommentar

Walter Roberson
Walter Roberson am 6 Feb. 2013
Those numbers do not help us much at all. It would be easier if you were to show your code.
It seems likely that you are stuck in a local minima.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Matt J
Matt J am 6 Feb. 2013

0 Stimmen

Your function beta looks highly non-differentiable and therefore out of the scope of what fmincon can handle. You'll probably need to use ga() instead. It's also not clear how you came up with your initial guess and why you think that's close to the optimum. If you simply have no idea, all the more reason to use ga().

10 Kommentare

Walter Roberson
Walter Roberson am 6 Feb. 2013
fmincon() is a local minimizer.
ga() is not certain to be able to handle the task either.
Please have a look at the Global Optimization Toolbox.
Hi I tied ga. And this is the result(not the complete one since it is still running). Seems it start with a point and search a little bit and then return to the start point. What does this tell me ? Cheers!
if true
% sumllh =
449.1629
sumllh =
449.1629
sumllh =
449.1629
sumllh =
450.1382
sumllh =
451.8613
sumllh =
449.1629
sumllh =
449.1629
end
Matt Tearle
Matt Tearle am 6 Feb. 2013
If the function isn't smooth, you might want to try patternsearch. If it is smooth, but you're getting stuck in a local minimum, you could try GlobalSearch or MultiStart to run fmincon from multiple starting locations.
Matt J
Matt J am 6 Feb. 2013
Bearbeitet: Matt J am 6 Feb. 2013
Seems it start with a point and search a little bit and then return to the start point. What does this tell me ?
To me, it suggests that you have local minima almost everywhere, similar to this function,
fplot(@(x) round(x).^2,[-4,4])
You should plot your function with respect to the different variables x(1)...x(8) to get a feel for what it looks like.
xueqi
xueqi am 18 Feb. 2013
The thing is the function is not smooth and also tending to stuck in a local minimum. ga and patternsearch can't be used in multistart...So how can I solve this dilemma?
Matt J
Matt J am 18 Feb. 2013
You don't need multistart for ga and patternsearch. They already use multiple search points internally.
xueqi
xueqi am 18 Feb. 2013
I find fmincon moves to the optima very fast but can't stop even it is quite near the optima. It just bounding around the optima. Some of you suggest that it is because the objective function has a singularity..And for pattersearch I have ran it for several hours now but it just improves from 417 to 415 while the optima should be around 159. I have 8 independent variables to estimate so it might make sense why it takes such a long time for pattersearch. I am even not sure what I am asking for. I just have absolutely no idea how to proceed...
Matt J
Matt J am 18 Feb. 2013
If you know the optimum to be around 159, don't you have enough pre-knowledge to initialize GA better than at 417?
Failing that, maybe you need a new objective function, i.e., maybe you haven't formulated the problem in the best way. It sure seems like the objective function you're working with has no nice, well behaved prooperties at all.
xueqi
xueqi am 18 Feb. 2013
No I can't. I know the optimum should be 159 because I am using the simulated data in this case. But when I am analyzing the experimental data, I cant know the optimum... For an different question. I have 8 independent variables for my function beta. How do I plot it with respect to each of the 8 variables?
Matt J
Matt J am 18 Feb. 2013
You evaluate your objective function over a range of one of your 8 unknowns while holding the other 7 fixed.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Gefragt:

am 6 Feb. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by