  We present a comprehensive simulation-based study of the BayesEoR code for 21
cm power spectrum recovery when analytically marginalizing over foreground
parameters. To account for covariance between the 21 cm signal and
contaminating foreground emission, BayesEoR jointly constructs models for both
signals within a Bayesian framework. Due to computational constraints, the
forward model is constructed using a restricted field-of-view (FoV) in the
image domain. When the only EoR contaminants are noise and foregrounds, we
demonstrate that BayesEoR can accurately recover the 21 cm power spectrum when
the component of sky emission outside this forward-modelled region is
downweighted by the beam at the level of the dynamic range between the
foreground and 21 cm signals. However, when all-sky foreground emission is
included along with a realistic instrument primary beam with sidelobes above
this threshold extending to the horizon, the recovered power spectrum is
contaminated by unmodelled sky emission outside the restricted FoV model.
Expanding the combined cosmological and foreground model to cover the whole sky
is computationally prohibitive. To address this, we present a modified version
of BayesEoR that allows for an all-sky foreground model, while the modelled 21
cm signal remains only within the primary FoV of the telescope. With this
modification, it will be feasible to run an all-sky BayesEoR analysis on a
sizeable compute cluster. We also discuss several future directions for further
reducing the need to model all-sky foregrounds, including wide-field foreground
subtraction, an image-domain likelihood utilizing a tapering function, and
instrument primary beam design.
