We propose general procedures for posterior sampling from additive and gene
ralized additive models. The procedure is a stochastic generalization of th
e well-known backfitting algorithm for fitting additive models. One chooses
a linear operator ("smoother") for each predictor, and the algorithm requi
res only the application of the operator and its square root. The procedure
is general and modular, and we describe its application to nonparametric,
semiparametric and mixed models.