What is demand forecasting?

Introduction

Project introduction

What is demand forecasting?

Electricity is hard to store in large amounts, so a power grid has to produce almost exactly as much as its customers use at every moment. Grid operators and energy suppliers therefore forecast demand, the total power their customers draw, for every hour of the next day, and decide from that forecast which power stations to run and how much energy to buy.

Demand is measured in megawatts (MW), and one megawatt is a million watts, the power of ten thousand 100 watt light bulbs. In this project you forecast the combined demand of 316 customers in Portugal, recorded every hour from 2012 to 2014. The data was published by Artur Trindade on the UCI Machine Learning Repository under the CC BY 4.0 licence. Every forecast you make covers the next 24 hours.

Why is it both easy and hard?

Demand follows people, and people keep routines. In this data the average hour rises from about 100 MW at 4 in the morning to about 275 MW in the early evening, and every day repeats that shape. Pick a day in the chart and compare the dashed line, which simply copies the day before, with what happened. Copying yesterday is already a strong forecast, so much of the work is measuring how much better a model can do than that copy.

The hard part is testing a forecast honestly. A forecaster only ever knows the past, but common ways of testing models mix hours from after the forecast into the training data. You will see one model look as good as the best model in the project under that kind of test, and fall to barely better than copying yesterday once it is tested only on hours that come after everything it learned from.

Forecast the next 24 hours

June 2014, hourly
100150200250now2 days ago+24 h
demand in MWcopy yesterday, off by 5.5 MWlinear model on lags, off by 3 MW
Baselinescopy the last cycle
MASEerror on one scale
Lag rowspast hours as inputs
Modelslinear and a network
Walk forwardtest in time order

What you will build

01

Baselines

Write the seasonal naive forecast and score forecasts with MAE and MASE, an error measure without units.

02

Models

Turn the series into rows of past hours without leaking the future, then fit a linear model and forecast a day one hour at a time.

03

Honest testing

Split time into walk-forward folds and see what shuffled cross-validation hides.

Start with a baseline

Copy the last cycle forward and see how far that alone gets you.

Continue to Problem 1