  We prove oracle inequalities for a penalized log-likelihood criterion that
hold even if the data are not independent and not stationary, based on a
martingale approach. The assumptions are checked for various contexts: density
estimation with independent and identically distributed (i.i.d) data, hidden
Markov models, spiking neural networks, adversarial bandits. In each case, we
compare our results to the literature, showing that, although we lose some
logarithmic factors in the most classical case (i.i.d.), these results are
comparable or more general than the existing results in the more dependent
cases.
