Nonparametric Estimation of Probability Densities and Regression Curves