Skip to content

Seasonal time-series forecasting of power consumption using SARIMA, with full stationarity diagnostics, ACF/PACF analysis, and interpretable forecasts.

Notifications You must be signed in to change notification settings

ginzee/Time_Series_Forecasting_Power

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Power_Consumption_Forecasting — Seasonal Time-Series Modeling with SARIMA

Author: Sam Ginzburg
Email: [email protected]
Tech Stack: Python · Pandas · NumPy · Statsmodels · Matplotlib · Time Series Analysis · SARIMA


Business Problem & Motivation

Accurate short-term power consumption forecasting is critical for grid operators, utilities, and energy planners to ensure reliability, control costs, and anticipate demand spikes driven by daily human activity and seasonality.

This project demonstrates how a data analyst approaches real-world time-series forecasting, where data exhibits:

  • Strong intraday seasonality
  • Non-stationary trends
  • Structured noise and occasional outliers
  • The need for interpretability and diagnostic rigor, not just point forecasts

Rather than treating forecasting as a black-box exercise, this notebook emphasizes model selection logic, statistical validation, and transparency—skills that translate directly to production analytics and forecasting roles.


Project Scope

This project delivers an end-to-end time-series analysis and forecasting workflow that:

  • Explores raw power consumption data and underlying patterns
  • Diagnoses trend and seasonal structure using decomposition
  • Applies seasonal and regular differencing to achieve stationarity
  • Uses ACF / PACF diagnostics to guide model specification
  • Trains and evaluates a SARIMA model for short-horizon forecasting
  • Compares forecasts against actuals with uncertainty bounds
  • Communicates results visually and analytically

The scope is intentionally focused on methodological correctness and interpretability, not brute-force optimization.


Methods / Skills Demonstrated

This project highlights the following analytical and technical competencies:

  • Time-Series Analysis
    • Stationarity assessment
    • Seasonal decomposition (trend / seasonality / residuals)
    • Regular and seasonal differencing
  • Statistical Modeling
    • SARIMA model specification and fitting
    • ACF / PACF interpretation for AR & MA term selection
  • Model Diagnostics
    • Residual behavior analysis
    • Over-differencing avoidance
    • Forecast uncertainty interpretation
  • Python & Data Handling
    • Pandas time-indexed transformations
    • Numerical analysis with NumPy
  • Visualization & Communication
    • Clear, decision-oriented plots using Matplotlib
    • Side-by-side forecast vs. actual comparisons
  • Production-Minded Thinking
    • Rolling forecast windows
    • Explicit modeling assumptions and limitations

Key Analytical Steps

1. Exploratory Analysis & Decomposition

The original series exhibits strong daily seasonality and a slowly evolving trend. Seasonal decomposition cleanly separates these components, validating the need for a seasonal forecasting model.

Time Series Decomposition


2. Stationarity & Differencing Strategy

Seasonal differencing at lag = 24 removes the dominant intraday cycle. A single regular difference addresses remaining trend behavior without over-differencing.

After Seasonal Differencing (lag = 24)

ACF & PACF After Seasonal Differencing

After Seasonal + First Differencing

ACF & PACF After Seasonal + First Differencing

The final differenced series demonstrates stable mean and variance, confirming readiness for SARIMA modeling.


3. SARIMA Model Selection

Model parameters were selected based on diagnostic evidence, not trial-and-error:

  • Seasonal structure identified via autocorrelation at lag 24
  • Non-seasonal AR/MA terms guided by PACF and ACF cutoff behavior
  • Emphasis on parsimony and interpretability over overfitting

This mirrors how time-series models are justified in professional forecasting environments.


4. Forecasting & Evaluation

The trained SARIMA model generates short-term forecasts that closely track observed consumption, including peak and trough demand periods.

Zoomed-In Forecast vs. Actual (Filtered Residuals)

Zoomed SARIMA Forecast vs Actual

Full 1-Day Test Window Forecast

SARIMA Forecast vs Actual – 1 Day Window

Confidence intervals widen appropriately with forecast horizon, reflecting realistic uncertainty rather than overconfident point predictions.


Results

The final SARIMA model successfully:

  • Captures daily power consumption cycles with high fidelity
  • Produces stable short-horizon forecasts suitable for operational planning
  • Maintains interpretable parameters aligned with observed data behavior
  • Demonstrates disciplined time-series modeling best practices

This project highlights how a data analyst reasons through forecasting problems, not just how a model is fit.


Project Structure

Power_Consumption_Forecasting/
│
├── notebooks/
│   └── time_series_analysis.ipynb   # Full exploratory analysis & SARIMA modeling
├── data/
│   └── powerconsumption.csv
├── assets/
│   └── screenshots/                 # Optional visuals for README
├── requirements.txt
└── README.md

How to Run This Project

  1. Clone the repository

  2. Install dependencies:

pip install -r requirements.txt
  1. Open the notebook:
jupyter notebook notebooks/time_series_analysis.ipynb

Limitations

  • Forecasts are short-term and optimized for intraday horizons
  • External drivers (weather, holidays, macro events) are not explicitly modeled
  • Model is univariate by design to emphasize statistical clarity

Disclaimer

This project is intended for educational and analytical demonstration purposes only. It does not represent operational forecasting guidance for real-world energy systems.

About

Seasonal time-series forecasting of power consumption using SARIMA, with full stationarity diagnostics, ACF/PACF analysis, and interpretable forecasts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published