  Since gamma-ray burst afterglows were first detected in 1997, the
relativistic fireball model has emerged as the leading theoretical explanation
of the afterglows. In this paper, we present a very general, Bayesian inference
formalism with which this, or any other, afterglow model can be tested, and
with which the parameter values of acceptable models can be constrained, given
the available photometry. However, before model comparison or parameter
estimation can be attempted, one must also consider the physical processes that
affect the afterglow as it propagates along the line of sight from the burst
source to the observer. Namely, how does extinction by dust, both in the host
galaxy and in our galaxy, and absorption by the Ly-alpha forest and by H I in
the host galaxy, change the intrinsic spectrum of the afterglow? Consequently,
we also present in this paper a very general, eight-parameter dust extinction
curve model, and a two-parameter model of the Ly-alpha forest flux deficit
versus redshift distribution. Using fitted extinction curves from Milky Way and
Magellanic Cloud lines of sight, and measurements of Ly-alpha forest flux
deficits from quasar absorption line systems, we construct a Bayesian prior
probability distribution that weights this additional, but necessary, parameter
space such that the volume of the solution space is reduced significantly, a
priori. Finally, we discuss the broad applicability of these results to the
modeling of light from all other extragalactic point sources, such as Type Ia
supernovae.
