Text this: Optimal thinning of MCMC output