Ensemble-based data assimilation for the climate of the past millennium