  In a recent Letter [T. Dornheim et al., Phys. Rev. Lett. 121, 255001 (2018)]
we have presented the first ab initio results for the dynamic structure factor
$S(\mathbf{q},\omega)$ of the uniform electron gas for conditions ranging from
the warm dense matter regime to the strongly correlated electron liquid. This
was achieved on the basis of exact path integral Monte Carlo data by
stochastically sampling the dynamic local field correction
$G(\mathbf{q},\omega)$. In this paper, we introduce in detail this new
reconstruction method and provide several practical demonstrations. Moreover,
we thoroughly investigate the associated imaginary-time density--density
correlation function $F(\mathbf{q},\tau)$. The latter also gives us access to
the static density-response function $\chi(\mathbf{q})$ and static local field
correction $G(\mathbf{q})$, which are compared to standard dielectric theories
like the widespread random phase approximation. In addition, we study the
high-frequency limit of $G(\mathbf{q},\omega)$ and provide extensive new
results for the dynamic structure factor for different densities and
temperatures. Finally, we discuss the implications of our findings for warm
dense matter research and the interpretation of experiments.
