How to obtain mean and variance estimates of a sample using Bartlett kernels?