Learn R Programming

⚠️There's a newer version (1.0-14) of this package.Take me there.

CVXR

CVXR provides an object-oriented modeling language for convex optimization, similar to CVX, CVXPY, YALMIP, and Convex.jl. It allows the user to formulate convex optimization problems in a natural mathematical syntax rather than the restrictive standard form required by most solvers. The user specifies an objective and set of constraints by combining constants, variables, and parameters using a library of functions with known mathematical properties. CVXR then applies signed disciplined convex programming (DCP) to verify the problem’s convexity. Once verified, the problem is converted into standard conic form using graph implementations and passed to a cone solver such as ECOS or SCS.

CVXR includes several open source solvers in addition to the default ECOS and SCS. Recent versions (0.97+) also include support for commercial solvers such as MOSEK and GUROBI.

Installation

This package is now released on CRAN, so you can install the current released version as you would any other package for R, version 3.4 and higher. (CVXR is known to work with earlier versions of R too, but we don’t check our releases against older versions of R.)

install.packages('CVXR', repos = "https://cloud.r-project.org")

Development versions can be installed from the Github repository assuming you have the development tools for R available, including the C compilers etc. Execute:

library(devtools)
install_github("anqif/CVXR")

Documentation

A number of tutorial examples are available on the CVXR website. Package documentation is available on the Package Docs website.

Copy Link

Version

Install

install.packages('CVXR')

Monthly Downloads

7,809

Version

0.99

License

Apache License 2.0 | file LICENSE

Maintainer

Anqi Fu

Last Published

May 26th, 2018

Functions in CVXR (0.99)

CVXR-package

CVXR: Disciplined Convex Optimization in R
Canonical-class

The Canonical class.
Kron-class

The Kron class.
==,Expression,Expression-method

The EqConstraint class.
/,Expression,Expression-method

The DivExpression class.
Constant-class

The Constant class.
Exp-class

The Exp class.
Constraint-class

The Constraint class.
ECOS-class

The ECOS class.
Elementwise-class

The Elementwise class.
Log-class

The Log class.
Int-class

The Int class.
<=,Expression,Expression-method

The LeqConstraint class.
IntConstr-class

The IntConstr class.
status_map,ECOS-method

ECOS Status Map
RMulExpression-class

The RMulExpression class.
Parameter-class

The Parameter class.
MulElemwise-class

The MulElemwise class.
%>>%

The PSDConstraint class.
QuadOverLin-class

The QuadOverLin class.
Minimize-class

The Minimize class.
SolverStats-class

The SolverStats class.
ECOS_BB-class

The ECOS_BB class.
DiagMat-class

The DiagMat class.
DiagVec-class

The DiagVec class.
Entr-class

The Entr class.
-,Expression,missing-method

The NegExpression class.
%*%,Expression,Expression-method

The MulExpression class.
LambdaMax-class

The LambdaMax class.
Huber-class

The Huber class.
Leaf-class

The Leaf class.
ExpCone-class

The ExpCone class.
Sqrt-class

The Sqrt class.
Expression-class

The Expression class.
GUROBI-class

