How Recent History Affects Perception: The Normative Approach and Its Heuristic Approximation