implemented bayesian filter training