= Solution
The constant density is reasonable when the <integrand> has comparable magnitude throughout the interval. It is inefficient for a narrow peak because most samples contribute little while rare samples carry large weights.
For independent <importance sampling>,
$$
\operatorname{Var}(\widehat I_N)=\frac1N\left[\int_a^b\frac{f(x)^2}{q(x)}\,dx-I^2\right].
$$
A good density has support wherever $f\ne0$, is easy to sample and evaluate, and resembles $|f|$. Subject to normalization, \b[$q\propto|f|$ minimizes this <variance>]. For nonnegative $f$, the ideal normalized choice makes every sample contribution equal, although its normalization is generally the unknown integral itself. Uniform weighting is therefore acceptable for a flat <integrand>, not universally suitable.
Back to article page