Specify solver in CVXR

961 Views Asked by At

I am new to the package CVXR. I am using it to do the convex optimization within each iteration of EM algorithms. Everything is fine at first but after 38 iterations, I have an error:

Error in valuesById(object, results_dict, sym_data, solver) : 
Solver failed. Try another.

I am not sure why the solver works fine at first but then fails to work later. I looked up the manual about how to change the solver but could not find the answer. I am also curious about whether we can specify learning step size in CVXR. Really appreciate any help

1

There are 1 best solutions below

0
On

The list of installed solvers in CVXR you can get with

installed_solvers()

In my case that is:

# "ECOS"    "ECOS_BB" "SCS"

You can change the one that is used just using argument solver, e.g. to change from the default ECOS to SCS:

result <- solve(prob, solver="SCS")

I think the developers are planning to support other solvers in the future, e.g. gurobi...