Deterministic and stochastic aspects of data assimilation