fminunc.RdFind minimum of unconstrained multivariable functions.
fminunc(x0, fn, gr = NULL, ...,
tol = 1e-08, maxiter = 0, maxfeval = 0)The method used here for unconstrained minimization is a variant of a "variable metric" resp. quasi-Newton approach.
List with the following components:
the best minimum found.
function value at the minimum.
number of function and gradient calls.
integer indicating the terminating situation.
description of the final situation.
J. Nocedal and S. J. Wright (2006). Numerical Optimization. Second Edition, Springer Science+Business Media, New York.
fminunc mimics the Matlab function of the same name.
fun = function(x)
x[1]*exp(-(x[1]^2 + x[2]^2)) + (x[1]^2 + x[2]^2)/20
fminunc(x0 = c(1, 2), fun)
#> $par
#> [1] -6.690718e-01 -1.165251e-10
#>
#> $value
#> [1] -0.4052369
#>
#> $counts
#> function gradient
#> 30 18
#>
#> $convergence
#> [1] 0
#>
#> $message
#> [1] "fminunc converged"
#>
## xmin: c(-0.6691, 0.0000); fmin: -0.4052