Adaptive quadratic functional estimation of a weighted density by model selection