I need to solve the following equation for $\lambda$ involving the moment generating function of a positive random variable, $T$:
$$E_T[\exp(-\lambda T)] = q$$
Here, $0<q<1$ and I am able to draw samples from the distribution of $T$. The obvious way is to simply calculate the expectation in the equation above using simulation for various values of $\lambda$, fit some kind of curve and solve for $q$. But this involves performing the expensive operation of simulation multiple times.
Is there an approach to solve for $\lambda$ efficiently?
As Snoop mentioned, one simulation over $T$ is enough. For each of the $n$ sampled values, $T_1, T_2, \dots T_n$, we get a grid: $\lambda_1,\lambda_2 \dots \lambda_k$. For each $T_i$, the $\exp(-\lambda_k T_i)$ is a strictly decreasing function of $\lambda_k$. So once we average over the simulations, we will again get a function that is strictly decreasing in $\lambda_k$'s. If we choose the grid over $\lambda_k$'s tight enough, we can even get away with a piece-wise linear function between them.
Since they are in sorted order, we can use binary search to find the index, $k$ that sandwiches $q$ along with $k+1$. Then, we can linearly interpolate between them to solve for $\lambda$.