addine a more general moving statistic function with four moments