Weighted likelihood in Bayesian inference