Global 21-cm Signal Extraction from Foreground and Instrumental Effects
  II: Efficient and Self-Consistent Technique for Constraining Nonlinear Signal
  Models
  We present the completion of a data analysis pipeline that self-consistently
separates global 21-cm signals from large systematics using a pattern
recognition technique. In the first paper of this series, we obtain optimal
basis vectors from signal and foreground training sets to linearly fit both
components with the minimal number of terms that best extracts the signal given
its overlap with the foreground. In this second paper, we utilize the spectral
constraints derived in the first paper to calculate the full posterior
probability distribution of any signal parameter space of choice. The spectral
fit provides the starting point for a Markov Chain Monte Carlo (MCMC) engine
that samples the signal without traversing the foreground parameter space. At
each MCMC step, we marginalize over the weights of all linear foreground modes
and suppress those with unimportant variations by applying priors gleaned from
the training set. This method drastically reduces the number of MCMC
parameters, augmenting the efficiency of exploration, circumvents the need for
selecting a minimal number of foreground modes, and allows the complexity of
the foreground model to be greatly increased to simultaneously describe many
observed spectra without requiring extra MCMC parameters. Using two nonlinear
signal models, one based on EDGES observations and the other on
phenomenological frequencies and temperatures of theoretically expected
extrema, we demonstrate the success of this methodology by recovering the input
parameters from multiple randomly simulated signals at low radio frequencies
(10-200 MHz), while rigorously accounting for realistically modeled
beam-weighted foregrounds.
