  Powerful current and future cosmological constraints using high precision
measurements of the large-scale structure of galaxies and its weak
gravitational lensing effects rely on accurate characterization of the redshift
distributions of the galaxy samples using only broadband imaging. We present a
framework for constraining both the redshift probability distributions of
galaxy populations and the redshifts of their individual members. We use a
hierarchical Bayesian model (HBM) which provides full posterior distributions
on those redshift probability distributions, and, for the first time, we show
how to combine survey photometry of single galaxies and the information
contained in the galaxy clustering against a well-characterized tracer
population in a robust way. One critical approximation turns the HBM into a
system amenable to efficient Gibbs sampling. We show that in the absence of
photometric information, this method reduces to commonly used clustering
redshift estimators. Using a simple model system, we show how the incorporation
of clustering information with photo-$z$'s tightens redshift posteriors, and
can overcome biases or gaps in the coverage of a spectroscopic prior. The
method enables the full propagation of redshift uncertainties into cosmological
analyses, and uses all the information at hand to reduce those uncertainties
and associated potential biases.
