Estimating within-field variation using a nonparametric density algorithm