Description Usage Arguments Value References Examples
gradientproj
solves a multivariate function with constraints using the
Gradient Projection.
1 2 | gradientproj(obj.list, x.list, constraint, maxNI = 50, eps = 1e-04,
alpha0 = 1, c = 1e-04, rho = 0.5, ...)
|
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 |
constraint |
A list, with the following names |
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 |
Returns a list with the (approximate) optimum.
Nocedal, C.T.; Iterative Methods for optimization.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.