Forecasting electricity demand 1 Forecasting medium- and long-term peak electricity demand Rob J Hyndman Business & Economic Forecasting Unit Forecasting electricity demand The problem We want to forecast the peak electricity demand in a half-hour period in ten years time. 2 Forecasting electricity demand The problem We want to forecast the peak electricity demand in a half-hour period in ten years time. We have ten years of half-hourly electricity data, temperature data and some economic and demographic data. 2 Forecasting electricity demand The problem We want to forecast the peak electricity demand in a half-hour period in ten years time. We have ten years of half-hourly electricity data, temperature data and some economic and demographic data. The location is South Australia: home to the most volatile electricity demand in the world. 2 Forecasting electricity demand The problem We want to forecast the peak electricity demand in a half-hour period in ten years time. We have ten years of half-hourly electricity data, temperature data and some economic and demographic data. The location is South Australia: home to the most volatile electricity demand in the world. 2 Forecasting electricity demand 2 The problem We want to forecast the peak electricity demand in a half-hour period in ten years time. We have ten years of half-hourly electricity data, temperature data and some economic and demographic data. The location is South Australia: home to the most volatile electricity demand in the world. Sounds impossible? Forecasting electricity demand Demand data Half-hourly demand data for South Australia from 1 July 1997 to 31 March 2007. Only data from November–March are shown. 3 Forecasting electricity demand 4 Demand data 2.0 1.5 1.0 SA demand (GW) 2.5 South Australian operational demand (summer 06/07) Nov 06 Dec 06 Jan 07 Feb 07 Mar 07 Half-hourly demand data for South Australia from 1 November 2006 to 31 March 2007. Forecasting electricity demand 5 Demand data 2.0 1.5 1.0 SA demand (GW) 2.5 SA demand (first 3 weeks of January 2007) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Half-hourly demand data for South Australia from 1–21 January 2007. Date in January Forecasting electricity demand 6 Demand boxplots ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Tue Wed Thu ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Fri Sat Sun ● ● ● ● ● ● ● 1.5 2.0 ● 1.0 Demand (GW) 2.5 3.0 Time: 12 midnight ● Mon Day of week Forecasting electricity demand 7 Temperature data Time: 12 midnight 2.0 1.5 1.0 Non−Olympic Demand (GW) 2.5 Workday Non−workday 10 20 Temperature (deg C) 30 40 Forecasting electricity demand Demand drivers calendar effects 8 Forecasting electricity demand Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals 8 Forecasting electricity demand Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals climate changes 8 Forecasting electricity demand Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals climate changes economic and demographic changes 8 Forecasting electricity demand Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals climate changes economic and demographic changes changing technology 8 Forecasting electricity demand Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals climate changes economic and demographic changes changing technology 8 Forecasting electricity demand Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals climate changes economic and demographic changes changing technology Modelling framework Semi-parametric additive models with correlated errors. 8 Forecasting electricity demand Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals climate changes economic and demographic changes changing technology Modelling framework Semi-parametric additive models with correlated errors. Each half-hour period modelled separately. 8 Forecasting electricity demand 8 Demand drivers calendar effects prevailing weather conditions (and the timing of those conditionals climate changes economic and demographic changes changing technology Modelling framework Semi-parametric additive models with correlated errors. Each half-hour period modelled separately. Variables selected to provide best out-of-sample predictions for 2005/06 summer. Forecasting electricity demand 9 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 yt,p denotes demand at time t (measured in half-hourly intervals) during period p, p = 1, . . . , 48; Forecasting electricity demand 9 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 yt,p denotes demand at time t (measured in half-hourly intervals) during period p, p = 1, . . . , 48; hp (t ) models all calendar effects; Forecasting electricity demand 9 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 yt,p denotes demand at time t (measured in half-hourly intervals) during period p, p = 1, . . . , 48; hp (t ) models all calendar effects; fp (w1,t , w2,t ) models all temperature effects where w1,t is a vector of recent temperatures at Kent Town and w2,t is a vector of recent temperatures at Adelaide airport; Forecasting electricity demand 9 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 yt,p denotes demand at time t (measured in half-hourly intervals) during period p, p = 1, . . . , 48; hp (t ) models all calendar effects; fp (w1,t , w2,t ) models all temperature effects where w1,t is a vector of recent temperatures at Kent Town and w2,t is a vector of recent temperatures at Adelaide airport; zj,t is a demographic or economic variable at time t Forecasting electricity demand 9 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 yt,p denotes demand at time t (measured in half-hourly intervals) during period p, p = 1, . . . , 48; hp (t ) models all calendar effects; fp (w1,t , w2,t ) models all temperature effects where w1,t is a vector of recent temperatures at Kent Town and w2,t is a vector of recent temperatures at Adelaide airport; zj,t is a demographic or economic variable at time t nt denotes the model error at time t. Forecasting electricity demand 10 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 hp (t ) includes handle annual, weekly and daily seasonal patterns as well as public holidays: hp (t ) = `p (t ) + αt,p + βt,p + γt,p + δt,p `p (t) is “time of summer” effect (a regression spline); Forecasting electricity demand 10 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 hp (t ) includes handle annual, weekly and daily seasonal patterns as well as public holidays: hp (t ) = `p (t ) + αt,p + βt,p + γt,p + δt,p `p (t) is “time of summer” effect (a regression spline); αt,p is day of week effect; Forecasting electricity demand 10 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 hp (t ) includes handle annual, weekly and daily seasonal patterns as well as public holidays: hp (t ) = `p (t ) + αt,p + βt,p + γt,p + δt,p `p (t) is “time of summer” effect (a regression spline); αt,p is day of week effect; βt,p is “holiday” effect; Forecasting electricity demand 10 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 hp (t ) includes handle annual, weekly and daily seasonal patterns as well as public holidays: hp (t ) = `p (t ) + αt,p + βt,p + γt,p + δt,p `p (t) is “time of summer” effect (a regression spline); αt,p is day of week effect; βt,p is “holiday” effect; γt,p New Year’s Eve effect; Forecasting electricity demand 10 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 hp (t ) includes handle annual, weekly and daily seasonal patterns as well as public holidays: hp (t ) = `p (t ) + αt,p + βt,p + γt,p + δt,p `p (t) is “time of summer” effect (a regression spline); αt,p is day of week effect; βt,p is “holiday” effect; γt,p New Year’s Eve effect; δt,p is millennium effect; Forecasting electricity demand 11 Fitted results (3pm) 0.4 0.2 −0.4 0 50 100 150 0.2 0.0 −0.4 Normal Day before Holiday Holiday Mon Tue Wed Thu Fri Day of week 0.4 Day of summer Effect on demand 0.0 Effect on demand 0.2 0.0 −0.4 Effect on demand 0.4 Time: 3:00 pm Day after Sat Sun Forecasting electricity demand 12 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 fp (w1,t , w2,t ) = 6 X fk,p (xt−k ) + gk,p (dt−k ) + qp (xt+ ) + rp (xt− ) + sp (x̄t ) k =0 + 6 X Fj,p (xt−48j ) + Gj,p (dt−48j ) j=1 xt is ave temp across sites at time t; Forecasting electricity demand 12 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 fp (w1,t , w2,t ) = 6 X fk,p (xt−k ) + gk,p (dt−k ) + qp (xt+ ) + rp (xt− ) + sp (x̄t ) k =0 + 6 X Fj,p (xt−48j ) + Gj,p (dt−48j ) j=1 xt is ave temp across sites at time t; dt is the temp difference between sites at time t; Forecasting electricity demand 12 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 fp (w1,t , w2,t ) = 6 X fk,p (xt−k ) + gk,p (dt−k ) + qp (xt+ ) + rp (xt− ) + sp (x̄t ) k =0 + 6 X Fj,p (xt−48j ) + Gj,p (dt−48j ) j=1 xt is ave temp across sites at time t; dt is the temp difference between sites at time t; xt+ is max of xt values in past 24 hours; Forecasting electricity demand 12 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 fp (w1,t , w2,t ) = 6 X fk,p (xt−k ) + gk,p (dt−k ) + qp (xt+ ) + rp (xt− ) + sp (x̄t ) k =0 + 6 X Fj,p (xt−48j ) + Gj,p (dt−48j ) j=1 xt is ave temp across sites at time t; dt is the temp difference between sites at time t; xt+ is max of xt values in past 24 hours; xt− is min of xt values in past 24 hours; Forecasting electricity demand 12 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 fp (w1,t , w2,t ) = 6 X fk,p (xt−k ) + gk,p (dt−k ) + qp (xt+ ) + rp (xt− ) + sp (x̄t ) k =0 + 6 X Fj,p (xt−48j ) + Gj,p (dt−48j ) j=1 xt is ave temp across sites at time t; dt is the temp difference between sites at time t; xt+ is max of xt values in past 24 hours; xt− is min of xt values in past 24 hours; x̄t is ave temp in past seven days. Forecasting electricity demand 12 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 fp (w1,t , w2,t ) = 6 X fk,p (xt−k ) + gk,p (dt−k ) + qp (xt+ ) + rp (xt− ) + sp (x̄t ) k =0 + 6 X Fj,p (xt−48j ) + Gj,p (dt−48j ) j=1 xt is ave temp across sites at time t; dt is the temp difference between sites at time t; xt+ is max of xt values in past 24 hours; xt− is min of xt values in past 24 hours; x̄t is ave temp in past seven days. Forecasting electricity demand 12 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 fp (w1,t , w2,t ) = 6 X fk,p (xt−k ) + gk,p (dt−k ) + qp (xt+ ) + rp (xt− ) + sp (x̄t ) k =0 + 6 X Fj,p (xt−48j ) + Gj,p (dt−48j ) j=1 xt is ave temp across sites at time t; dt is the temp difference between sites at time t; xt+ is max of xt values in past 24 hours; xt− is min of xt values in past 24 hours; x̄t is ave temp in past seven days. Each function is smooth and estimated using regression splines. −8 −4 0 0 Lag 5 temp differential 4 Lag 1 temp differential 5 −10 −10 25 −5 −5 0 Lag 6 temp differential 0 5 Previous max temp 35 Lag 2 temp differential 5 35 15 5 −10 −10 25 10 20 Lag 3 temp differential −5 −5 0 0 5 Lag 1 day temp differential 5 0.0 0.2 0.4 Effect on demand −0.4 25 0.0 0.2 0.4 Effect on demand 15 −0.4 0.0 0.2 0.4 Effect on demand −0.4 35 0.0 0.2 0.4 15 0.0 0.2 0.4 Lag 5 temperature Effect on demand 35 Effect on demand Lag 1 temperature −0.4 Last week average temp 25 −0.4 15 0.0 0.2 0.4 35 Effect on demand Lag 4 temperature 25 −0.4 0.0 0.2 0.4 Effect on demand −0.4 15 0.0 0.2 0.4 −5 35 Effect on demand 25 0.0 0.2 0.4 Effect on demand 0.0 0.2 0.4 Effect on demand −0.4 Temperature −0.4 15 −0.4 25 0.0 0.2 0.4 Effect on demand 15 −0.4 0.0 0.2 0.4 Effect on demand −0.4 25 0.0 0.2 0.4 0.0 0.2 0.4 Effect on demand −0.4 15 −0.4 Effect on demand 0.0 0.2 0.4 Effect on demand −0.4 0.0 0.2 0.4 0.0 0.2 0.4 −0.4 0.0 0.2 0.4 Effect on demand −0.4 Effect on demand −0.4 Effect on demand 0.0 0.2 0.4 Effect on demand −0.4 Forecasting electricity demand 13 Fitted results (3pm) Time: 3:00 pm Lag 2 temperature 35 15 Lag 3 temperature Lag 1 day temperature 35 15 Previous min temp 30 −10 −8 25 −5 −4 35 Lag 2 day temperature 25 35 Temperature differential 0 0 5 Lag 4 temp differential 4 Forecasting electricity demand 14 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 Other variables described by linear relationships with coefficients c1 , . . . , cJ . Forecasting electricity demand 14 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 Other variables described by linear relationships with coefficients c1 , . . . , cJ . Estimation based on annual data. Forecasting electricity demand 14 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 Other variables described by linear relationships with coefficients c1 , . . . , cJ . Estimation based on annual data. Forecasting electricity demand 14 Equations log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 Other variables described by linear relationships with coefficients c1 , . . . , cJ . Estimation based on annual data. Variable Intercept Gross State Product Lag Price Cooling Degree Days Coefficient −0.13981 0.01684 −0.04957 0.36300 Std. Error 0.04338 0.00108 0.00727 0.01716 t value −3.222 15.649 −6.818 21.157 P value 0.018094 0.000004 0.000488 0.000001 Forecasting electricity demand 15 Actual Fitted 1.45 1.40 1.35 1.30 1.25 Annual demand 1.50 1.55 Predictions 1998 2000 2002 Year 2004 2006 Forecasting electricity demand 15 Predictions 80 75 70 65 R−squared (%) 85 90 95 R−squared 12 midnight 3:00 am 6:00 am 9:00 am 12 noon Time of day 3:00 pm 6:00 pm 9:00 pm 12 midnight Forecasting electricity demand 15 Predictions 1.0 1.5 2.0 2.5 3.0 Actual demand 1998 2000 2002 2004 2006 Time 1.0 1.5 2.0 2.5 3.0 Predicted demand 1998 2000 2002 2004 2006 Forecasting electricity demand 15 2.0 1.5 1.0 Actual demand 2.5 3.0 Predictions 1.0 1.5 2.0 Predicted demand 2.5 3.0 Forecasting electricity demand 16 Peak demand forecasting log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 Multiple alternative futures created by resampling residuals using a seasonal bootstrap; Forecasting electricity demand 16 Peak demand forecasting log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 Multiple alternative futures created by resampling residuals using a seasonal bootstrap; generating simulations of future temperature patterns based on seasonally bootstrapping past temperatures (with some adjustment for extremes and climate change); Forecasting electricity demand 16 Peak demand forecasting log(yt,p ) = hp (t ) + fp (w1,t , w2,t ) + J X cj zj,t + nt j =1 Multiple alternative futures created by resampling residuals using a seasonal bootstrap; generating simulations of future temperature patterns based on seasonally bootstrapping past temperatures (with some adjustment for extremes and climate change); using assumed values for GSP and Price. Forecasting electricity demand 17 Peak demand distribution Demand 1.4 Base 0.8 0.6 0.2 0.4 Density 1.0 1.2 2007/2008 2008/2009 2009/2010 2010/2011 2011/2012 2012/2013 2013/2014 2014/2015 2015/2016 2016/2017 2017/2018 W)5 6 0.0 5 1 2 3 Demand (GW) 4 5 Forecasting electricity demand 17 Peak demand distribution Annual maximum Base demand 1.0 0.5 Density 1.5 2007/2008 2008/2009 2009/2010 2010/2011 2011/2012 2012/2013 2013/2014 2014/2015 2015/2016 2016/2017 2017/2018 W)6 6 0.0 5 3 4 5 Demand (GW) 6 Forecasting electricity demand 17 3.0 3.5 4.0 90% 50% 10% 2% ● ● ● ● ● ● ● 2.5 Prob of exceedance in one year Peak demand distribution ● ● ● 2000 2005 2010 Year 2015 Forecasting electricity demand Conclusions We have forecast the extreme upper tail in ten years time using only ten years of data! 18 Forecasting electricity demand Conclusions We have forecast the extreme upper tail in ten years time using only ten years of data! This method has now been adopted for the official South Australian peak electricity demand forecasts. 18 Forecasting electricity demand Conclusions We have forecast the extreme upper tail in ten years time using only ten years of data! This method has now been adopted for the official South Australian peak electricity demand forecasts. We hope to extend method to Victoria in next year. 18 Forecasting electricity demand Conclusions We have forecast the extreme upper tail in ten years time using only ten years of data! This method has now been adopted for the official South Australian peak electricity demand forecasts. We hope to extend method to Victoria in next year. Method could also be used for short-term demand forecasting, if we add a model for correlated residuals. 18 Forecasting electricity demand Conclusions We have forecast the extreme upper tail in ten years time using only ten years of data! This method has now been adopted for the official South Australian peak electricity demand forecasts. We hope to extend method to Victoria in next year. Method could also be used for short-term demand forecasting, if we add a model for correlated residuals. Provides way to analyse probability of coincident peaks across different interconnected markets. 18 Forecasting electricity demand Conclusions We have forecast the extreme upper tail in ten years time using only ten years of data! This method has now been adopted for the official South Australian peak electricity demand forecasts. We hope to extend method to Victoria in next year. Method could also be used for short-term demand forecasting, if we add a model for correlated residuals. Provides way to analyse probability of coincident peaks across different interconnected markets. Could be extended to whole year, providing probabilistic forecasts of total energy requirements. 18 Forecasting electricity demand Conclusions We have forecast the extreme upper tail in ten years time using only ten years of data! This method has now been adopted for the official South Australian peak electricity demand forecasts. We hope to extend method to Victoria in next year. Method could also be used for short-term demand forecasting, if we add a model for correlated residuals. Provides way to analyse probability of coincident peaks across different interconnected markets. Could be extended to whole year, providing probabilistic forecasts of total energy requirements. An R package and a paper will (eventually) appear at www.robhyndman.info 18