optimizationmathematical-optimizationnumerical-methodscvxpymosek

cvxpy/mosek improving the precision of the solution


Currently my objective function gives me a solution in the magnitude of about 1e-6. I think that gives me some precision problem.

What's the best practice to handle this kind of problems? It seems like I can multiply the obj function by 1e6 for example, but not sure if that's the best way. What kind of parameters can I set?


Solution

  • Impossible to say for sure but let me use this to post some general guidelines about numerical problems when using CVXPY+Mosek.

    Here are some more modeling hints:

    https://docs.mosek.com/modeling-cookbook/practical.html

    and here are some more specific implementation hints including interesting Mosek parameters

    https://docs.mosek.com/latest/pythonapi/debugging-numerical.html

    Here you can see how to set Mosek parameters and write data to files from CVXPY

    https://docs.mosek.com/latest/faq/faq.html#cvxpy

    If you fail to get things to work as expected you can always save the task file of the problem and send it to Mosek support with an explanation.