在Matlab中停止fminsearch的标准

时间:2018-04-20 22:48:53

标签: matlab fminsearch

我正在使用fminsearch来将DE系统的参数拟合到观测数据。我并不期望能够很好地适应。

fminsearch非常快速地找到了目标函数看似可接受的最小值,但之后并没有停止。它运行了很长时间,我无法弄清楚原因。

我正在使用选项

options = optimset('Display','iter','TolFun',1e-4,'TolX',1e-4,'MaxFunEvals',1000);

我理解这意味着当目标函数的值降到1e-4以下时,这被认为是足够的。或者,当他们无法再更改参数时,将返回最佳参数。

输出

Iteration   Func-count     min f(x)         Procedure
 0            1      8.13911e+10         
 1            8       7.2565e+10         initial simplex
 2            9       7.2565e+10         reflect
 3           10       7.2565e+10         reflect
 4           11       7.2565e+10         reflect
 5           12       7.2565e+10         reflect
 6           13       7.2565e+10         reflect
 7           15      6.85149e+10         expand
 8           16      6.85149e+10         reflect
 9           17      6.85149e+10         reflect
10           19      6.20681e+10         expand
11           20      6.20681e+10         reflect
12           22      5.55199e+10         expand
13           23      5.55199e+10         reflect
14           25      4.86494e+10         expand
15           26      4.86494e+10         reflect
16           27      4.86494e+10         reflect
17           29      3.65616e+10         expand
18           30      3.65616e+10         reflect
19           31      3.65616e+10         reflect
20           33      2.82946e+10         expand
21           34      2.82946e+10         reflect
22           36      2.02985e+10         expand
23           37      2.02985e+10         reflect
24           39      1.20011e+10         expand
25           40      1.20011e+10         reflect
26           41      1.20011e+10         reflect
27           43      5.61651e+09         expand
28           44      5.61651e+09         reflect
29           45      5.61651e+09         reflect
30           47       2.1041e+09         expand
31           48       2.1041e+09         reflect
32           49       2.1041e+09         reflect
33           51      5.15751e+08         expand
34           52      5.15751e+08         reflect
35           53      5.15751e+08         reflect
36           55      7.99868e-05         expand
37           56      7.99868e-05         reflect
38           58      7.99835e-05         reflect
39           59      7.99835e-05         reflect

我之前已经让它运行了很长时间,并且至少在接下来的30次打印输出中,它仍然保持相同的最小f(x)。

如何正确设置选项,以便在找到目标函数的可接受值内的解决方案时停止?

1 个答案:

答案 0 :(得分:0)

Matlab要求在终止之前满足TolX和TolFun(“与其他求解器不同,fminsearch在满足TolFun和TolX时停止。”参见:https://www.mathworks.com/help/matlab/ref/fminsearch.html)。您应该检查“x”值(您的解决方案)正在执行的操作。我怀疑每一步的变化都超过了你的公差规范。 (即,x的值在迭代之间的变化大于TolX,但f(x)的变化不超过TolFun)。

相关问题