TITLE: Global maximum of a sum of Gaussians
QUESTION [15 upvotes]: Suppose I have the weighted sum of $n$ Gaussian functions with varying means and standard deviations,
$$f(x) = \sum_{i=1}^n a_i\exp\left(-\frac{(x-\mu_i)^2}{2\sigma_i^2}\right).$$
All the weights $a_i$ are positive. I want to find the position of the global maximum of $f$.
Clearly $f$ is non-concave and may have multiple local maxima. However, it feels like each local maximum should be close to the peak $\mu_i$ of one of the Gaussians.
Suppose I perform gradient ascent $n$ times starting from $x = \mu_i$ for $i = 1, 2,\ldots, n$. Am I guaranteed to find all the local maxima, and thus the global maximum? Is there a better strategy to find the global maximum?

REPLY [5 votes]: Here's a partial result making the intuition in my question rigorous.
Let $f(x) = \sum\limits_{i=1}^n g_i(x)$, where $$g_i(x) = a_i\exp\left(-\frac{(x-\mu_i)^2}{2\sigma_i^2}\right)$$ are the $n$ Gaussians being summed together.
Suppose $x$ is a critical point of $f$, that is, $f'(x)=0$. For it to be a local maximum, $f''(x)$ must be negative. But $f''(x)=\sum\limits_{i=1}^ng_i''(x)$, and $$g_i''(x)=\frac{(x-\mu_i)^2-\sigma_i^2}{\sigma_i^4}g(x)$$ is negative only when $x\in[\mu_i-\sigma_i,\mu_i+\sigma_i]$. So any local maximum can only occur within $\sigma_i$ of a $\mu_i$.
This allows us to only search within the potentially smaller union of intervals $\bigcap\limits_{i=1}^n [\mu_i-\sigma_i,\mu_i+\sigma_i]$ rather than all of the approximately $[\min\mu_i,\max\mu_i]$ as I interpret Yuandong's answer. This is helpful if the $\mu_i$ are widely separated. Nevertheless, $f$ is not guaranteed to be concave in any of these intervals, so we cannot be assured to find a global maximum simply by gradient ascent. One can get within $\epsilon$ of the global maximum by a grid search with step size $\epsilon/M$, where $M$ is as defined in Yuandong's answer, but it would be nice to know if any faster convergence is possible.