  We consider the problem of model selection type aggregation in the context of
density estimation. We first show that empirical risk minimization is
sub-optimal for this problem and it shares this property with the exponential
weights aggregate, empirical risk minimization over the convex hull of the
dictionary functions, and all selectors. Using a penalty inspired by recent
works on the $Q$-aggregation procedure, we derive a sharp oracle inequality in
deviation under a simple boundedness assumption and we show that the rate is
optimal in a minimax sense. Unlike the procedures based on exponential weights,
this estimator is fully adaptive under the uniform prior. In particular, its
construction does not rely on the sup-norm of the unknown density. By providing
lower bounds with exponential tails, we show that the deviation term appearing
in the sharp oracle inequalities cannot be improved.
