Which numerical value is consider as zero is mosek ?

34 views
Skip to first unread message

Tường Nguyễn

unread,
Nov 9, 2024, 9:05:25 AM11/9/24
to mosek
Dear Mosek Team,
1/ I am trying to figure out which number is consider as zero in mosek ?
Particularly I want my  epsilon to be slightly a bit bigger than zero and I am not sure if I should choose it to be 1e-10 or 1e-9

constraints = [constraints, epsilon <= beta_mn(m, n) <= (a_mn(m,n) ) ]; 2/ Will the numerical of a value that is considered as zero be affected by these options ?
MSK_DPAR_INTPNT_CO_TOL_PFEAS
MSK_DPAR_INTPNT_CO_TOL_DFEAS
Thank you and best regard Tuong

Erling D. Andersen

unread,
Nov 11, 2024, 1:39:05 AM11/11/24
to mosek
If your model is reasonably scaled I would use something like 1.0e-6.

At


you can read about how the mentioned parameters are used. Note these parameters are NOT used to control the absolute error but the relative error i.e. 
error relative to ||b|| and ||c||.

Tường Nguyễn

unread,
Nov 12, 2024, 1:16:03 AM11/12/24
to mosek
So when I changed

MSK_DPAR_INTPNT_CO_TOL_PFEAS
MSK_DPAR_INTPNT_CO_TOL_DFEAS Will this 1e-6 be not considered as zero anymore ?

Michal Adamaszek

unread,
Nov 12, 2024, 1:31:56 AM11/12/24
to mosek
There are two questions here.

First, what parameter controls that Mosek does not round values such as 1e-9 to zero? The answer is, it depends on where the value is (objective, constraints) and which interface to Mosek you are using, because they can make the values end up in different places. Rounding mostly applies to the constraint matrices. You can always save the PTF file of the problem and see if the value is there as expected.

Second question, does setting x >= 1e-9 or something like that guarantee that x will be positive in the solution. The answer is no, because nobody can predict the solution violations, so it may be the case that your optimal solution has x= - 1e-8. If you know how your problem solves you may be able to pick some bound experimentally that gives you that x is positive. But trying to work on a scale of 1e-10, 1r-9 is usually a bad idea.

Considering both questions: it is not really worthwhile to bother about 1e-9 and the like. Setting epsilon around 1e-6 is a reasonable safe average option, but even that you should test, since everything is relative to the scaling of your inputs.

Michal



Tường Nguyễn

unread,
Nov 12, 2024, 2:26:30 AM11/12/24
to mosek
Thank you, this is a very clear answer !
Reply all
Reply to author
Forward
0 new messages