gradientproj: Constrained optimization with Gradient Projection

Description Usage Arguments Value References Examples

View source: R/gradientproj.R

Description

gradientproj solves a multivariate function with constraints using the Gradient Projection.

Usage

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

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

constraint

A list, with the following names
xmin: lower restriction
xmax: upper restraint

maxNI

maximum number of iterations

eps

tolerance for stop codition

alpha0

Initial step size in the backtracking

c

A small constant, control parameter.

rho

A constant to reduce alpha in backtracking

...

parameters used in the check_parameters function

Value

Returns a list with the (approximate) optimum.

References

  1. Nocedal, C.T.; Iterative Methods for optimization.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
f <- function(x) {
 f1 <- x[1]^2 + 2*x[2]^2 + 3*x[3]^2 - 2*x[1] -4*x[2] -6*x[3] + 6
 return(f1)
}
x0 <- list(x = c(2.8,3,3.5), fx = f(c(2.8,3,3.5)))
const <- list(xmin = c(2,2,2), xmax = c(4,4,4))
gradientproj(f, x0, const)

#can also be used to list:
obj <- list(functionObj = f)
gradientproj(obj, x0, const)

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