LogLikelihood and LogPosterior are consistent between C++ and Matlab code