
14-3
• fmincon
• fminimax
• fminunc
• fseminf
The fmincon active-set algorithm and fminunc medium-scale algorithm gained central
finite differences this release. The fmincon interior-point algorithm already had them,
and the trust-region-reflective algorithm for both solvers requires a user-supplied
gradient, so does not use finite differences.
To use central finite differences, use optimset to set the FinDiffType option to
'central' instead of the default 'forward'. This causes the solver to estimate
gradients by formulae such as
—f x
f x e f x e f x e f x e
n n n n
n
( )
( ) ( )
, ,
( ) ( )
ª
+ - - + - -È
Î
Í
˘
˚
D D
D
D D
D
1 1 1 1
1
2 2
…
˙˙
,
instead of
—f x
f x e f x f x e f x f x e f x
n n
n
( )
( ) ( )
,
( ) ( )
, ,
( ) ( )
ª
+ - + - + -D
D
D
D
D
D
1 1
1
2 2
2
…
ÈÈ
Î
Í
˘
˚
˙
.
Central finite differences take twice as many function evaluations as forward finite
differences, but are usually much more accurate.
Central finite differences can work in parallel for gradient estimation in fgoalattain,
fmincon active-set algorithm, and fminimax. For details on how to use this parallel
gradient estimation, see the Parallel Computing for Optimization chapter in the User's
Guide.
lsqnonneg Refactored
lsqnonneg was refactored. It can now use sparse matrices, and it preserves sparsity
during its execution.
Finite Difference Algorithm Tweaked
A subroutine for gradient estimation by forward finite differences in nonlinear solvers
had a bug that affected it when the current point x had a component with the value
Kommentare zu diesen Handbüchern