Questions tagged [convex-optimization]

Convex minimization, a subfield of optimization, studies the problem of minimizing convex functions over convex sets. The convexity property can make optimization in some sense "easier" than the general case - for example, any local minimum must be a global minimum.

Applications:

  • automatic control systems
  • estimation and signal processing
  • communications and networks,
  • electronic circuit design
  • data analysis and modeling
  • statistics
  • finance
305 questions
2
votes
4 answers

Algorithm for finding max value of functions of the form f(x) = a*min(b, x)?

I have an array of tuples (a, b) with a > 0 and b > 0. Each tuple represents a function f such that f(x, a, b) = a * min(b, x). Is there a known algorithm for a given x to find which tuple returns the maximum value ? I don't want to evaluate each…
2
votes
0 answers

Different behaviour between MATLAB fmincon and scipy optimize minimize

I'm translating some code from MATLAB to python. This code simulate the behaviour of a model and I want to estimate parameters from it. The problem is that results obtained with python and with MATLAB are very different. I've tought it was related…
2
votes
0 answers

Python - Optimizing a non-convex function that is "convex" when adding constraints

Suppose I have an objective function f(x) that is non-convex (x can be a vector), but once I add constraints it becomes a convex problem. To show what i mean, consider this trivial example: let f(x) = cos(x). Clearly, cos(x) is not convex, but if i…
user788466
  • 121
  • 1
2
votes
2 answers

CVXPY Quadratic Programming; ArpackNoConvergence error

I'm trying to use the Python package CVXPY to solve a convex quadratic programming problem of the first form here: https://www.cvxpy.org/examples/basic/quadratic_program.html, using the following code x = np.variable(2 * N) prob =…
2
votes
1 answer

CVXPY: DCPError: Problem does not follow DCP rules

I am trying to code a problem solves B(2,1) under LMI constraints. R(2,1)=R0(2,1)+H(2,2)*B(2,1) Vc is a scalar variable It keeps getting > "DCPError: Problem does not follow DCP rules." import numpy as np import cvxpy as cp H =…
2
votes
1 answer

cvxpy: Converting a nonlinear constraint to an equivalent linear constraint

Context: I'm the developer of PyPortfolioOpt, a python portfolio optimisation library, and I'm trying to allow users to add constraints to a maximum Sharpe ratio problem. Currently, users can pass their constraints as a lambda function, e.g to make…
lagrange103
  • 169
  • 3
  • 9
2
votes
0 answers

The objective is not DCP. Its following subexpressions are not

Here I use the cvxpy solver to solve a problem. But the Problem does not follow DCP rules. The objective is import cvxpy as cp import numpy as np def bit_rate(alpha, beta, p, w): return alpha * w * cp.log(1 + beta * p / w) # Create scalar…
Leo Li
  • 81
  • 1
  • 7
2
votes
2 answers

Is my problem suited for convex optimization, and if so, how to express it with cvxpy?

I have an array of scalars of m rows and n columns. I have a Variable(m) and a Variable(n) that I would like to find solutions for. The two variables represent values that need to be broadcast over the columns and rows respectively. I was naively…
2
votes
1 answer

Any Differences in `cvxpy` Library Between L2 Norm and `sum_of_square()`?

I am trying to use cvxpy lib to solve a very simple least square problem. But I found that cvxpy gave me very different results when I use sum_squares and norm(x,2) as loss functions. The same happens when I try the l1 norm and sum of absolute…
skinfaxi
  • 21
  • 3
2
votes
1 answer

Can PSO converge at a point with non-zero derivative?

I am using this library - https://pythonhosted.org/pyswarm/ to find the global minima of a convex function. This is just to get started and work towards a non-convex function. I found the global minima using linear regression but the problem is that…
2
votes
1 answer

Mosek solver failing when constraints added to optimisation problem (10000 variable, using Python/cvxpy)

In short The optimisation problem below is declared infeasible when run with Mosek, but is solvable (easily and accurately) using the open-source solver ECOS. I'm wondering: why is such an advanced commercial solver like Mosek failing to solve this…
Gareth Williams
  • 242
  • 4
  • 10
2
votes
0 answers

CVXPY error: "NotImplementedError: Strict inequalities are not allowed"

def PPNM_model(a,E, beta): p = E.shape[1] x = E*a x = sum(x,beta*cp.square(x)) return x def PPNM_model_cvxpy(a,E,beta): first = E*a second = beta*cp.square(first) third = sum(first,second) return third def…
S2304
  • 21
  • 2
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

lpSolve package seems to give strange results

I am using the R "lpSolve" package downloaded from Cran link and it seems to give strange answers. I wanted to make sure that it is not me messing up things (which is likely the case). For example, the problem I am trying to solve is maximize…
Yue Y
  • 583
  • 1
  • 6
  • 24
2
votes
0 answers

efficiently reusing/updating julia convex constraints

I'm using Julia (with Convex) to solve a convex problem many times with the same constraint structure. Right now, I have something like the following simplified structure: using Convex N = Int16(1e4) x = Variable(N) t = Variable() obj =…
jjjjjj
  • 1,152
  • 1
  • 14
  • 30