Learn R Programming

kernlab (version 0.9-33)

ipop: Quadratic Programming Solver

Description

ipop solves the quadratic programming problem :
\(\min(c'*x + 1/2 * x' * H * x)\)
subject to:
\(b <= A * x <= b + r\)
\(l <= x <= u\)

Usage

ipop(c, H, A, b, l, u, r, sigf = 7, maxiter = 40, margin = 0.05,
     bound = 10, verb = 0)

Value

An S4 object with the following slots

primal

Vector containing the primal solution of the quadratic problem

dual

The dual solution of the problem

how

Character string describing the type of convergence

all slots can be accessed through accessor functions (see example)

Arguments

c

Vector or one column matrix appearing in the quadratic function

H

square matrix appearing in the quadratic function, or the decomposed form \(Z\) of the \(H\) matrix where \(Z\) is a \(n x m\) matrix with \(n > m\) and \(ZZ' = H\).

A

Matrix defining the constrains under which we minimize the quadratic function

b

Vector or one column matrix defining the constrains

l

Lower bound vector or one column matrix

u

Upper bound vector or one column matrix

r

Vector or one column matrix defining constrains

sigf

Precision (default: 7 significant figures)

maxiter

Maximum number of iterations

margin

how close we get to the constrains

bound

Clipping bound for the variables

verb

Display convergence information during runtime

Author

Alexandros Karatzoglou (based on Matlab code by Alex Smola)
alexandros.karatzoglou@ci.tuwien.ac.at

Details

ipop uses an interior point method to solve the quadratic programming problem.
The \(H\) matrix can also be provided in the decomposed form \(Z\) where \(ZZ' = H\) in that case the Sherman Morrison Woodbury formula is used internally.

References

R. J. Vanderbei
LOQO: An interior point code for quadratic programming
Optimization Methods and Software 11, 451-484, 1999
https://vanderbei.princeton.edu/ps/loqo5.pdf

See Also

solve.QP, inchol, csi

Examples

Run this code
## solve the Support Vector Machine optimization problem
data(spam)

## sample a scaled part (500 points) of the spam data set
m <- 500
set <- sample(1:dim(spam)[1],m)
x <- scale(as.matrix(spam[,-58]))[set,]
y <- as.integer(spam[set,58])
y[y==2] <- -1

##set C parameter and kernel
C <- 5
rbf <- rbfdot(sigma = 0.1)

## create H matrix etc.
H <- kernelPol(rbf,x,,y)
c <- matrix(rep(-1,m))
A <- t(y)
b <- 0
l <- matrix(rep(0,m))
u <- matrix(rep(C,m))
r <- 0

sv <- ipop(c,H,A,b,l,u,r)
sv
dual(sv)

Run the code above in your browser using DataLab