Questions tagged [quadprog]

quadprog is a library for solving quadratic programming optimization problems. Implementations exist in several languages, including R and MATLAB.

A quadratic program is a type of numerical optimization problem. In a quadratic program, the task is to minimize a quadratic function subject to a series of linear constraints. Famous applications of quadratic programming include portfolio optimization and computing the support vector machine classifier.

Efficient methods for solving quadratic programs have been known for many years (for example, the Goldfarb-Idnani technique). There are excellent open source implementations of quadratic programming solvers in several languages. Popular quadprog libraries including R quadprog, MATLAB quadprog and C++ quadprog++ which are specialized for solving quadratic programs. Some general numerical optimization frameworks (e.g. CVXOPT) also include methods for solving quadratic programs.

The quadprog tag should be used for questions related to solving quadratic programs using a library with the name quadprog. For other libraries and more general questions about quadratic programming, the quadratic-programming tag may be more appropriate.

90 questions
0
votes
1 answer

Find optimal vector that minimizes function

I am trying to find a vector that minimizes the residual sum of squares when multiplying a matrix. I know of scipy's optimize package (which has a minimize function). However, there is an extra constraint for my code. The sum of all entries of w…
0
votes
0 answers

Solve quadratic optimization with nonlinear constraints

I'm trying to solve the following quadratic programming problem:  minw wTΣw, s.t. wTe = 1, st. ‖w‖1 ≤ δ Where A is an identity matrix, Sigma is a covariance matrix and e is a vector of ones. The first constraint ensures that the solution adds up to…
tzi
  • 67
  • 1
  • 5
0
votes
0 answers

Portfolio Optimisation under nested constraints

I am trying to solve a portfolio optimisation problem where I want to maximise the risk / return of 4 assets under constraints of no short sales and the sum of the weights should be equal to 1. As two of those assets are S&P500 (w1) and Nikkei 225…
user3690243
  • 113
  • 1
  • 11
0
votes
1 answer

About the definition or algorithm of the "value" component in the output of solve.qp in quadprog, R

I am using solve.QP in quadprog package of R to solve the classical mean-variance optimization problem. In my understanding, the output component "value" means the variance of the optimized portfolio and many codes for the mean-variance optimization…
Dr_BUG
  • 33
  • 5
0
votes
1 answer

R quadratic programming

i have a problem that i'd like to solve in R. I see that i can use the function lsei in the package limSolve to minimise a system of linear equations written Ax=b in the matrix form, subject to equality constraints Ex=f and the inequality…
chrisjacques
  • 635
  • 1
  • 5
  • 17
0
votes
0 answers

Enormous matrix (C++) (Visual Studio 2015) (QuadProg library)

I'm trying to use QuadProg++ library. The problem is that my CI variable is enormous. Up to 40,000 * 20,000. With this size, it will take too much memory (12GB at least.....). I have 2 questions: 1.- There are any way to give to the "solve_quadprog"…
selmo12f
  • 3
  • 4
0
votes
2 answers

quadprog fails to find a solution

I am trying to optimize layout of a set of boxes w.r.t. their hanger locations s.t. the boxes are most aligned with their hangers and do not crowd out each other. Using quadprog. Givens: 1. box hanger x-locations (P). =710 850 990 1130 2. …
Dinesh
  • 4,437
  • 5
  • 40
  • 77
0
votes
1 answer

Who knows the computational complexity of the function quadprog in MATLAB?

The QP problem is convex. For Wiki, the problem can be solved in polynomial time. But what exactly is the order?
Anguslilei
  • 31
  • 1
  • 5
0
votes
1 answer

Performance w/ calculating Hessian

[edit] The part about "f" is solved. Here is what I did: Instead of using: X = (F * W' - Y); f = X' * X; I'm now using: X = F*W; A = X'*F*W; B = -2*X'*Y; Y1 = Y'*Y; f = A + B + Y1 This will give a massive speed up. Still, the problem with the…
0
votes
0 answers

QuadProg++: Undefined reference to QuadProgPP; returned 1 exit status

I am trying to use the QuadProg++ library for the first time. I have followed all the instructions for installation. I also have Boost on my system. When I try to compile the main.cc file, which contains an example which solves a sample quadratic…
alpha_ulrich
  • 536
  • 5
  • 21
0
votes
1 answer

matlab quadprog constraints issue

I have a portfolio of weights I am using quadprog in matlab. I have all the inputs for the quadprog optimizer. I am just having some trouble formulating the constraints I would like my constraints to have a lower bound of either 0 or 1%, is there a…
qfd
  • 778
  • 2
  • 10
  • 24
0
votes
1 answer

Multiple equality constraints in Matlab's optimization toolbox

I am sorry if this sounds like a newbie question! I am all brand new to Matlab and the optimization toolbox! I have an optimization problem using quadprog, I have two equality constraints in my problem. Using the general formula: x =…
NZal
  • 849
  • 3
  • 9
  • 19
0
votes
2 answers

Matlab, choice of algorithm in optimization is ignored

When does Matlab's quadprog, ignore my choice of algorithm? I select interior-point-convex, but it uses active-set algorithm for me. What does it indicate? BTW, my objective is quadratic and convex, unless there is some unknown bug in my code.
user25004
  • 1,868
  • 1
  • 22
  • 47
-1
votes
1 answer

solve.QP() $value inconsistent with numerical calculation

I have a question about this algorithm that I need answered, as I'm auditing my model and this inconsistency is concerning. I am doing mean-variance optimization with constraints they must sum to 1, and the weights must be within my specified…
milkmotel
  • 402
  • 4
  • 13
-1
votes
1 answer

Maximize return -- Portfolio optimization

Yet another portfolio optimization question... Im trying to maximize the return of a portfolio of four assets given the restrictions sum(P) = 1, MaxW <= 0.55 and MinW >= 0.05 using quadprog. The average returns over the period are avgR <-…
Pierre
  • 671
  • 8
  • 25
1 2 3 4 5
6