MATLABs 'fminsearch' different from Octave's 'fmincg'

前端 未结 2 1675
逝去的感伤
逝去的感伤 2021-01-05 21:25

I am trying to get consistent answers for a simple optimization problem, between two functions in MATLAB and Octave. Here is my code:

  options = optimset(\'         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-05 22:04

    This is problem I've noticed sometimes with this algorithm. It may not be the answer you are looking for, but what seems to work for me, in these cases, is to modify the tolerance values at which it terminates. What I see is an oscillation between two points providing equal results. I know this happens in LabView, and can only speculate that it happens in Matlab.

    Unless I see you data, I can't comment more, but that is what I suggest.

    Note: by increasing the tolerance, the goal is to catch the algorithm before it reaches that state. It becomes less precise, but usually the number of significant digits is rather small anyways.

提交回复
热议问题