We introduce a recursive method for estimating a probability density subjec
t to constraints of unimodality or monotonicity. It uses an empirical estim
ate of the probability transform to construct a sequence of maps of a known
template, which satisfies the constraints. The algorithm may be employed w
ithout a smoothing step, in which case it produces step-function approximat
ions to the sampling density. More satisfactorily, a certain amount of smoo
thing may be interleaved between each recursion, in which case the estimate
is smooth. The amount of smoothing may be chosen using a standard cross-va
lidation algorithm. Unlike other methods for density estimation, however, t
he recursive approach is robust against variation of the amount of smoothin
g, and so choice of bandwidth is not critical.