  Current and upcoming radio interferometric experiments are aiming to make a
statistical characterization of the high-redshift 21cm fluctuation signal
spanning the hydrogen reionization and X-ray heating epochs of the universe.
However, connecting 21cm statistics to underlying physical parameters is
complicated by the theoretical challenge of modeling the relevant physics at
computational speeds quick enough to enable exploration of the high dimensional
and weakly constrained parameter space. In this work, we use machine learning
algorithms to build a fast emulator that mimics expensive simulations of the
21cm signal across a wide parameter space to high precision. We embed our
emulator within a Markov-Chain Monte Carlo framework, enabling it to explore
the posterior distribution over a large number of model parameters, including
those that govern the Epoch of Reionization, the Epoch of X-ray Heating, and
cosmology. As a worked example, we use our emulator to present an updated
parameter constraint forecast for the Hydrogen Epoch of Reionization Array
experiment, showing that its characterization of a fiducial 21cm power spectrum
will considerably narrow the allowed parameter space of reionization and
heating parameters, and could help strengthen Planck's constraints on
$\sigma_8$. We provide both our generalized emulator code and its
implementation specifically for 21cm parameter constraints as publicly
available software.
