Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulties with DCP rules #73

Closed
C4lv1n5 opened this issue May 30, 2020 · 1 comment
Closed

Difficulties with DCP rules #73

C4lv1n5 opened this issue May 30, 2020 · 1 comment

Comments

@C4lv1n5
Copy link

C4lv1n5 commented May 30, 2020

Hi,

I am facing the following challenge for which I don't seem to find a solution:

Basically, I want to program some code for StoNED - Stochastic non-smooth envelopment of data. The mathematical problem is described as

Stoned Problem

I started with this:

# dim(G) is 35x15
# dim(X) is 5x15
# dim(y) is 5x1
# dim(h) is 15x1

# y is a vector of output, x a matrix of input, h a vector of zeros, G a matrix of constraint parameters, betaa shall be estimated

library(CVXR)
betaa <- Variable(15,1)
target <- cvxr_norm(log(y)-log(X%*%betaa))
obj <- Minimize(target)
constr <- list(G%*%betaa>=h)
prob <- Problem(obj,constr)
result <- solve(prob)
print(result$getValue(betaa))

Since this didn't work, I tried transforming the problem to this:

library(CVXR)
library(MASS)

#betaa <- Variable((15,1)
test <- Variable(5,1)
target <- cvxr_norm(log(y)-test)
obj <- Minimize(target)
constr <- list(G%*%(ginv(X)%*%exp(test))>=h)
prob <- Problem(obj,constr)
result <- solve(prob)
print(result$getValue(ginv(X)%*%exp(test)))

Through this I shifted the DCP error from the problem expression to the constraint expression. I really don't have a clue how to get around this. Does anyone have a proper solution? Thanks in advance!

@anqif
Copy link
Collaborator

anqif commented Jan 31, 2023

You are getting a DCP error because the optimization problem you are trying to solve is nonconvex due to the equality constraint containing the natural log. A convex problem can only have affine equality constraints. You will need to figure out a way to approximate the problem. I recommend looking up MM algorithms.

@anqif anqif closed this as completed Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants