Time series data structures and functions