  We give an analytical form for the weighted correlation function of peaks in
a Gaussian random field. In a cosmological context, this approach strictly
describes the formation bias and is the main result here. Nevertheless, we show
its validity and applicability to the evolved cosmological density field and
halo field, using Gaussian random field realisations and dark matter N-body
numerical simulations. Using this result from peak theory we compute the bias
of peaks (and dark matter halos) and show that it reproduces results from the
simulations at the ${\mathcal O}(10\%)$ level. Our analytical formula for the
bias predicts a scale-dependent bias with two characteristics: a broad band
shape which, however, is most affected by the choice of weighting scheme and
evolution bias, and a more robust, narrow feature localised at the BAO scale,
an effect that is confirmed in simulations. This scale-dependent bias smooths
the BAO feature but, conveniently, does not move it. We provide a simple
analytic formula to describe this effect. We envision that our analytic
solution will be of use for galaxy surveys that exploit galaxy clustering.
