This code is a part of my PhD dissertation and includes a C++ implementation of Hierarchical Dirichlet Process Hidden Markov Model or HDPHMM(Fox et al.,2011) and Doubly Hierarchical Dirichlet Process Hidden markov model or DHDPHMM (Harati et al.,2014,2015,2016). It also can be used to implement DPM and HDP. For more details about DHDPHMM look at: http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=7328698&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D7328698