I am trying to work out for what $\lambda_1, \lambda_2 > 0$ is it true that $f(y) = \lambda_1 e^{y-\lambda_1 e^y} + \lambda_2 e^{y-\lambda_2 e^y}$ is unimodal?
Experimentally it seems it is unimodal when $\lambda_1 < \lambda_2$ and $\frac{\lambda_2}{\lambda{1}} < 7.5$ .
To work this out I started with:
$$\frac{d}{dy} \left(\lambda_1 e^{y-\lambda_1 e^y} + \lambda_2 e^{y-\lambda_2 e^y} \right) = \lambda_1 e^{y - \lambda_1 e^y} (1 - \lambda_1 e^y ) + \lambda_2 e^{y - \lambda_2 e^y} (1 - \lambda_2 e^y )$$
It seems we then need to check when
$$\lambda_1 e^{y - \lambda_1 e^y} (1 - \lambda_1 e^y ) + \lambda_2 e^{y - \lambda_2 e^y} (1 - \lambda_2 e^y ) = 0$$
has more than one solution when solved for $y \in \mathbb{R}$. How can we determine the conditions under which it has different numbers of solutions?
Added:
Substituting $z = e^y$ and dividing by $e^{y-1}$ we are trying to determine how many solutions
$$ \lambda_1 e^{1-\lambda_1 z}(1-\lambda_1 z) +\lambda_2e^{1-\lambda_2 z}(1-\lambda_2 z) = 0 $$
has with $z > 0$.
Examples:
Example $\lambda_1 = 1, \lambda_2 = 7$ with only one mode (code in python):
import matplotlib.pyplot as plt
import numpy as np
def pdf_func(y, params):
return sum([lambd*np.exp(y - lambd * np.exp(y)) for lambd in params])
params = [1, 7]
xs = np.linspace(-10,10,1000)
plt.plot(xs, [pdf_func(y, params) for y in xs])
Example $\lambda_1 = 1, \lambda_2 = 50$ with two modes:
Questions
- How can one prove (assuming it is true) that that the number of local maxima that $f(y)$ has is either 1 or 2 and there are no other possibilities?
- Is it true that for $\lambda_2 > \lambda_1 > 0$, there exists a threshold $c$ so that if $\frac{\lambda_2}{\lambda_1} < c$ then $f(y)$ is unimodal and if not it has two local maxima? (My guess is that the answer is yes and this threshold is around $7.5$.)







Consider
$$ f(z) = \lambda _1 z e^{-\lambda _1 z}+\lambda _2 z e^{-\lambda _2 z} $$
with $z = e^y$
and now
$$ f'(z) = -\lambda _1 e^{-\lambda _1 z} \left(\lambda _1 z-1\right)-\lambda _2 e^{-\lambda _2 z} \left(\lambda _2 z-1\right)=0 $$
or
$$ \frac{\lambda_2^2}{\lambda_1^2}e^{(\lambda_1-\lambda_2)z}+\frac{z-\frac{1}{\lambda_2}}{z-\frac{1}{\lambda_1}} = 0 $$
here
$$ \frac{\lambda_2^2}{\lambda_1^2}e^{(\lambda_1-\lambda_2)z}\gt 0 $$
so the zero's location is associated to the sign of
$$ \frac{z-\frac{1}{\lambda_2}}{z-\frac{1}{\lambda_1}} $$
so
$$ \min_i\frac{1}{\lambda_i}\le z \le \max_i\frac{1}{\lambda_i} $$
NOTE
As an example, for $\lambda_1 = 1, \lambda_2 = 50$ we have the sign change plot
Now the solutions should be searched into the negative interval which is $0.02\le z \le 1$. The roots here are $z =\{0.0211011,0.113856,1\}$
Now considering after $\lambda_2 = \zeta\lambda_1$
$f'(z,\zeta,\lambda_1)=\lambda _1 \zeta e^{-\lambda _1 z \zeta } \left(\lambda _1 z \zeta -1\right)+\lambda _1 e^{-\lambda _1 z} \left(\lambda _1 z-1\right)$.
or calling $y = \lambda_1 z, x = \zeta$
$$ g(x,y) = x(x y -1)e^{-y(x-1)}+y - 1 $$
or also
$$ x y +W\left(\frac{(y-1)e^{1-y}}{x}\right) - 1 = 0 $$
Here $W(\cdot)$ is the Lambert function.
Follows the plot for $g(x,y) = 0$
As can be observed roughly for $0\le x \le 7.5$ we have one root and for $7.5 \lt x$ we have three roots.
The determination of the passage from one root to three is made as follows. Solving numerically $g(x,y) = 0$ and $\frac{dg}{dy} = 0$ we obtain the point $(7.56628, 0.802977)$ (the black point as the intersection of $g(x,y) = 0$ in blue and $\frac{dg}{dy} = 0$ in green)