Matlab lsqnonlin适合选项的问题

时间:2017-01-19 06:23:12

标签: matlab solver model-fitting

非常确定Matlab只是忽略了我的求解器选项设置......我将FuctionTolerance从默认1e-6设置为1e-10,求解器停在1e-8 1}}告诉我它低于默认1e-6限制。

我使用的命令是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)

2 个答案:

答案 0 :(得分:0)

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

options是一个变量,其中包含一些设置参数,必须传递给函数调用以主动更改参数。

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

答案 1 :(得分:0)

尝试减少var asmNames = DependencyContext.Default.GetDefaultAssemblyNames(); var type = typeof(BaseViewComponent); var allTypes = asmNames.Select(Assembly.Load) .SelectMany(t => t.GetTypes()) .Where(p => p.GetTypeInfo().IsSubclassOf(type)); ,例如

FiniteDifferenceStepSize

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