Examples


least squares regression

parameters
   matrix A
   vector b
variables
   vector x
min norm2(A*x-b)^2

non-negative least squares regression

parameters
   matrix A
   vector b
variables
   vector x
min norm2(A*x-b)^2
st x > 0

robust regression

parameters
   matrix A
   vector b
variables
   vector x
min norm1(A*x-b)

logistic regression

parameters
   matrix X
   vector y
variables
   vector w
min sum(log(exp(-y.*(X*w) + vector(1))))

support vector machines

parameters
   matrix X
   vector y
   scalar c
variables
   vector w
   scalar b
   vector xi
min 0.5*w'*w + c*sum(xi)
st -y.*(X*w + vector(b)) >= vector(1) - xi
   xi >= 0

quadratic function over the unit simplex

parameters
   matrix Q
   vector c
variables
   vector x
min 0.5*x'*Q*x + c'*x
st sum(x) == 1
   x >= 0