【问题标题】:Matlab lsqnonlin Fit Problems with OptionsMatlab lsqnonlin 拟合问题与选项
【发布时间】:2017-06-03 18:09:42
【问题描述】:

很确定 Matlab 只是忽略了我的 Solver Option 设置...我将 FuctionTolerance 从默认的 1e-6 设置为 1e-10 并且求解器停止在 1e-8 告诉我它低于默认值 @ 987654326@ 限制。

我使用的命令是options = optimoptions('lsqnonlin', 'FunctionTolerance', 1e-10)。有什么想法吗?

下面的命令窗口输出:

options = 

  lsqnonlin options:

   Options used by current Algorithm ('trust-region-reflective'):
   (Other available algorithms: 'levenberg-marquardt')

   Set properties:
           FunctionTolerance: 1.0000e-10

   Default properties:
                   Algorithm: 'trust-region-reflective'
              CheckGradients: 0
                     Display: 'final'
    FiniteDifferenceStepSize: 'sqrt(eps)'
        FiniteDifferenceType: 'forward'
         JacobianMultiplyFcn: []
      MaxFunctionEvaluations: '100*numberOfVariables'
               MaxIterations: 400
         OptimalityTolerance: 1.0000e-06
                   OutputFcn: []
                     PlotFcn: []
    SpecifyObjectiveGradient: 0
               StepTolerance: 1.0000e-06
         SubproblemAlgorithm: 'factorization'
                    TypicalX: 'ones(numberOfVariables,1)'
                 UseParallel: 0


Local minimum possible.

lsqnonlin stopped because the final change in the sum of squares relative to 
its initial value is less than the default value of the function tolerance.

<stopping criteria details>

Optimization stopped because the relative sum of squares (r) is changing
by less than options.FunctionTolerance = 1.000000e-06.

Optimization Metric                                  Options
relative change r =   6.50e-08             FunctionTolerance =   1e-06 (default)

【问题讨论】:

  • FunctionTolerance 不是lsqnonlin 的选项。请改用TolFun
  • 那行不通。据我所知,它是同义词。
  • 1E-8 的值是函数值、步长、最大梯度范数还是其他什么? There are several values 可以停止迭代。
  • @Troy 我已经更改了所有内容并遇到了同样的问题。我已经意识到现在的问题是什么......我会发布一个答案。

标签: matlab solver model-fitting


【解决方案1】:

options = optimoptions('lsqnonlin', 'FunctionTolerance', 1e-10) 命令本身不会更改设置。

options是一个变量,里面有一些设置参数,必须传入函数调用才能主动改变参数。

optimisedParameters = lsqnonlin(functionToMinimise, initialParameters, [], [], options)

【讨论】:

    【解决方案2】:

    尝试减少FiniteDifferenceStepSize,例如,

    options = optimoptions('lsqnonlin', 'FunctionTolerance', 1e-10, 'FiniteDifferenceStepSize',1e-6)
    

    甚至更小的有限差分步长。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-22
      • 2016-09-09
      • 1970-01-01
      • 2017-05-12
      • 1970-01-01
      • 2013-07-26
      • 2018-02-18
      • 2017-05-24
      相关资源
      最近更新 更多