Sensory adaptation as Kalman filtering: theory and illustration with