The main function which takes as first argument the parameter vector and returns
a single value.
eqfun
(Optional) The equality constraint function returning the vector of evaluated
equality constraints.
eqB
(Optional) The equality constraints.
ineqfun
(Optional) The inequality constraint function returning the vector of evaluated
inequality constraints.
ineqLB
(Optional) The lower bound of the inequality constraints.
ineqUB
(Optional) The upper bound of the inequality constraints.
LB
(Optional) The lower bound on the parameters.
UB
(Optional) The upper bound on the parameters.
control
(Optional) The control list of optimization parameters. See below for details.
...
(Optional) Additional parameters passed to the main, equality or inequality
functions. Note that the main and constraint functions must take the exact same
arguments, irrespective of whether they are used by all of them.
Details
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 or 2).
values
Vector of function values during optimization with last one the
value at the optimal.
lagrange
The vector of Lagrange multipliers.
hessian
The Hessian of the augmented problem 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
This is used as a penalty weighting scaler for infeasibility in the
augmented objective function. The higher its value the more the weighting to
bring the solution into the feasible region (default 1). However, very high
values might lead to numerical ill conditioning or significantly slow down
convergence.
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-7).
tol
Relative tolerance on feasibility and optimality (default 1e-8).
trace
The value of the objective function and the parameters is printed
at every major iteration (default 1).
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
# From the original paper by Y.Ye
# see the unit tests for more....
#---------------------------------------------------------------------------------
# POWELL Problem
fn1=function(x)
{
exp(x[1]*x[2]*x[3]*x[4]*x[5])
}
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))
}
x0 = c(-2, 2, 2, -1, -1)
powell=solnp(x0, fun = fn1, eqfun = eqn1, eqB = c(10, 0, -1))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Rsolnp)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Rsolnp/solnp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: solnp
> ### Title: Nonlinear optimization using augmented Lagrange method.
> ### Aliases: solnp
> ### Keywords: optimize
>
> ### ** Examples
>
> # From the original paper by Y.Ye
> # see the unit tests for more....
> #---------------------------------------------------------------------------------
> # POWELL Problem
> fn1=function(x)
+ {
+ exp(x[1]*x[2]*x[3]*x[4]*x[5])
+ }
>
> 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))
+ }
>
>
> x0 = c(-2, 2, 2, -1, -1)
> powell=solnp(x0, fun = fn1, eqfun = eqn1, eqB = c(10, 0, -1))
Iter: 1 fn: 0.03526 Pars: -1.59385 1.51051 2.07795 -0.81769 -0.81769
Iter: 2 fn: 0.04847 Pars: -1.74461 1.62029 1.80509 -0.77020 -0.77020
Iter: 3 fn: 0.05384 Pars: -1.71648 1.59482 1.82900 -0.76390 -0.76390
Iter: 4 fn: 0.05395 Pars: -1.71713 1.59570 1.82727 -0.76364 -0.76364
Iter: 5 fn: 0.05395 Pars: -1.71714 1.59571 1.82725 -0.76364 -0.76364
Iter: 6 fn: 0.05395 Pars: -1.71714 1.59571 1.82725 -0.76364 -0.76364
solnp--> Completed in 6 iterations
>
>
>
>
>
> dev.off()
null device
1
>