Bayesian analysis of blinking and bleaching