Description Usage Arguments Value Todo References Examples
quasiNewton
solves a multivariate function using a Quasi-Newton with
BFGS udpate.
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, ...)
|
obj.list |
Either an objective function or a list with the following
names |
x.list |
Either a vector with an initial solution or a list with the
following names |
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 |
Returns a list with the (approximate) optimum.
Maybe include alpha0, rho and c into ... and get the appropriate parameters in each function?
Nocedal, Jorge; Wright, Stephen J.; Numerical Optimization, 2nd ed., page 37.
Wikipedia, Quasi-newton method https://en.wikipedia.org/wiki/Quasi-Newton_method.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.