Methods for computing spatial, temporal, and spatiotemporal statistics