1. Definition
- Time Series = data points collected or recorded in time order (usually equally spaced).
- Formally:
$Y_t, \; t = 1, 2, \dots, T$
where $Y_t$ is the observation at time $t$.
- Key feature: order matters. Unlike regular tabular data, the sequence in time is crucial.
2. Examples
- Finance: stock prices recorded daily
- Economics: monthly unemployment rates, GDP growth
- Weather: hourly temperature, daily rainfall
- IoT / Sensors: electricity consumption every 15 minutes
- Healthcare: heart rate over time
3. Components of a Time Series
Typical time series can be decomposed into:
- Trend
- Long-term increase or decrease.
- Example: gradual upward trend in housing prices.
- Seasonality
- Regular, repeating patterns within fixed periods (day, week, year).
- Example: retail sales spike every December.
- Cyclic patterns
- Fluctuations that are not of fixed length (business cycles, economic expansions/recessions).
- Noise
- Random variation not explained by trend/seasonality.
4. Types of Time Series
- Univariate: only one variable over time (e.g., daily sales).
- Multivariate: multiple variables measured together over time (e.g., sales + temperature + promotion spend).
- Stationary: mean/variance constant over time, no trend/seasonality.
- Non-stationary: mean/variance changes (common in real-world data).
5. Modeling Approaches
- Classical Statistical Models
- AR (AutoRegressive)
- MA (Moving Average)
- ARMA / ARIMA (AutoRegressive Integrated Moving Average)
- SARIMA (Seasonal ARIMA)
- Exponential Smoothing (Holt-Winters)
- Modern ML/DL Models
- Random Forest, XGBoost (applied to lag features)
- RNN (Recurrent Neural Networks), LSTM, GRU
- Temporal Convolutional Networks (TCN)
- Transformers for Time Series (e.g., Informer, TimesNet)
6. Forecasting vs Analysis
- Forecasting: predicting future values (e.g., tomorrow’s temperature).
- Analysis: understanding structure, correlations, anomalies (e.g., trend detection, anomaly detection in sensor data).
7. Evaluation Metrics
Common metrics used for time series forecasting:
- MAE (Mean Absolute Error)
- MSE (Mean Squared Error)
- RMSE (Root MSE)
- MAPE (Mean Absolute Percentage Error)
- WAPE (Weighted Absolute Percentage Error)
- sMAPE (Symmetric MAPE)
8. Unique Challenges in Time Series
- Autocorrelation: past values influence future values.
- Non-stationarity: data properties (mean, variance) change over time.
- Seasonality & Trend: models must capture repeating patterns.
- Temporal dependency: train-test splits must respect time order (no future data leakage).
- High dimensionality: multivariate series can be complex (e.g., multiple sensors).
Summary
- A Time Series is data recorded sequentially over time.
- Has components: trend, seasonality, cycles, noise.
- Can be modeled using classical (ARIMA, Holt-Winters) or modern ML/DL methods (LSTM, Transformers).
- Used for forecasting (future values) and analysis (patterns, anomalies).
- Must handle autocorrelation, non-stationarity, temporal splits carefully.
