computes kernel values only once for doing both statistic and variance estimation at once.