Implementation of Hierarchical Pitman Yor processes