Non-Parametric Bayesian Inference Algorithm