Questions tagged [cvxopt]

A Python package for convex optimization, including solvers for linear programming, quadratic programming, semidefinite programming and more.

There is an official web site of the CVXOPT package. The official description of the package is given there as follows:

CVXOPT is a free software package for convex optimization based on the Python programming language. It can be used with the interactive Python interpreter, on the command line by executing Python scripts, or integrated in other software via Python extension modules. Its main purpose is to make the development of software for convex optimization applications straightforward by building on Python’s extensive standard library and on the strengths of Python as a high-level programming language.

227 questions
2
votes
1 answer

How to set up multiple equality constraints in quadratic programming in python?

In the example given in https://cvxopt.org/examples/tutorial/qp.html, they give the syntax for the situation when there is one equality constraint but I am having problems getting it right when I have three equality constraints.
2
votes
0 answers

CVXOPT QP SOLVER : TypeError: 'A' must be a 'd' matrix with 10 columns

I'm having trouble with the CVXOPT QP Solver lately: I keep receiving the TypeError: 'A' must be a 'd' matrix with 10 columns error while I had, indeed, a matrice A of dimension (10,10) and of type d. Here is the code: import numpy as np from cvxopt…
Kermit
  • 3,112
  • 2
  • 10
  • 34
2
votes
0 answers

CVXPY doesn't terminate (with CVXOPT as solver)

We are using CVXPY with CVXOPT as solver (and cvx.ROBUST_KKTSOLVER as KKT solver) as part of a change-point detection approach. In some cases, the call to Problem.solve() doesn't terminate. We cannot deterministically reproduce the problem as…
Konstantin
  • 2,451
  • 1
  • 24
  • 26
2
votes
0 answers

How to perform Stochastic Optimization using PyMC3?

I am trying to combine cvxopt (an optimization solver) and PyMC3 (a sampler) to solve convex stochastic optimization problems. I have tried to use the following code (PyMC, version 2) as a baseline. But I couldn't make it work. Stochastic…
2
votes
2 answers

How to Access CVXPY Variables/Parameters After Declaration

I'd like to standardize a few cvxpy problems and use them in many places in my codebase. Here is a cleaned example: from cvxpy import Variable, Parameter, Problem, Minimize def problem_builder(n, ...) var = Variable(n) param =…
rhaskett
  • 1,864
  • 3
  • 29
  • 48
2
votes
1 answer

Conda Not Installing Latest Version

I'm installing cvxpy from cvxgrp. Looking a the link it clearly shows version 1.01 for win-64. However when I go to run the install conda install -c cvxgrp cvxpy it downloads and installs "cvxpy-0.4.10". Updating "all" does not seem to help. I…
rhaskett
  • 1,864
  • 3
  • 29
  • 48
2
votes
1 answer

CVXPY throws SolverError

When using CVXPY, I frequently get "SolverError". Their doc just says this is caused by numerical issues, but no further information is given about how to avoid them. The following code snippet is an example, the problem is trivial, but the…
Tony
  • 445
  • 6
  • 13
2
votes
1 answer

SVM - How can I vectorize a kernalized gram matrix?

I implemented a support vector machine in python using the cvxopt qp solver where I need to compute a gram matrix of two vectors with a kernel function at each element. I implemented it correctly using for loops but this strategy is computationally…
random_0620
  • 1,636
  • 5
  • 23
  • 44
2
votes
1 answer

How to add bounds on variables in cvxopt efficiently?

I am solving a convex optimization problem in python cvxopt. I know I can add the lower bound and upper bound using Gx <= h constraint. However, this increases the dimensionality of the problem. In addition to that in scenarios during solution…
deepAgrawal
  • 673
  • 1
  • 7
  • 25
2
votes
1 answer

Conflicting solutions in linear programming in MATLAB and Python

I am trying to run a large-scale linear program and am translating some of my previous code from MATLAB into Python. However, the problem is that MATLAB and Python are giving me drastically conflicting answers: the MATLAB code finds the optimal…
charl
  • 93
  • 7
2
votes
2 answers

Error installing cvxopt using Conda

I'm attempting to install cvxopt using Conda (which comes with the Anaconda python distribution), and I received the error message below. Apparently my Anaconda installation is using python 3.6, whereas cvxopt wants python 3.5*. How can I fix this…
littleO
  • 942
  • 1
  • 11
  • 26
2
votes
1 answer

optimization with python cvxopt

I am trying to minimize the portfolio variance using Python's cvxopt. However, after lots of trying, it doesn't seem to work. The function and my code and the error are pasted below. Thanks for helping! the minimize problem objective function: min…
Y.cady
  • 21
  • 1
  • 3
2
votes
2 answers

portfolio optimization: how to maximize return while subject to target risk using cvxopt.solver.qp?

Trying to optimize a portfolio weight allocation here which maximize my return function by limit risk using cvxopt module. My codes are as below: from cvxopt import matrix, solvers, spmatrix, sparse from cvxopt.blas import dot import numpy import…
Wei Wu
  • 1,023
  • 1
  • 9
  • 14
2
votes
2 answers

cvxopt errors out when multiplying a scalar to a matrix

Python 3.5.2 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:53:06) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from cvxopt import matrix >>> 2 * matrix(1.0, (1,…
rrao
  • 297
  • 4
  • 11
2
votes
1 answer

how to install cvxopt on windows 7 64 bit machine for python 3.5 of anaconda?

Please suggest step by step method to install cvxopt on Windows7 64 bit machine for python version 3.5. I'm really facing hard time to install it. Above is the error i'm getting. After doing : conda install -c omnia cvxopt=1.1.8 on cmd,I am getting…
Nikita Gupta
  • 495
  • 9
  • 24