Title: | Cone Constrained Convex Problems |
---|---|
Description: | Routines for solving convex optimization problems with cone constraints by means of interior-point methods. The implemented algorithms are partially ported from CVXOPT, a Python module for convex optimization (see <https://cvxopt.org> for more information). |
Authors: | Bernhard Pfaff [aut, cre], Lieven Vandenberghe [cph] (copyright holder of cvxopt), Martin Andersen [cph] (copyright holder of cvxopt), Joachim Dahl [cph] (copyright holder of cvxopt) |
Maintainer: | Bernhard Pfaff <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.3-1 |
Built: | 2024-11-04 04:33:35 UTC |
Source: | https://github.com/cran/cccp |
This function is the main function for defining and solving convex problems in the form of either linear or quadratic programs with cone constraints.
cccp(P = NULL, q = NULL, A = NULL, b = NULL, cList = list(), x0 = NULL, f0 = NULL, g0 = NULL, h0 = NULL, nlfList = list(), nlgList = list(), nlhList = list(), optctrl = ctrl())
cccp(P = NULL, q = NULL, A = NULL, b = NULL, cList = list(), x0 = NULL, f0 = NULL, g0 = NULL, h0 = NULL, nlfList = list(), nlgList = list(), nlhList = list(), optctrl = ctrl())
P |
An object of class |
q |
An object of class |
A |
An object of class |
b |
An object of class |
cList |
A |
x0 |
An object of class |
f0 |
|
g0 |
|
h0 |
|
nlfList |
A |
nlgList |
A |
nlhList |
A |
optctrl |
An object of S4-class |
An object of class Rcpp_CPS
.
"CPD"
Class union of Rcpp_DLP
, Rcpp_DQP
, Rcpp_DCP
and Rcpp_DNL
.
A virtual Class: No objects may be created from it.
No methods defined with class "CPD" in the signature.
Module for defining and solving convex programs.
The module contains the following items: classes:
Class for inequality (cone) constraints.
Class for control parameters used in optimizations.
Class for primal/dual variables.
Class for definition of convex programs.
Class for definition of linear programs.
Class for definition of linear programs with non-linear constraints.
Class for definition of quadratic programs.
Class for solution of convex programs.
functions:
Function for solving risk parity portfolios.
Function for solving a geometric program.
This function returns an optimal point for a cone constraint convex program.
## S4 method for signature 'Rcpp_DCP,Rcpp_CTRL' cps(cpd, ctrl) ## S4 method for signature 'Rcpp_DLP,Rcpp_CTRL' cps(cpd, ctrl) ## S4 method for signature 'Rcpp_DNL,Rcpp_CTRL' cps(cpd, ctrl) ## S4 method for signature 'Rcpp_DQP,Rcpp_CTRL' cps(cpd, ctrl)
## S4 method for signature 'Rcpp_DCP,Rcpp_CTRL' cps(cpd, ctrl) ## S4 method for signature 'Rcpp_DLP,Rcpp_CTRL' cps(cpd, ctrl) ## S4 method for signature 'Rcpp_DNL,Rcpp_CTRL' cps(cpd, ctrl) ## S4 method for signature 'Rcpp_DQP,Rcpp_CTRL' cps(cpd, ctrl)
cpd |
An object belonging to the class union |
ctrl |
An object of reference-class |
An object of reference-class Rcpp_CPS
.
This function creates an object of reference-class CTRL
which
contains optimization parameters, e.g. the maximum number of
iterations.
ctrl(maxiters = 100L, abstol = 1e-06, reltol = 1e-06, feastol = 1e-06, stepadj = 0.95, beta = 0.5, trace = TRUE)
ctrl(maxiters = 100L, abstol = 1e-06, reltol = 1e-06, feastol = 1e-06, stepadj = 0.95, beta = 0.5, trace = TRUE)
maxiters |
|
abstol |
|
reltol |
|
feastol |
|
stepadj |
|
beta |
|
trace |
|
An object of reference-class CTRL
.
Either abstol
or reltol
can be set to a negative real
number. feastol
must be greater than zero.
DCP
This function returns an object containing the definition of a convex
program with non-linear constraints and (if provided) cone
constraints.
The returned object is a member of the reference-class DCP
.
dcp(x0, f0, g0, h0, cList = list(), nlfList = list(), nlgList = list(), nlhList = list(), A = NULL, b = NULL)
dcp(x0, f0, g0, h0, cList = list(), nlfList = list(), nlgList = list(), nlhList = list(), A = NULL, b = NULL)
x0 |
An object of class |
f0 |
|
g0 |
|
h0 |
|
cList |
A |
nlfList |
A |
nlgList |
A |
nlhList |
A |
A |
An object of class |
b |
An object of class |
An object belonging to the reference-class DCP
.
DLP
This function returns an object containing the definition of a cone
constrained linear program. The returned object is a member of the
reference-class DLP
.
dlp(q, A = NULL, b = NULL, cList = list())
dlp(q, A = NULL, b = NULL, cList = list())
q |
An object of class |
A |
An object of class |
b |
An object of class |
cList |
A |
An object belonging to the reference-class DLP
.
DNL
This function returns an object containing the definition of a linear
program with non-linear constraints and (if provided) cone
constraints.
The returned object is a member of the reference-class DNL
.
dnl(q, A = NULL, b = NULL, cList = list(), x0, nlfList = list(), nlgList = list(), nlhList = list())
dnl(q, A = NULL, b = NULL, cList = list(), x0, nlfList = list(), nlgList = list(), nlhList = list())
q |
|
A |
An object of class |
b |
An object of class |
cList |
A |
x0 |
An object of class |
nlfList |
A |
nlgList |
A |
nlhList |
A |
An object belonging to the reference-class DNL
.
DQP
This function returns an object containing the definition of a cone
constrained quadratic program. The returned object is a member of the
reference-class DQP
.
dqp(P, q, A = NULL, b = NULL, cList = list())
dqp(P, q, A = NULL, b = NULL, cList = list())
P |
An object of class |
q |
An object of class |
A |
An object of class |
b |
An object of class |
cList |
A |
An object belonging to the reference-class DQP
.
Returns a member of reference class objects.
## S4 method for signature 'Rcpp_PDV' getx(object) ## S4 method for signature 'Rcpp_CPS' getx(object) ## S4 method for signature 'Rcpp_PDV' gety(object) ## S4 method for signature 'Rcpp_CPS' gety(object) ## S4 method for signature 'Rcpp_PDV' gets(object) ## S4 method for signature 'Rcpp_CPS' gets(object) ## S4 method for signature 'Rcpp_PDV' getz(object) ## S4 method for signature 'Rcpp_CPS' getz(object) ## S4 method for signature 'Rcpp_CPS' getstate(object) ## S4 method for signature 'Rcpp_CPS' getstatus(object) ## S4 method for signature 'Rcpp_CPS' getniter(object) ## S4 method for signature 'Rcpp_CTRL' getparams(object)
## S4 method for signature 'Rcpp_PDV' getx(object) ## S4 method for signature 'Rcpp_CPS' getx(object) ## S4 method for signature 'Rcpp_PDV' gety(object) ## S4 method for signature 'Rcpp_CPS' gety(object) ## S4 method for signature 'Rcpp_PDV' gets(object) ## S4 method for signature 'Rcpp_CPS' gets(object) ## S4 method for signature 'Rcpp_PDV' getz(object) ## S4 method for signature 'Rcpp_CPS' getz(object) ## S4 method for signature 'Rcpp_CPS' getstate(object) ## S4 method for signature 'Rcpp_CPS' getstatus(object) ## S4 method for signature 'Rcpp_CPS' getniter(object) ## S4 method for signature 'Rcpp_CTRL' getparams(object)
object |
An object of either reference-class |
The relevant member object of the class.
This function solves a geometric program.
gp(F0, g0, FList = list(), gList = list(), nno = NULL, A = NULL, b = NULL, optctrl = ctrl())
gp(F0, g0, FList = list(), gList = list(), nno = NULL, A = NULL, b = NULL, optctrl = ctrl())
F0 |
Matrix in the objective function. |
g0 |
Matrix in the objective function (affine terms). |
FList |
List of matrices in posinomial functions. |
gList |
List of matrices in posinomial functions (affine terms). |
nno |
Object created by a call to |
A |
Lefthand-side matrix of equality constraints. |
b |
Lefthand-side matrix of equality constraints. |
optctrl |
Object of reference class ‘Rcpp_CTRL’, created
by a call to |
Solves a geometric program casted in its epigraph form.
An object of S4-class Rcpp_CPS
.
Boyd, S., Kim, S.-J., Vandenberghe, L. and A. Hassibi (2007), A tutorial on geometric programming, Optim Eng, Educational Section, 8:67–127, Springer.
This function minimizes a L1-norm of the form ,
whereby
is a
matrix and
is a
vector. This function is wrapper function for invoking the
cps
-method of Linear Programs.
l1(P, q = NULL, optctrl = ctrl())
l1(P, q = NULL, optctrl = ctrl())
P |
|
q |
|
optctrl |
An object of S4-class |
An object of S4-class Rcpp_CPS
.
This function is the interface to the reference class NLFC
for
creating nonlinear constraints.
nlfc(G, h)
nlfc(G, h)
G |
Object of class |
h |
Object of class |
List with elements: conType
, G
and h
.
This function is the interface to the reference class NNOC
for
creating linear constraints.
nnoc(G, h)
nnoc(G, h)
G |
Object of class |
h |
Object of class |
List with elements: conType
, G
and h
.
This function is the interface to the reference class PSDC
for
creating positive semidefinite cone constraints.
psdc(Flist, F0)
psdc(Flist, F0)
Flist |
Object of class |
F0 |
Object of class |
A psd-cone constraint is given as . The matrix
is created as
and the vector
is constructed as
.
List with elements: conType
, G
and h
.
"Rcpp_CONEC"
Class for inequality (cone) constraints.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
cone
:Object of class activeBindingFunction
:
Type of cone constraints.
G
:Object of class activeBindingFunction
:
Left-hand side of inequality constraints.
h
:Object of class activeBindingFunction
:
Right-hand side of inequality constraints.
sidx
:Object of class activeBindingFunction
:
Row index for subsets of cone constraints.
dims
:Object of class activeBindingFunction
:
Dimension of cone constraints.
K
:Object of class activeBindingFunction
: Count
of inequality constraints.
n
:Object of class activeBindingFunction
: Count
of variables in objective.
showClass("Rcpp_CONEC")
showClass("Rcpp_CONEC")
"Rcpp_CPS"
Class for solution of convex programs.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
pdv
:Object of class activeBindingFunction
:
Primal-dual variables.
state
:Object of class activeBindingFunction
:
Vector of state variables in convex programs.
status
:Object of class activeBindingFunction
:
Character indicating the status of the returned solution.
niter
:Object of class activeBindingFunction
:
Integer, count of iterations.
sidx
:Object of class activeBindingFunction
:
Integer matrix, start and end indices of slack variables.
showClass("Rcpp_CPS")
showClass("Rcpp_CPS")
"Rcpp_CTRL"
Class for control options used in optimization routines.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
ctrlparams
:Object of class
activeBindingFunction
: List of control parameters.
showClass("Rcpp_CTRL")
showClass("Rcpp_CTRL")
"Rcpp_DCP"
Class for definition of convex programs with non-linear constraints.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
x0
:Object of class activeBindingFunction
:
Initial values.
cList
:Object of class activeBindingFunction
:
Inequality constraints, class CONEC
.
nList
:Object of class activeBindingFunction
:
List with elements of functions for evaluating non-linear
constraints, their associated gradients and their associated
Hessians.
A
:Object of class activeBindingFunction
:
Left-hand side of equality cosntraints.
b
:Object of class activeBindingFunction
:
Right-hand side of equality cosntraints.
showClass("Rcpp_DCP")
showClass("Rcpp_DCP")
"Rcpp_DLP"
Class for definition of linear programs.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
q
:Object of class activeBindingFunction
:
Matrix related to linear term in objective.
A
:Object of class activeBindingFunction
:
Left-hand side of equality cosntraints.
b
:Object of class activeBindingFunction
:
Right-hand side of equality cosntraints.
cList
:Object of class activeBindingFunction
:
Inequality constraints, class CONEC
.
showClass("Rcpp_DLP")
showClass("Rcpp_DLP")
"Rcpp_DNL"
Class for definition of linear programs with non-linear constraints.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
q
:Object of class activeBindingFunction
:
Matrix related to linear term in objective.
A
:Object of class activeBindingFunction
:
Left-hand side of equality cosntraints.
b
:Object of class activeBindingFunction
:
Right-hand side of equality cosntraints.
cList
:Object of class activeBindingFunction
:
Inequality constraints, class CONEC
.
x0
:Object of class activeBindingFunction
:
Initial values.
nList
:Object of class activeBindingFunction
:
List with elements of functions for evaluating non-linear
constraints, their associated gradients and their associated
Hessians.
showClass("Rcpp_DNL")
showClass("Rcpp_DNL")
"Rcpp_DQP"
Class for definition of quadratic programs.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
P
:Object of class activeBindingFunction
:
Matrix related to quadratic term in objective.
q
:Object of class activeBindingFunction
:
Matrix related to linear term in objective.
A
:Object of class activeBindingFunction
:
Left-hand side of equality cosntraints.
b
:Object of class activeBindingFunction
:
Right-hand side of equality cosntraints.
cList
:Object of class activeBindingFunction
:
Inequality constraints, class CONEC
.
showClass("Rcpp_DQP")
showClass("Rcpp_DQP")
"Rcpp_PDV"
Class for primal/dual variables in convex programs.
Class "C++Object"
, directly.
All reference classes extend and inherit methods from "envRefClass"
.
x
:Object of class activeBindingFunction
:
Primal variables.
y
:Object of class activeBindingFunction
: Dual
variables.
s
:Object of class activeBindingFunction
:
Primal slack variables.
z
:Object of class activeBindingFunction
: Dual
slack variables.
kappa
:Object of class activeBindingFunction
:
Self-dual embedding variable; used in LPs, only.
tau
:Object of class activeBindingFunction
:
Self-dual embedding variable; used in LPs, only.
showClass("Rcpp_PDV")
showClass("Rcpp_PDV")
This function determines a risk-parity solution of a long-only portfolio with a budget-constraint.
rp(x0, P, mrc, optctrl = ctrl())
rp(x0, P, mrc, optctrl = ctrl())
x0 |
|
P |
|
mrc |
|
optctrl |
An object of S4-class |
An object of S4-class Rcpp_CPS
.
Spinu, F. (2013), An Algorithm for Computing Risk Parity Weights, SSRN, OMERS Capital Markets, July 2013.
This function is the interface to the reference class SOCC
for
creating second-oder cone constraints.
socc(F, g, d, f)
socc(F, g, d, f)
F |
Object of class |
g |
Object of class |
d |
Object of class |
f |
Object of class |
A second-order cone constraint is given as . The matrix
is created as
and the
vector
is constructed as
.
List with elements: conType
, G
and h
.