Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fminunc

Minimize Unconstrained Multivariable Function


Description

Find minimum of unconstrained multivariable functions.

Usage

fminunc(x0, fn, gr = NULL, ...,
          tol = 1e-08, maxiter = 0, maxfeval = 0)

Arguments

x0

starting point.

fn

objective function to be minimized.

gr

gradient function of the objective.

...

additional parameters to be passed to the function.

tol

relative tolerance.

maxiter

maximum number of iterations.

maxfeval

maximum number of function evaluations.

Details

The method used here for unconstrained minimization is a variant of a "variable metric" resp. quasi-Newton approach.

Value

List with the following components:

par

the best minimum found.

value

function value at the minimum.

counts

number of function and gradient calls.

convergence

integer indicating the terminating situation.

message

description of the final situation.

Note

fminunc mimics the Matlab function of the same name.

Author(s)

The "variable metric" code provided by John Nash (package Rvmmin), stripped-down version by Hans W. Borchers.

References

J. Nocedal and S. J. Wright (2006). Numerical Optimization. Second Edition, Springer Science+Business Media, New York.

See Also

Examples

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)
  ## xmin: c(-0.6691, 0.0000); fmin: -0.4052

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.