fmincon does not converge to true value
7 ビュー (過去 30 日間)
古いコメントを表示
1. Objective: To use fmincon to find the best parameter set that fit the experimental data.
2. Problem: The fmincon unable to converge to the actual true value.
3. Problem description.
A synthetic experimental data with known parameter value ( i.e., parameter_of_interest) was produced using the dot m file ( 1.a_produce_synthetic_data_main & 2. a_produce_synthetic_data_model_evaluation). The model output (i.e., algebra_10) was imported into structure array (i.e.,mock_experimental_result.mat).
As per the objective, a straight proof of concept was conducted by comparing between the experimental data (i.e., mock_experimental_result) and fitted experimental data (i.e., fitted_experimental_data) as a function of objective function (i.e., sum of square error). Since the model is a bounded type, the fmincon was the choice.
However, there was a problem arise from this simple proof of concept.
3.1 Problem 1. The fmincon unable to find the correct true value.
Troubleshooting: To address this issue, several troubleshooting was conducted but does not solve the convergence issue
3.1.1 T_shooting 1: Vary the initial parameter guess. In fact, the proposed value by Matlab was slightly different when the initial parameter guess was setting to the known correct true value. The issue become worse when the initial guess was setting around the lower parameter limit.
4. Help motivation
I hope someone can advise me on how to tackle this issue.
5. Code;
To maintain efficiency, the matlab code available to be download from this link git clone https://balandongiv@bitbucket.org/balandongiv/fmincon_matlab-help.git
6. Model structure,
The model consist of 6 ODEs and 10 algebraic equation
0 件のコメント
回答 (1 件)
Walter Roberson
2016 年 11 月 12 日
fmincon will almost always fail in this situation. Sum-of-squares problems are always full of local minima, and fmincon gets caught in the local minima. fmincon is not a global optimizer.
The global optimizers include ga and particleswarm and patternsearch . Also there are multistart methods, for automatically running fmincon multiple times and searching for the best result.
Note: none of the global optimizers guarantee convergence to a true global minima except under limited circumstances.
3 件のコメント
Walter Roberson
2016 年 11 月 13 日
root mean square error is exactly the same optimization problem as sum of squares. Perhaps you do not descend gradients as quickly. I suppose it could make a difference as to whether you projected too far in some direction.
See https://www.mathworks.com/help/gads/example-finding-global-or-multiple-local-minima.html for GlobalSearch and MultiStart and fmincon
I do not have experience in using global optimizers to solve ODE systems. I do have experience in using global optimizers to solve fitting problems involving nonlinear equations and sum of squares. Typically the objective functions I work with are fully vectorizable (though it might require a bunch of memory) and evaluating at many points is not overly expensive, but there might be a quite narrow valley for some of the parameters with poor fitting outside the valley (for example, the wrong phase expressed by one variable can make it look like you have the wrong position expressed by a different variable.)
In my experience with the sorts of functions I describe above:
- particle swarm rarely gets anywhere useful and has very little potential for improvement
- genetic algorithm works a bit better, but usually not well, and has very little potential for improvement
- fmincon is good at heading towards the bottom of a local basin, but suffers a lot from getting stuck in local minima. If the bottom of the basin is lumpy on a finer scale, fmincon will probably get caught before it finds the real minima. Potential for fmincon involves being systematic about the starting locations
- simulated annealing has some potential, but by itself does not turn out to be good about following slopes. (A couple of decades ago, we combined SA with simplex searching; that was pretty effective for what we were doing at the time. I think I've probably lost the C source though.)
- patternsearch can be bad at detecting important trends. patternsearch with the right parameters and given enough time could in theory find the global minima, but for any given reasonable time, it is more likely to get stuck on a plateau a distance from the real area. patternsearch comes the closest to being able to prove that you have searched everywhere... eventually.
- the single most useful for crossing barriers and getting closer to the "general vicinity" in a reasonable number of function evaluations is fminsearch . fminsearch, unfortunately, is unbounded in its natural form, which is important as it has a fondness for heading parameters out to infinity. (Imagine a well with a lip and an asymptotic downhill on the sides: fminsearch can end up searching indefinitely far out, chasing that never-ending down-slope.)
I have my own home-grown tool that combines fminsearch and grid searching. It misses plenty, too, but it can out-stubborn a lot of problems. Unfortunately, the approach can require masses of function evaluations: it makes no attempt to be smart about evaluations to maximize information, no attempt to calculate Jacobian or Hessian and so on. And it is memory hungry: to deal with narrow valleys, you want to turn up the refinement level as much as you can fit into memory. My tool is not publicly available (it hasn't reached alpha testing yet.)
参考
カテゴリ
Help Center および File Exchange で Direct Search についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!