Skip to main content
Became Hot Network Question
edited body
Source Link
Sid
  • 997
  • 1
  • 6
  • 15

I have a rather convoluted objective function to minimize, subject to some constraints. The results violates the constraints. The following example highlights the issue:

ObjectFunc = 1 - 0.000911933 s1 - 0.000911933 s2 - 0.000911933 s3;
Mat = {{1. - 0.0027358 s1, 0. + 0.0192484 s1, 0. + 0.022066 s1}, {0. + 0.0192484 s1, 1. - 0.135427 s1 - 0.138162 s2, 0. - 0.15525 s1 - 0.111996 s2}, {0. + 0.022066 s1, 0. - 0.15525 s1 - 0.111996 s2, 1 - 0.177976 s1 - 0.090786 s2 - 0.0198013 s3}};

NMinimize[{ObjectFunc, Det[Mat] > 0 && s1 > 0 && s2 > 0 && s3 > 0}, {s1, s2, s3}]

Specifically, if I evaluate Det[Mat] with the optimised parameters, I get a negative number. Admittedly, it is a very small negative number, but negative nonetheless. I have looked at changing the WorkingPrecision and PrecisionGoal.

Any ideas why NMaximizeNMinimize fails to appropriately constrain the objective function?

I have a rather convoluted objective function to minimize, subject to some constraints. The results violates the constraints. The following example highlights the issue:

ObjectFunc = 1 - 0.000911933 s1 - 0.000911933 s2 - 0.000911933 s3;
Mat = {{1. - 0.0027358 s1, 0. + 0.0192484 s1, 0. + 0.022066 s1}, {0. + 0.0192484 s1, 1. - 0.135427 s1 - 0.138162 s2, 0. - 0.15525 s1 - 0.111996 s2}, {0. + 0.022066 s1, 0. - 0.15525 s1 - 0.111996 s2, 1 - 0.177976 s1 - 0.090786 s2 - 0.0198013 s3}};

NMinimize[{ObjectFunc, Det[Mat] > 0 && s1 > 0 && s2 > 0 && s3 > 0}, {s1, s2, s3}]

Specifically, if I evaluate Det[Mat] with the optimised parameters, I get a negative number. Admittedly, it is a very small negative number, but negative nonetheless. I have looked at changing the WorkingPrecision and PrecisionGoal.

Any ideas why NMaximize fails to appropriately constrain the objective function?

I have a rather convoluted objective function to minimize, subject to some constraints. The results violates the constraints. The following example highlights the issue:

ObjectFunc = 1 - 0.000911933 s1 - 0.000911933 s2 - 0.000911933 s3;
Mat = {{1. - 0.0027358 s1, 0. + 0.0192484 s1, 0. + 0.022066 s1}, {0. + 0.0192484 s1, 1. - 0.135427 s1 - 0.138162 s2, 0. - 0.15525 s1 - 0.111996 s2}, {0. + 0.022066 s1, 0. - 0.15525 s1 - 0.111996 s2, 1 - 0.177976 s1 - 0.090786 s2 - 0.0198013 s3}};

NMinimize[{ObjectFunc, Det[Mat] > 0 && s1 > 0 && s2 > 0 && s3 > 0}, {s1, s2, s3}]

Specifically, if I evaluate Det[Mat] with the optimised parameters, I get a negative number. Admittedly, it is a very small negative number, but negative nonetheless. I have looked at changing the WorkingPrecision and PrecisionGoal.

Any ideas why NMinimize fails to appropriately constrain the objective function?

Source Link
Sid
  • 997
  • 1
  • 6
  • 15

NMinimize violates constraints

I have a rather convoluted objective function to minimize, subject to some constraints. The results violates the constraints. The following example highlights the issue:

ObjectFunc = 1 - 0.000911933 s1 - 0.000911933 s2 - 0.000911933 s3;
Mat = {{1. - 0.0027358 s1, 0. + 0.0192484 s1, 0. + 0.022066 s1}, {0. + 0.0192484 s1, 1. - 0.135427 s1 - 0.138162 s2, 0. - 0.15525 s1 - 0.111996 s2}, {0. + 0.022066 s1, 0. - 0.15525 s1 - 0.111996 s2, 1 - 0.177976 s1 - 0.090786 s2 - 0.0198013 s3}};

NMinimize[{ObjectFunc, Det[Mat] > 0 && s1 > 0 && s2 > 0 && s3 > 0}, {s1, s2, s3}]

Specifically, if I evaluate Det[Mat] with the optimised parameters, I get a negative number. Admittedly, it is a very small negative number, but negative nonetheless. I have looked at changing the WorkingPrecision and PrecisionGoal.

Any ideas why NMaximize fails to appropriately constrain the objective function?