With ideal spatial adaptation, an oracle furnishes information about h
ow best to adapt a spatially variable estimator, whether piecewise con
stant, piecewise polynomial, variable knot spline, or variable bandwid
th kernel, to the unknown function. Estimation with the aid of an orac
le offers dramatic advantages over traditional linear estimation by no
nadaptive kernels; however, it is a priori unclear whether such perfor
mance can be obtained by a procedure relying on the data alone, We des
cribe a new principle for spatially-adaptive estimation: selective wav
elet reconstruction. We show that variable-knot spline fits and piecew
ise-polynomial fits, when equipped with an oracle to select the knots,
are not dramatically more powerful than selective wavelet reconstruct
ion with an oracle. We develop a practical spatially adaptive method,
RiskShrink, which works by shrinkage of empirical wavelet coefficients
. RiskShrink mimics the performance of an oracle for selective wavelet
reconstruction as well as it is possible to do so. A new inequality i
n multivariate normal decision theory which we call the oracle inequal
ity shows that attained performance differs from ideal performance by
at most a factor of approximately 2 log n, where n is the sample size.
Moreover no estimator can give a better guarantee than this. Within t
he class of spatially adaptive procedures, RiskShrink is essentially o
ptimal. Relying only on the data, it comes within a factor log(2) n of
the performance of piecewise polynomial and variable-knot spline meth
ods equipped with an oracle. In contrast, it is unknown how or if piec
ewise polynomial methods could be made to function this well when deni
ed access to an oracle and forced to rely on data alone.