A transparent model for learning in volatile environments