我对matlab的fminsearch有一些问题。我已经按如下方式定义了TolX和TolFun
options = optimset('TolFun',1e-8, 'TolX', 1e-8)然后,我尝试使用以下命令来估计函数的参数
[estimates val] = fminsearch(model, start_point,options)然而,val在3.3032e-04左右。即使我将TolFun指定为1e-8,它仍然在此之前终止,值约为3.3032e-04。实际上,该参数的期望值是在1.268e-04附近获得的。所以我试着设置TolFun。为什么它不起作用,它应该收敛到函数的最小值,不是吗?
发布于 2012-06-09 02:39:26
还有其他终止搜索的原因,例如,最大函数求值次数、最大迭代次数等。fminsearch提供了额外的输出参数,可提供有关终止原因的信息。您特别需要完整的OUTPUT参数,它提供迭代次数、终止消息等。
[X,FVAL,EXITFLAG,OUTPUT] = fminsearch(...) returns a structure
OUTPUT with the number of iterations taken in OUTPUT.iterations, the
number of function evaluations in OUTPUT.funcCount, the algorithm name
in OUTPUT.algorithm, and the exit message in OUTPUT.message.另一种可能是你陷入了局部最小值。除了选择不同的起始点或不同的优化器之外,这个问题没有什么可做的。
https://stackoverflow.com/questions/10953508
复制相似问题