  Astrometric surveys such as Gaia and LSST will measure parallaxes for
hundreds of millions of stars. Yet they will not measure a single distance.
Rather, a distance must be estimated from a parallax. In this didactic article,
I show that doing this is not trivial once the fractional parallax error is
larger than about 20%, which will be the case for about 80% of stars in the
Gaia catalogue. Estimating distances is an inference problem in which the use
of prior assumptions is unavoidable. I investigate the properties and
performance of various priors and examine their implications. A supposed
uninformative uniform prior in distance is shown to give very poor distance
estimates (large bias and variance). Any prior with a sharp cut-off at some
distance has similar problems. The choice of prior depends on the information
one has available - and is willing to use - concerning, for example, the survey
and the Galaxy. I demonstrate that a simple prior which decreases
asymptotically to zero at infinite distance has good performance, accommodates
non-positive parallaxes, and does not require a bias correction.
