Machine Learning: A Probabilistic Perspective (Adaptive Computation and Machine Learning series)