Quickly calculate statistics of a running stream of data