Sample size adaptation for particle filters