  Using tens of thousands of halos realized in the BAHAMAS and MACSIS
simulations produced with a consistent astrophysics treatment that includes AGN
feedback, we validate a multi-property statistical model for the stellar and
hot gas mass behavior in halos hosting groups and clusters of galaxies. The
large sample size allows us to extract fine-scale mass--property relations
(MPRs) by performing local linear regression (LLR) on individual halo stellar
mass (${\rm M}_{\rm star}$) and hot gas mass (${\rm M}_{\rm gas}$) as a
function of total halo mass (${\rm M}_{\rm halo}$). We find that: 1) both the
local slope and variance of the MPRs run with mass (primarily) and redshift
(secondarily); 2) the conditional likelihood, $p({\rm M}_{\rm star},\ {\rm
M}_{\rm gas} | \ {\rm M}_{\rm halo}, z)$ is accurately described by a
multivariate, log-normal distribution, and; 3) the covariance of ${\rm M}_{\rm
star}$ and ${\rm M}_{\rm gas}$ at fixed ${\rm M}_{\rm halo}$ is generally
negative, reflecting a partially closed baryon box model for high mass halos.
We validate the analytical population model of Evrard et al. (2014), finding
sub-percent accuracy in the log-mean halo mass selected at fixed property,
$\langle \ln {\rm M}_{\rm halo} | {\rm M}_{\rm gas} \rangle$ or $\langle \ln
{\rm M}_{\rm halo} | {\rm M}_{\rm star} \rangle$, when scale-dependent MPR
parameters are employed. This work highlights the potential importance of
allowing for running in the slope and scatter of MPRs when modeling cluster
counts for cosmological studies. We tabulate LLR fit parameters as a function
of halo mass at $z=0$, $0.5$ and 1 for two popular mass conventions.
