A method of estimating a variety of curves by a sequence of piecewise
polynomials is proposed, motivated by a Bayesian model and an appropri
ate summary of the resulting posterior distribution. A joint distribut
ion is set up over both the number and the position of the knots defin
ing the piecewise polynomials. Throughout we use reversible jump Marko
v chain Monte Carlo methods to compute the posteriors. The methodology
has been successful in giving good estimates for 'smooth' functions (
i.e. continuous and differentiable) as well as functions which are not
differentiable, and perhaps not even continuous, at a finite number o
f points. The methodology is extended to deal with generalized additiv
e models.