The GUROBI class.
[,Expression,missing,missing,ANY-method

The Index class.
status_map,GUROBI-method

GUROBI Status Map
status_map,LPSOLVE-method

LPSOLVE Status Map
LPSOLVE-class

The LPSOLVE class
Log1p-class

The Log1p class.
MaxEntries-class

The MaxEntries class.
CumSum-class

The CumSum class.
MOSEK-class

The MOSEK class.
Problem-arith

Arithmetic Operations on Problems
GLPK-class

The GLPK class
status_map,MOSEK-method

MOSEK Status Map
SumLargest-class

The SumLargest class.
LogDet-class

The LogDet class.
status_map,GLPK-method

GLPK Status Map
GeoMean-class

The GeoMean class.
Symmetric

Symmetric Variable
Problem-class

The Problem class.
Maximize-class

The Maximize class.
Rdict-class

The Rdict class.
status_map,SCS-method

SCS Status Map
SigmaMax-class

The SigmaMax class.
SDP-class

The SDP class.
MatrixFrac-class

The MatrixFrac class.
Rdictdefault-class

The Rdictdefault class.
Pnorm-class

The Pnorm class.
MaxElemwise-class

The MaxElemwise class.
SizeMetrics-class

The SizeMetrics class.
cone-methods

Second-Order Cone Methods
diag,Expression-method

Matrix Diagonal
diff,Expression-method

Lagged and Iterated Differences
Square-class

The Square class.
SumEntries-class

The SumEntries class.
Power-class

The Power class.
get_gurobiglue

Get our gurobiglue handle
Solver-capable

Solver Capabilities
NonNegative-class

The NonNegative class.
conv

Discrete Convolution
Variable-class

The Variable class.
HStack-class

The HStack class.
LogSumExp-class

The LogSumExp class.
Logistic-class

The Logistic class.
NormNuc-class

The NormNuc class.
UpperTri-class

The UpperTri class.
Solver.choose_solver

Choose a Solver
Reshape-class

The Reshape class.
NonlinearConstraint-class

The NonlinearConstraint class.
geo_mean

Geometric Mean
VStack-class

The VStack class.
curvature-comp

Curvature of Composition
abs,Expression-method

Absolute Value
curvature-methods

Curvature Properties
Objective-arith

Arithmetic Operations on Objectives
exp,Expression-method

Natural Exponential
cumsum_axis

Cumulative Sum
SOC-class

The SOC class.
expression-parts

Parts of an Expression
get_id

Get ID
SCS-class

The SCS class.
domain

Domain
Solver-class

The Solver class.
curvature-atom

Curvature of an Atom
get_sp

Get scipy handle
max_entries

Maximum
get_problem_data

Get Problem Data
grad

Sub/Super-Gradient
SOCAxis-class

The SOCAxis class.
harmonic_mean

Harmonic Mean
get_data

Get Expression Data
dspop

Direct Standardization: Population
hstack

Horizontal Concatenation
graph_implementation

Graph Implementation
import_solver

Import Solver
mean.Expression

Arithmetic Mean
is_qp

Is Problem a QP?
lambda_sum_smallest

Sum of Smallest Eigenvalues
problem-parts

Parts of a Problem
Solver.solve

Call to Solver
Transpose-class

The Transpose class.
kl_div

Kullback-Leibler Divergence
Semidef

Positive Semidefinite Variable
installed_solvers

Installed Solvers
lambda_min

Minimum Eigenvalue
UnaryOperator-class

The UnaryOperator class.
log,Expression-method

Logarithms
affine_prod

Affine Product
matrix_trace

Matrix Trace
max_elemwise

Elementwise Maximum
SemidefUpperTri-class

The SemidefUpperTri class.
logistic

Logistic Function
bmat

Block Matrix
matrix_frac

Matrix Fraction
name

Variable, Parameter, or Expression Name
neg

Elementwise Negative
lambda_sum_largest

Sum of Largest Eigenvalues
SymmetricUpperTri-class

The SymmetricUpperTri class.
mixed_norm

Mixed Norm
dssamp

Direct Standardization: Sample
norm_nuc

Nuclear Norm
Trace-class

The Trace class.
resetOptions

Reset Options
*,Expression,Expression-method

Elementwise Multiplication
pos

Elementwise Positive
psolve

Solve a DCP Problem
reshape_expr

Reshape an Expression
size-methods

Size Properties
sign_from_args

Atom Sign
canonicalize

Canonicalize
cdiac

Global Monthly and Annual Temperature Anomalies (degrees C), 1850-2015 (Relative to the 1961-1990 Mean) (May 2016)
sum_smallest

Sum of Smallest Values
^,Expression,numeric-method

Elementwise Power
upper_tri

Upper Triangle of a Matrix
sum_squares

Sum of Squares
p_norm

P-Norm
entr

Entropy Function
size

Size of Expression
get_mosekglue

Get our mosekglue handle
validate_args

Validate Arguments
sum_entries

Sum of Entries
size_from_args

Atom Size
quad_form

Quadratic Form
curvature

Curvature of Expression
cvxr_norm

Matrix Norm (Alternative)
get_np

Get numpy handle
value-methods

Get or Set Value
sum_largest

Sum of Largest Values
format_results

Format Solver Results
format_constr

Format Constraints
quad_over_lin

Quadratic over Linear
vec

Vectorization of a Matrix
sqrt,Expression-method

Square Root
huber

Huber Function
kronecker,Expression,ANY-method

Kronecker Product
square

Square Function
id

Identification Number
vstack

Vertical Concatenation
inv_pos

Reciprocal Function
is_dcp

DCP Compliance
lambda_max

Maximum Eigenvalue
min_elemwise

Elementwise Minimum
log_det

Log-Determinant
log_sum_exp

Log-Sum-Exponential
min_entries

Minimum
norm2

Euclidean Norm
norm_inf

Infinity-Norm
setIdCounter

Set ID Counter
sigma_max

Maximum Singular Value
norm,Expression,character-method

Matrix Norm
norm1

1-Norm
residual-methods

Constraint Residual
scalene

Scalene Function
to_numeric

Numeric Value of Atom
t.Expression

Matrix Transpose
sign-methods

Sign Properties
validate_solver

Validate Solver
sign,Expression-method

Sign of Expression
tv

Total Variation
unpack_results

Parse output from a solver and updates problem state
validate_val

Validate Value
Atom-class

The Atom class.
BinaryOperator-class

The BinaryOperator class.
Abs-class

The Abs class.
BoolConstr-class

The BoolConstr class.
AffineProd-class

The AffineProd class.
+,Expression,missing-method

The AddExpression class.
Bool-class

The Bool class.
AffAtom-class

The AffAtom class.
AxisAtom-class

The AxisAtom class.
Conv-class

The Conv class.
CallbackParam-class

The CallbackParam class.
KLDiv-class

The KLDiv class.