I have two sets. One set consists of constants and the other one consists of expressions depending on two variables "a" and "b". I find absolute values of correlations between the aforementioned two sets of values. I get the maximum value of 0.96707 among these absolute values of correlations using the NMaximize command (utilizing the method "DifferentialEvolution") over -10<= a <= 10 and -10 <= b <= 10:
Input: NMaximize[{RealAbs[Correlation[{12^(2 a + 3 b), 13^(1 + 2 a + 3 b), 2^(2 a + b), 7^(3 a + b), 11^(4 a + b), 13^(a + 3 b)}, {-49.82, -51.5, -50.82, -50.69, -50.4, -53.71}]], -10<= a <= 10 && -10 <= b <= 10}, {a, b}, Method -> "DifferentialEvolution"]
Output: {0.96707, {a -> -1.43894, b -> 10.}}
However, if the constraint "-10 <= a <= 10 && -10 <= b <= 10" is replaced with "-3 <= a <= 3 && -3 <= b <= 3", the correlation increases: that is, the code
NMaximize[{RealAbs[Correlation[{12^(2 a + 3 b), 13^(1 + 2 a + 3 b), 2^(2 a + b), 7^(3 a + b), 11^(4 a + b), 13^(a + 3 b)}, {-49.82, -51.5, -50.82, -50.69, -50.4, -53.71}]], -3 <= a <= 3 && -3 <= b <= 3}, {a, b}, Method -> "DifferentialEvolution"]
gives output
{0.972989, {a -> -1.41882, b -> 0.504752}}
Certainly, the maximum value in the second case should be less than or equal to 0.96707 (the one obtained in the first case) because of the constraints. I don't know where I am making a mistake. Any help will be much appreciated.
"RandomSearch","DifferentialEvolution", "SimulatedAnnealing"
find the global maximum, which isn't unique in your example, too! $\endgroup$