Questions tagged [quadratic-programming]

Quadratic programming (QP) is a special type of mathematical optimization problem. It is the problem of optimizing (minimizing or maximizing) a quadratic function of several variables subject to linear constraints on these variables.

Quadratic programming (QP) is a special type of mathematical optimization problem. It is the problem of optimizing (minimizing or maximizing) a quadratic function of several variables subject to linear constraints on these variables.

184 questions
13
votes
1 answer

How to convert quadratic to linear program?

I have an optimization problem that has in the objective function 2 multiplied variables, making the model quadratic. I am currently using zimpl, to parse the model, and glpk to solve it. As they don't support quadratic programming, I would need to…
11
votes
4 answers

MATLAB: Find abbreviated version of matrix that minimises sum of matrix elements

I have a 151-by-151 matrix A. It's a correlation matrix, so there are 1s on the main diagonal and repeated values above and below the main diagonal. Each row/column represents a person. For a given integer n I will seek to reduce the size of the…
9
votes
3 answers

CVXOPT QP Solver: TypeError: 'A' must be a 'd' matrix with 1000 columns

I'm trying to use the CVXOPT qp solver to compute the Lagrange Multipliers for a Support Vector Machine def svm(X, Y, c): m = len(X) P = matrix(np.dot(Y, Y.T) * np.dot(X, X.T)) q = matrix(np.ones(m) * -1) g1 =…
Utumbu
  • 283
  • 2
  • 6
  • 16
6
votes
1 answer

What are the specific reasons for CVXPY to throw `SolverError` exception?

I am using CVXPY (version 1.0) to solve a quadratic program (QP) and I often get this exception: SolverError: Solver 'xxx' failed. Try another solver. which makes my program really fragile. I have tried different solvers, including CVXOPT, OSQP,…
6
votes
1 answer

Linear regression with constraints on the coefficients

I am trying to perform linear regression, for a model like this: Y = aX1 + bX2 + c So, Y ~ X1 + X2 Suppose I have the following response vector: set.seed(1) Y <- runif(100, -1.0, 1.0) And the following matrix of predictors: X1 <- runif(100, 0.4,…
arielle
  • 855
  • 1
  • 9
  • 22
5
votes
2 answers

Is there any quadratic programming function that can have both lower and upper bounds - Python

Normally I have been using GNU Octave to solve quadratic programming problems. I solve problems like x = 1/2x'Qx + c'x With subject to A*x <= b lb <= x <= ub Where lb and ub are lower bounds and upper bounds, e.g limits for x My Octave code looks…
5
votes
3 answers

Quadratic Programming in Python using Numpy?

I am in the process of translating some MATLAB code into Python. There is one line that is giving me a bit of trouble: [q,f_dummy,exitflag, output] = quadprog(H,f,-A,zeros(p*N,1),E,qm,[],[],q0,options); I looked up the documentation in MATLAB to…
A.Torres
  • 363
  • 4
  • 14
5
votes
1 answer

Optimisation in swi prolog

Say I want to find argmax(x,y,z) -1/2(20x^2+32xy +16y^2)+2x+2y. subject to: x>=0, y>=0,z>=0 and -x-y+z =0. I know the partial derivatives being set to 0 is : -20x-16y+2=0 and -16x-16y+2 =0 so we could have x= 0 and y =1/8 and z=1/8. How would I do…
user27815
  • 4,687
  • 11
  • 28
4
votes
1 answer

How to use R package Quadprog to solve SVM?

I was wondering what's the proper way to implement Quadprog to solve quadratic programming. I have the following question(ripped from the internet)and also was looking at the following…
gchavez101
  • 83
  • 1
  • 8
3
votes
1 answer

CPLEX Java Convex Quadratic Constraint (only PSD if x non-negative)

I have a quadratic problem with the variables e and a, both of which are non-negative. I have a constraint that reads a <= e (1 - a). When transformed, the matrix Q reads [[0,-1][0,0]] which is obviously neither positive nor negative semi-definite…
Layla
  • 103
  • 10
3
votes
1 answer

Maximization of quadratic forms in R with respect to a vector of weights

I have a distance (similarity) matrix D, for example, D <- matrix(c(0.00, 1.00, 1.00, 0.10, 0.05, 1.00, 0.00, 1.00, 1.00, 1.00, 1.00, 1.00, 0.00, 0.90, 0.95, 0.10, 1.00, 0.90, 0.00, 0.15, 0.05, 1.00, 0.95, 0.15, 0.00),5,5) and a vector of weights…
3
votes
1 answer

Warm starting QP solver in CPLEX

I'm trying to figure out how to warm start the quadratic programming solver(s) for CPLEX. I am specifically interested in warm starting the QP solver for nonconvex quadratic programs terminating at first-order stationary points. I believe the…
ae0709
  • 304
  • 1
  • 9
3
votes
1 answer

Minimize portfolio variance, constrained to be sufficiently similar to a benchmark portfolio

I am performing portfolio optimization, and I would like to extend the discussion here with the following: I have a vector of weights w_bench that is used as a benchmark. I would like to optimize a portfolio weight vector w_pf that…
3
votes
1 answer

Gurobi or CPLEX? Quadratic indefinite objective - quadratic positive-semidefinite constraints

I want to minimize a quadratic objective function subject to a set of linear and quadratic constraints. The quadratic objective function is indefinite (non-convex). The quadratic constraints are positive-semidefinite (convex). The variables are…
user436994
  • 547
  • 3
  • 13
3
votes
1 answer

Quadratic programme with a_ix_i^2 terms in objective function

With regards to a quadratic programme, how would I set up an objective function like min⁡ ∑a_i (x_i )^2 in the matrix form for packages “quadprog” or “limSolve” (for this package I'm not sure if it needs to be in matrix form)? From the discussion…
NeilC
  • 33
  • 2
1
2 3
12 13