solnp2: Nonlinear optimization using augmented lagrange method.

Description Usage Arguments Details Value Control Note Author(s) References Examples

Description

Solve constrained nonlinear minimization problem with nonlinear constraints.

Usage

1
2
3
solnp2(par, fun, grad = NULL, eqfun = NULL, eqB = NULL, eqgrad = NULL, 
    ineqfun = NULL, ineqLB = NULL, ineqUB = NULL, ineqgrad = NULL, 
    LB = NULL, UB = NULL, control = list(), ...)

Arguments

par

a numeric vector, parameter vector(vector object).

fun

the objective function to be minimized.

grad

a function, tue gradient of fun.

eqfun

the equality constraint function returning the vector of evaluated equality constraints.

eqB

the equality constraints.

eqgrad

the equality constraints gradient function, not currently implemented.

ineqfun

the inequality constraint function returning the vector of evaluated inequality constraints.

ineqLB, ineqUB

the lower and upper bounds of the inequality constraints.

ineqgrad

the inequality constraints grdient function, not currently implemented.

LB, UB

the lower and upper bounds of the inequality constraints.

control

list of control parameters that define the behaviour of the solver. See solnp2Control for details.

...

optional arguments.

Details

The solnp function is based on the solver by Yinyu Ye which solves the general nonlinear programming problem:

minimize f(x)

subject to g(x) = 0
l_h ≤ h(x) ≤ u_h
l_x ≤ x ≤ u_x

where, f(x), g(x) and g(x) are smooth functions.

The solver belongs to the class of indirect solvers and implements the augmented Lagrange multiplier method with an SQP interior algorithm.

Value

A list containing the following values:

pars

Optimal Parameters.

convergence

Indicates whether the solver has converged (0) or not (1).

values

Vector of function values during optimization with last one the value at the optimal.

lagrange

The vector of Lagrange multipliers.

hessian

The Hessian at the optimal solution.

ineqx0

The estimated optimal inequality vector of slack variables used for transforming the inequality into an equality constraint.

nfuneval

The number of function evaluations.

elapsed

Time taken to compute solution.

Control

rho

Penalty parameter (default 1).

outer.iter

Maximum number of major (outer) iterations (default 400).

inner.iter

Maximum number of minor (inner) iterations (default 800).

delta

Relative step size in forward difference evaluation (default 1.0e-8).

tol

Tolerance on feasibility and optimality (default 1e-6).

trace

The value of the objective function and the parameters is printed at every major iteration (default 0).

Note

The control parameters tol and delta are key in getting any possibility of successful convergence, therefore it is suggested that the user change these appropriately to reflect their problem specification.

The solver is a local solver, therefore for problems with rough surfaces and many local minima there is absolutely no reason to expect anything other than a local solution.

Author(s)

Alexios Ghalanos and Stefan Theussl
Y.Ye (original matlab version of solnp)

References

Y.Ye,Interior algorithms for linear, quadratic, and linearly constrained non linear programming, PhD Thesis, Department of EES Stanford University, Stanford CA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Powell Problem - 
   # From the original paper by Y.Ye
   # see the unit tests for more....
   fn1 = function(x) {
     exp(x[1]*x[2]*x[3]*x[4]*x[5]) }

## Equality Constraints - 
   eqn1 <- function(x){
     z1 = x[1]*x[1]+x[2]*x[2]+x[3]*x[3]+x[4]*x[4]+x[5]*x[5]
     z2 = x[2]*x[3]-5*x[4]*x[5]
     z3 = x[1]*x[1]*x[1]+x[2]*x[2]*x[2]
     return(c(z1,z2,z3)) }

## Start Values -
   x0 = c(-2, 2, 2, -1, -1)
    
## Solve - 
   powell = solnp2(x0, fun = fn1, eqfun = eqn1, eqB = c(10, 0, -1))

Rsolnp2 documentation built on May 2, 2019, 5:11 p.m.

Related to solnp2 in Rsolnp2...