  Demographic studies of cosmic populations must contend with measurement
errors and selection effects. We survey some of the key ideas astronomers have
developed to deal with these complications, in the context of galaxy surveys
and the literature on corrections for Malmquist and Eddington bias. From the
perspective of modern statistics, such corrections arise naturally in the
context of multilevel models, particularly in Bayesian treatments of such
models: hierarchical Bayesian models. We survey some key lessons from
hierarchical Bayesian modeling, including shrinkage estimation, which is
closely related to traditional corrections devised by astronomers. We describe
a framework for hierarchical Bayesian modeling of cosmic populations, tailored
to features of astronomical surveys that are not typical of surveys in other
disciplines. This thinned latent marked point process framework accounts for
the tie between selection (detection) and measurement in astronomical surveys,
treating selection and measurement error effects in a self-consistent manner.
