Skip to content

Repository files navigation

Modelling Peak Electricity Demand in Great Britain

Modelled peak daily electricity demand in Great Britain for the National Grid Electricity System Operator (NESO), using linear regression on temporal and meteorological variables across winter periods (1st Nov - 31st Mar) from 1991 to 2013.

Result: demand model achieved an adjusted-R2 of 0.9516, with a year effect, temperature (TE), day-count since November, and day-of-week all statistically significant predictors (p < 2e-16). Used the model to forecast a distribution of maximum winter demand for 2013/14 under two independent scenario methods, obtaining consistent 95% forecast intervals of roughly 54,500-56,900 MW.

Collaborative project with George Boutselis and Mahee Rathod. Full report found as Modelling Peak Electricity Demand in Great Britain.pdf.


Approach

  • Cleaned the dataset by excluding atypical periods (Christmas/New Year, British Summer Time) where peak demand was highly improbable, reducing 3,479 observations to 3,182
  • Fit a linear regression relating demand to a categorical "year effect", days since 1st November (linear + quadratic), a temperature variable (TE), and day-of-week indicators (Friday, Weekend)
  • Validated the model with residual diagnostics (homoskedasticity, Q-Q normality, autocorrelation, Cook's distance) and ANOVA/t-tests confirming all included variables were statistically significant
  • Tested whether hourly temperature data could improve on the single TE variable — found only marginal R2 improvement at the cost of multicollinearity risk and interpretability, so kept TE
  • Ran two independent scenario analyses to forecast the distribution of maximum winter 2013/14 demand: (1) replaying each historical winter's actual temperatures through the model, and (2) simulating 5,000 synthetic winters from a fitted autoregressive temperature model
  • Both scenario methods converged on a similar 95% forecast interval, cross-validating the approach

Repository

src/      - data cleaning, model fitting, temperature analysis, scenario simulation
data/     - SCS demand and hourly temperature datasets
plots/    - diagnostic and results plots used in the report

src:

  1. functions.R

    • Shared helper functions used across scripts (e.g. splitting data into GMT/BST periods, rescaling year-effect coefficients).
  2. EDA.R

    • Exploratory analysis of demand against day of week, month, and winter year.
    • Produces the boxplots and scatterplots (demand vs. TE, demand vs. days-since-November) used to motivate the model structure.
  3. ModelFit.R

    • Cleans the dataset (drops BST observations and the Christmas/New Year period).
    • Fits the main demand regression model (year effect, DSN, DSN squared, TE, Friday, Weekend).
    • Produces residual diagnostics: residuals vs. fitted, scale-location, Q-Q, leverage, and autocorrelation plots.
  4. TE.R

    • Investigates the temperature variable TE as a predictor, comparing it against a 24-hourly-temperature model and other alternative temperature measures.
    • Confirms TE as the preferred predictor on grounds of comparable fit, lower AIC, and better interpretability.
  5. simulation.R

    • Fits an autoregressive model for daily temperature (TO), with sinusoidal seasonal terms.
    • Generates 5,000 synthetic winters from the fitted temperature model and predicts maximum winter 2013/14 demand under each (scenario method 2).
  6. Slicing Simulator.R

    • Implements scenario method 1: resamples historical winters' temperature data into the demand model to build a forecast distribution of maximum 2013/14 demand conditional on past weather.
  7. NesoModel.R

    • Exploratory comparison against NESO's own published Average Cold Spell (ACS) methodology for demand forecasting.

data:

  1. SCS_demand_modelling.csv

    • Daily demand data (1991-2013, winter periods only): gross electricity demand (MW), population-weighted temperature (temp), day-of-week and month indices, year, TO (3pm-6pm average temp), TE (temperature effect), and days since 1st November (DSN).
  2. SCS_hourly_temp.csv

    • Complete hourly British population-weighted average temperature from NASA MERRA1, 1991-2015 (219,144 observations), used to construct TE/TO and to test hourly-temperature model alternatives.

R Libraries Required

lubridate, dplyr, ggplot2, reshape2, gridExtra, tidyr, tidyverse, ggpubr, broom, stringr, ecostats, caTools


Generative AI use: Debugging code. Also used for grammar and spelling checks in the final checks of the report-writing.

About

Using linear regression models and generating simulated temperature data (using bootstrapping methods) to model peak electricity demand in the UK from 1991-2013. Collaborative project with Mahee Rathod and George Boutselis for Statistical Case Studies (MATH10102) at the University of Edinburgh. Awarded 79%.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages