Solve constrained nonlinear minimization problem

Description

Solve constrained nonlinear minimization problem

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
donlp2( 
    par, fn,
    par.upper = rep(+Inf, length(par)), par.lower = rep(-Inf, length(par)),   
    A = NULL,
    lin.upper = rep(+Inf, length(par)), lin.lower = rep(-Inf, length(par)), 
    nlin = list(),
    nlin.upper = rep(+Inf, length(nlin)), nlin.lower = rep(-Inf, length(nlin)),
    control = donlp2Control(),
    control.fun = function(lst){return(TRUE)},
    env = .GlobalEnv, 
    name = NULL)

Arguments

fn

the objective function to be minimized. Currently, fn must take only one argument, and the parameter vector(par) will be passed to fn during the optimization. The first element of return value must be the evaluated value. Newly (as of 05/10/2012), fn can be either an R function or an external pointer to a function implemented in, e.g., C (this can speed up the computation considerably). The external pointer mechanism is illustrated by an example in the file wright4ExampleCompiledEval.R, which is in the inst/doc folder of the package.

par

parameter vector(vector object).

par.lower, par.upper

upper and lower bounds for parameter vector, respectively. Their length must equal to length(par). If some elements are unbounded, specify +Inf or -Inf explicitly.

A

the matrix object that represents linear constraints. Its columns must be equal to length(par), and its rows must be equal to the number of linear constraints.

lin.lower, lin.upper

upper and lower bounds for linear constraints, respectively. Their length must equal to the number of linear constraints. If some elements are unbounded, specify +Inf or -Inf explicitly.

nlin

list object whose elements are functions that represents nonlinear constraints. Rule for argument and return value is the same as fn, i.e., these functions take only one arugument(par), and return a vector object whose first element is the evaluated value.

nlin.lower, nlin.upper

upper and lower bounds for nonlinear constraints, respectively. Their length must equal to length(nlin). If some elements are unbounded, specify +Inf or -Inf explicitly.

control

"control parameters" that defines the behavior of Rdonlp2. See donlp2Control for details.

control.fun

donlp2() reports a group of optimization parameters in every iteration(see below for details). This (read-only) information can be available within control.fun(), in which user can decide whether the optimization should be iterrupted. Set its return value to FALSE to interrupt donlp2().

env

the environment in which objective, constraint, control functions are evaluated.

name

an character object that specify file name(without extension, max 40 characters) of output file. If not NULL, DONLP2 creates 2 files(name.pro and name.mes) in current working directory which contain detailed information during the optimization. The amount of information depends te0,te1,te2,te3 specified in donlp2Control.

Value

For n=length(par) parameters, lin linear constraints, and nlin nonlinear constraints, a list with following elements:

par

parameters returned by DONLP2.

gradf

gradient evaluated at par.

u

2*(n+lin+nlin) vector of lagrange multipliers for constraints.

w

2*(n+lin+nlin) vector of penalty term.

step.nr

total number of iterations.

fx

the value of objective function fn.

sci

scaling of fn.

psi

psi the weighted penalty term.

upsi

the unweighted penalty term(L1 norm of constraint vector).

del.k.1

bound for the last active constraints.

b2n0

weighted L2 norm of projected gradients.

b2n

L2norm of gradients based on del.k.1.

nr

number of binding constraints.

sing

value other than -1 indicates working set is singular.

umin

infinity norm of negative part of inequalities multipliers.

not.used

always 0(currently not used)

cond.r

condition number of diagonal part of qr decomposition of normalized gradients of binding constraints

cond.h

condition number of diagonal of cholesky factor of updated full Hessian.

scf0

the relative damping of tangential component if upsi > tau0/2.

xnorm

L2 norm of par.

dnorm

unsclaed norm of d, correction from eqp/qp subproblem.

phase

-1:infeasibility improvement phase, 0: initial optimization, 1:binding constraints unchanged, 2:d small, maratos correction is in use.

c.k

number of decreases of penalty weights.

wmax

infinity norm of weights.

sig.k

stepsize from uidimensional minimization(backgracking).

cfincr

number of objective function evaluations for stepsize algorithm.

dirder

scaled derectional derivative of penalty function along d.

dscal

scaling factor for d.

cosphi

cosine of arc between d and previous d.

violis

number of constraints not binding at current values of par but hit during line search.

hesstype

one of 4 values indicating type of update for Hessian. 1: normal P&M-BFGS update, 0:update suppressed, -1:restart with scaled unit matrix, 2:standard BFGS, 3: BFGS modified by Powell's Device.

modbifgs

modification factor for damping the projector into the BFGS or pantoja-mayne update.

modnr

modification factor for daming the quasi-newton-relation in BFGS.

qpterm

0:if sing==-1, termination indicator of the QP solver, 1:successful, -1:tau becomes larger than tauqp without slack variables becoming sufficiently small.

tauqp

weight of slack variables in QP solver.

infeas

L1 norm of slack variables in QP solver.

nr.update

the approximated newton-raphson update in upper trianglar form.

hessian

numeric Hessian matrix if hessian=TRUE in donlp2Control.

runtime

the elapsed time for the optimization.

message

the termination message.

Author(s)

Peter Spelucci has has written the original solver code, S. Schoeffert has translated donlp2 from f77 to the ANSI C version, K. S. Cove has added dynamic memory allocation, Christoph Bergmeier has added passing objecive and constraints as external pointer, Ryuichi Tamura has written the original Rdonlp2 interface, Diethelm Wuertz has written the current Rdonlp2 interface. DONLP2 is copyrighted software written by Peter Sperucci.