Given an i.i.d. sample X1, …, Xn with common bounded density f0 belonging to a Sobolev space of order α over the real line, estimation of the quadratic functional ∫ℝf02(x) dx is considered. It is shown that the simplest kernel-based plug-in estimator
¶
\[\frac{2}{n(n-1)h_{n}}\sum_{1\leq i\textless j\leq n}K\biggl(\frac {X_{i}-X_{j}}{h_{n}}\biggr)\]
¶
is asymptotically efficient if α>1/4 and rate-optimal if α≤1/4. A data-driven rule to choose the bandwidth hn is then proposed, which does not depend on prior knowledge of α, so that the corresponding estimator is rate-adaptive for α≤1/4 and asymptotically efficient if α>1/4.