quasiNewton: Unconstrained optimization with Quasi-Newton

Description Usage Arguments Value Todo References Examples

View source: R/quasiNewton.R

Description

quasiNewton solves a multivariate function using a Quasi-Newton with BFGS udpate.

Usage

1
2
quasiNewton(obj.list, x.list, maxNI = 50, eps.df = 1e-06, eps.x = 1e-06,
  alpha0 = 1, rho = 0.5, c = 1e-04, ...)

Arguments

obj.list

Either an objective function or a list with the following names
f: objective function df: gradient of f (it not provided, defaults to the numerical version)

x.list

Either a vector with an initial solution or a list with the following names
x: a vector with its value in the search space
fx: a scalar with its objective value
dfx: a vector with its gradient value

maxNI

maximum number of iterations

eps.df

tolerance in the norm of the gradient

eps.x

tolerance in the norm of the difference between two consecutive solutions

alpha0

Initial step size in the backtracking

rho

A constant to reduce alpha in backtracking

c

A small constant, control parameter.

...

parameters used in the check_parameters function

Value

Returns a list with the (approximate) optimum.

Todo

Maybe include alpha0, rho and c into ... and get the appropriate parameters in each function?

References

  1. Nocedal, Jorge; Wright, Stephen J.; Numerical Optimization, 2nd ed., page 37.

  2. Wikipedia, Quasi-newton method https://en.wikipedia.org/wiki/Quasi-Newton_method.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# The popular Rosenbrock function
f <- function(x)
{
  x1 <- x[1]
  x2 <- x[2]
  return ( 100*(x2 - x1^2)^2 + (1 - x1)^2 )
}
x0 <- c(-1.2,1) #usual starting point
# Run the Quasi-Newton with default parameters (very close to c(1,1))
x.list <- quasiNewton(f, x0) #x.list$x = c(0.9996996 0.9993989))
# Notice the result can be improved by using "CFD" in the numerical gradient
# instead of "FFD":
x.list <- quasiNewton(f, x0, method = "cfd") #x = c(1,1)

brunasqz/NonlinearOpMethods documentation built on Oct. 27, 2019, 5:46 a.m.