how to calculate mean of continuous series