Questions tagged [cvx]

CVX is a Matlab-based modeling system for convex optimization. CVX turns Matlab into a modeling language, allowing constraints and objectives to be specified using standard Matlab expression syntax.

CVX is a Matlab-based modeling system for convex optimization. CVX turns Matlab into a modeling language, allowing constraints and objectives to be specified using standard Matlab expression syntax.

99 questions
12
votes
1 answer

From CVX to CVXPY or CVXOPT

I've been trying to pass some code from Matlab to Python. I have the same convex optimization problem working on Matlab but I'm having problems passing it to either CVXPY or CVXOPT. n = 1000; i = 20; y = rand(n,1); A = rand(n,i); cvx_begin variable…
silgon
  • 6,890
  • 7
  • 46
  • 67
9
votes
1 answer

Least-squares minimization within threshold in MATLAB

The cvx suite for MATLAB can solve the (seemingly innocent) optimization problem below, but it is rather slow for the large, full matrices I'm working with. I'm hoping this is because using cvx is overkill, and that the problem actually has an…
Geoff
  • 1,202
  • 10
  • 18
5
votes
1 answer

How to run a job on a specific node using the slurm?

My original question is how to run the CVX toolbox (with academic license) on the cluster. I could not figure out a direct way of doing that and I have decided to tackle the problem in a different way. The CVX license is hardware dependent and…
Rasoul
  • 63
  • 1
  • 1
  • 5
5
votes
1 answer

Fast nonnegative quantile and Huber regression in R

I am looking for a fast way to do nonnegative quantile and Huber regression in R (i.e. with the constraint that all coefficients are >0). I tried using the CVXR package for quantile & Huber regression and the quantreg package for quantile…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
5
votes
1 answer

How do I square a norm in CVX?

In the CVX package for Matlab, I want to minimize a function like $|Ax-b|_2^2$ . Meaning the square of a 2-norm. How do I code that in CVX? I tried both: minimize (norm(A*x-b,2)^2); and minimize (norm(A*x-b,2)*norm(A*x-b,2)); but both threw…
Leo 254
  • 181
  • 1
  • 8
2
votes
1 answer

Why in the content of cvx, subs() does not work?

TLDR I wrote a code to solve a SDP problem. I used subs to change syms into numerical value before cvx content and I did see the numerical value after I printed out the variables. But whos() did show that the variable is still syms type which I…
narip
  • 175
  • 7
2
votes
0 answers

cvxpy - How to obtain the variable value after each iteration?

I am using cvxpy to solve a second order cone program. I have used the boilerplate code as mentioned in the cvxpy website - cvxpy SOCP webpage. I do not know how to obtain the variable value after each iteration... Code from the link: # Import…
2
votes
0 answers

Mixed integer semi-definite programming (MISDP) solvers in Python

It just came to my realization that MOSEK does not support mixed-integer convex programming (MICP) problems when there are semi-definite constraints. Wrapper functions are available in MATLAB (YALMIP) and Julia (Pajarito). I was wondering whether…
mmy_ubc
  • 21
  • 1
2
votes
2 answers

CVXR using Mosek for a quadratic minimization problem

I'm trying to solve a Quadratic optimization problem with linear constrains using the R package CVXR. Although the default solver is able to solve the optimization, Mosek solver is not. The reason I'm looking to use Mosek is because I need to solve…
Alejandro Andrade
  • 2,196
  • 21
  • 40
2
votes
0 answers

Efficient quadratic optimization with simple linear constraint MatLab using CVX

(Sorry about formatting, I will try my best) I want to solve: x = argmin_x (Ax - p)'(Ax - p) s.t. x >= b where A is a NxH logical matrix (roughly half zeros, half ones), b is a Hx1 constant vector where every entry is the same (e.g., b =…
2
votes
0 answers

trace in CVX package

I am using trace in my CVX (MATLAB) code. Sometimes it is working fine, but sometimes it is showing some errors. Error message is as follows- "trace" previously appeared to be used as a function or command, conflicting with its use here as the name…
Rajat
  • 249
  • 1
  • 11
2
votes
1 answer

Matlab cvx error with cvx_begin

cvx don't work out of the box for me for some reason. I use windows x64, cvx x64 and Matlab x64 R2012a But when I run even just simple example(\cvx\examples\quickstart.m) it give me an error: >> quickstart has_quadprog = exist( 'quadprog'…
mrgloom
  • 20,061
  • 36
  • 171
  • 301
2
votes
1 answer

How to set SDP constraints?

Z is a matrix variable that results from a CVX SDP code using Matlab; how can I include a constraint that the values of the elements of matrix Z should be either zero or one? There is the "banded" option but it doesn't work for matrices.
Amira Akra
  • 163
  • 11
1
vote
1 answer

How to populate a variable/expression in CVXPY

I am trying to translate cvx code to cvxpy. The major problem I am having is finding something similar to expressions. I used expressions to set values for an entire list of len(n). From my understanding the attributes in a variable in cvx cannot be…
1
vote
0 answers

Solving SDP problem with cvx - difference between MATLAB and R solution

I solved the following Linear Matrix Inequality (LMI) problem using cvx in Matlab: Lhs = [19.467593196, 1.82394007, 0.1625838, 0.01685267, 0.002495194; 1.823940068, 1.78664305, 0.9845668, 0.32951706, 0.010431878; 0.162583843, 0.98456679, 1.2333818,…
momomi
  • 23
  • 9
1
2 3 4 5 6 7