Time Series
8.1 Time Series and Key Concepts
Time series analysis is a technique for analyzing and forecasting data collected sequentially over time.
Key Concepts:
- Trend: Long-term movement in data.
- Seasonality: Regular patterns at fixed intervals.
- Cyclic Patterns: Long-term fluctuations without fixed periodicity.
- Stationarity: Constant mean and variance over time.
- Autocorrelation: Correlation of data points with past values.
- Noise: Random variations.
8.2 ARIMA, SARIMA, and Seasonal Decomposition
ARIMA (AutoRegressive Integrated Moving Average)
ARIMA consists of three components:
- AR: Uses past values.
- I: Differencing to remove trends.
- MA: Uses past errors.
SARIMA (Seasonal ARIMA)
Handles seasonality with additional parameters (P, D, Q, m).
Seasonal Decomposition
- Trend: Long-term direction.
- Seasonal: Recurring patterns.
- Residual: Irregular fluctuations.
8.3 Forecasting Models and Applications in Business
Forecasting Methods:
- Naïve Method: Uses the last observed value.
- Moving Average: Averages past 'n' values.
- Exponential Smoothing: Assigns more weight to recent values.
- ARIMA & SARIMA: Statistical models.
- LSTM: Deep learning model.
Business Applications:
- Retail Sales Forecasting
- Stock Market Predictions
- Demand Forecasting
- Energy Consumption Forecasting
8.4 Evaluating Time Series Models
Evaluation Metrics:
- Mean Absolute Error (MAE)
- Mean Squared Error (MSE)
- Root Mean Squared Error (RMSE)
- Mean Absolute Percentage Error (MAPE)
- AIC & BIC: Model selection criteria.
Residual Analysis:
- Should be normally distributed.
- Should have no autocorrelation.
- Should have constant variance.
Interactive Features: Real-World Time Series Modeling
Example Datasets:
- Stock Market Data
- Retail Sales Data
- Airline Passenger Data
- Plot and decompose time series data.
- Train ARIMA/SARIMA models.
- Forecast future values.
- Evaluate models using metrics.
Conclusion
Time series analysis is essential for forecasting in finance, business, and technology. Using ARIMA, SARIMA, and deep learning, we can make data-driven decisions.