Work done for the graphical models course of David Blei taken at Columbia University in 2014