View Single Post
#9
 jbaker Member Join Date: Apr 2012 Posts: 11 Re: What Quadratic Programming Package?

Anybody tried this in R? The solve.QP function in the quadprog library sounds very promising, but it complains about the first matrix not being positive definite (unless I set factorized=T, which doesn't sound right -- Dmat here is the same as what's called Q on the lecture slide, correct?).

solve.QP package:quadprog R Documentation

Solve a Quadratic Programming Problem

Description:

This routine implements the dual method of Goldfarb and Idnani
(1982, 1983) for solving quadratic programming problems of the
form min(-d^T b + 1/2 b^T D b) with the constraints A^T b >= b_0.

Usage:

solve.QP(Dmat, dvec, Amat, bvec, meq=0, factorized=FALSE)

Arguments:

Dmat: matrix appearing in the quadratic function to be minimized.

dvec: vector appearing in the quadratic function to be minimized.

Amat: matrix defining the constraints under which we want to
minimize the quadratic function.

bvec: vector holding the values of b_0 (defaults to zero).

meq: the first meq constraints are treated as equality
constraints, all further as inequality constraints (defaults
to 0).

factorized: logical flag: if TRUE, then we are passing R^(-1) (where
D = R^T R) instead of the matrix D in the argument Dmat.