octav/Matlab to R converion and Bayesian nonparameteric ML