A semi-Bayesian method for nonparametric density estimation