donlp2NLP: Solve constrained nonlinear minimization problem

Description Usage Arguments Details Value Author(s) Examples

View source: R/donlp2NLP.R

Description

Solve constrained nonlinear minimization problem. An alternative R interface

Usage

1
2
3
4
5
6
7
8
donlp2NLP( 
    start, fun,
    par.lower = NULL, par.upper = NULL,   
    eqA = NULL, eqA.bound = NULL,
    ineqA = NULL, ineqA.lower = NULL, ineqA.upper = NULL,  
    eqFun = list(), eqFun.bound = NULL,
    ineqFun = list(), ineqFun.lower = NULL, ineqFun.upper = NULL, 
    control = list())

Arguments

start

parameter vector(vector object).

fun

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.

par.lower, par.upper

upper and lower bounds for parameter vector, respectively. Their length must equal to length(par).

eqA, ineqA

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

eqA.bound

equality bounds for linear constraints, respectively. Their length must equal to the number of linear constraints.

ineqA.lower, ineqA.upper

upper and lower bounds for linear constraints, respectively. Their length must equal to the number of linear constraints.

eqFun

list object whose elements are functions that represents nonlinear equality constraints.

eqFun.bound

equality bounds for nonlinear constraints, respectively.

ineqFun

list object whose elements are functions that represents nonlinear lower and upper constraints.

ineqFun.lower, ineqFun.upper

lower and upper bounds for nonlinear constraints, respectively.

control

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

Details

An alternative interface which may be suite better for portfolio optimization compared with the default interface function donlp2.

Value

A list with following elements:

opt

a list of information on the optimal solution as returned by the function donlp2.

solution

a numeric vector, the optimal solution.

objective

a numeric value, the value at the optimal solution

status

not used, returns NA.

message

a character string, the convergence message.

solver

a character string, the name of the solver.

version

a character string, the convergence message.

Author(s)

Peter Speluccihas 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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Example:

   # Feasible Start Solution:
   start <- c(10, 10)
   
   # Objective Function: x^2 + y^2 
   fun <- function(x) sum(x^2)
   
   # Bounds: -100 <= x,y <= 100
   par.lower <- c(-100, -100)
   par.upper <- c(100, 100)
    
   # Equality Constraints: x*y = 2
   eqFun <- list(function(x) x[1]*x[2])
   eqFun.bound <- 2
  
   # Solution: x = c(sqrt(2), sqrt(2)), f(x) = 4   
   donlp2NLP(start = start, fun = fun, 
     par.lower = par.lower, par.upper = par.upper,
     eqFun = eqFun, eqFun.bound = eqFun.bound)[-1]

Rdonlp2 documentation built on May 2, 2019, 6:47 p.m.

Related to donlp2NLP in Rdonlp2...