Mathematica:FindArgMax 不是 return 全局最大值

Mathematica: FindArgMax does not return a global maximum

我有一个相当高振荡的函数,我需要在区间 (-Pi,Pi) 中找到 ArgMax。

当我绘制函数时,很明显 FindArgMax 选择了错误的最大值。我试过调整AccuracyGoal和PrecisionGoal,以及各种可用的Method,但这似乎没有达到要求的效果。

w[SNR_] := 
 RandomVariate[NormalDistribution[0, 0.5*Sqrt[2]*10^(-SNR/20)], 16] + 
 I RandomVariate[NormalDistribution[0, 0.5*Sqrt[2]*10^(-SNR/20)], 16]

G[\[Omega]_] := Re[Sum[(Exp[1.2556 I (m - 1)] + noise[[m]]) Exp[-I \[Omega] (m - 1)], {m, 1, 16}]/16]

noise = w[-20];
estimate = FindArgMax[G[\[Omega]], \[Omega], Method -> "QuasiNewton", 
AccuracyGoal -> 30, PrecisionGoal -> 30][[1]];
Plot[G[x], {x, -Pi, Pi}, Epilog -> Line[{{estimate, -100}, {estimate, 100}}], PlotRange -> All, Frame -> True, Axes -> None, FrameTicks -> {{-Pi, -Pi/2, 0, Pi/2, Pi}, Automatic, {}, {}},PlotRangePadding -> {0, 0.05}]
Print[estimate]

有没有办法找到全局最大值?

您需要近似起点,否则最大化会过于局部化。

x0 = Sort[Table[{G[x], x}, {x, -Pi, Pi, 0.01}]][[-1, 2]];

estimate = Quiet@
   FindArgMax[{G[\[Omega]], -Pi <= \[Omega] <= Pi}, {\[Omega], x0}][[1]];

Plot[G[x], {x, -Pi, Pi},
 Epilog -> Line[{{estimate, -100}, {estimate, 100}}],
 PlotRange -> Full, Frame -> True, Axes -> None,
 FrameTicks -> {{Automatic, Automatic},
   {{-Pi, -Pi/2, 0, Pi/2, Pi}, None}},
 PlotRangePadding -> {0, 0.05}]
Print[estimate]