add gibbs sampling method code