Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.
74,458 characters · 18 sections · 76 citation commands
The impact of online machine-learning methods on long-term investment decisions and generator utilization in electricity markets
The integration of higher proportions of intermittent renewable energy sources (IRES) in the electricity grid will mean that the forecasting of electricity supply and demand will become increasingly challenging \footnote{Matching of supply and demand will be referenced as demand from this point onwards for brevity.}. Examples of IRES are solar panels and wind turbines. These fluctuate in terms of power output based on localized wind speed and solar irradiance. As supply must meet demand at all times and the fact that IRES are less predictable than dispatchable energy sources such as coal and combined-cycle gas turbines (CCGTs), extra attention must be made in predicting future demand if we wish to keep, or reduce, the current frequency of blackouts Lu1993. A dispatchable source is one that can be turned on and off by human control and is able to adjust output just in time at a moment convenient for the grid.
Typically, peaker plants, such as reciprocal gas engines, are used to fill fluctuations in demand that had not been previously planned for. Peaker plants meet the peaks in demand when other cheaper options are at full capacity. Current peaker plants are expensive to run and have higher greenhouse gas emissions than their non-peaker counterparts. Whilst peaker plants are also dispatchable plants, not all dispatchable plants are peaker plants. For example coal, which is a dispatchable plant, is run as a base load plant, due to its inability to deal with fluctuating conditions.
To reduce reliance on peaker plants, it is helpful to know how much electricity demand there will be in the future so that more efficient plants can be used to meet this expected demand. This is so that these more efficient plants can be brought up to speed at a time suitable to match the demand. Forecasting a day into the future is especially useful in decentralized electricity markets which have day-ahead markets. Decentralized electricity markets are ones where electricity is provided by multiple generation companies, as opposed to a centralized source, such as a government. To aid in this prediction, machine learning and statistical techniques have been used to accurately predict demand based on several different factors and data sources Kell2018a, such as weather Hong2014, day of the week Al-Musaylh2018 and holidays Vrablecova2017.
Various studies have looked at predicting electricity demand at various horizons, such as short-term Huang2003 and long-term studies Andersen2013. However, the impact of poor demand predictions on the long-term electricity mix has been studied to a lesser degree.
In this paper, we compare several machine learning and statistical techniques to predict the energy demand for each hour over the next 24-hour horizon. We chose to predict over the next 24 hours to simulate a day-ahead market, which is often seen in decentralized electricity markets. However, our approach could be utilized for differing time horizons. In addition to this, we use our long-term agent-based model, ElecSim Kell, Kell2020, to simulate the impact of different forecasting methods on long-term investments, power plant usage and carbon emissions between 2018 and 2035 in the United Kingdom. Our approach, however, is generalizable to any country through parametrization of the ElecSim model.
Within energy modelling different methodologies are undertaken to understand how an energy system may develop. In this paper we used an agent-based model (ABM). An other approach is the use of optimization based models. Optimization based models develop scenarios into the future by finding a cost-optimal solution. These models rely on perfect information of the future, assume that there is a central planner within an energy market and are solved in a normative manner. That is, how a problem should be solved under a specific scenario. Agent-based models on the other hand can assume imperfect information and allows a scenario to develop. We believe that ABMs closely match real-life in decentralised electricity markets.
As part of our work, we utilize online learning methods to improve the accuracy of our predictions. Online learning methods can learn from novel data while maintaining what was learnt from previous data. Online learning is useful for non-stationary datasets, and time-series data where recalculation of the algorithm would take a prohibitive amount of time. Offline learning methods must be retrained every time new data is added. Online approaches are constantly updated and do not require significant pauses.
We trial different learning algorithms for different times of the year. Specifically, we train different algorithms for the different seasons. We also split weekdays and train both weekends and holidays together. This is due to the fact that holidays and weekends exhibit similar load profiles due to the reduction in industrial electricity use and an increase in domestic use. This enables an algorithm to become good at a specific subset of the data which share similar patterns, as opposed to having to generalize to all of the data. Examples of the algorithms used are linear regression, lasso regression, random forests, support vector regression, multilayer perceptron neural network and the box-cox transformation.
We expect a-priori that online algorithms will outperform the offline approach. This is due to the fact that the demand time-series is non-stationary, and thus changes sufficiently over time. In terms of the algorithms, we presume that the machine learning algorithms, such as neural networks, support vector regression and random forests will outperform the statistical methods such as linear regression, lasso regression and box-cox transformation regression. This is due to the fact that machine learning has been shown to be able to learn more complex feature representations than statistical methods Singh2012. In addition, our previous work has shown that the random forest was able to outperform neural networks and support vector regression Kell2018.
It should be noted, that such a-priori intuition, is no substitute for analytical evidence and can (and has) been shown to be wrong in the past, due to imperfect knowledge of the data and understanding of some of the black box algorithms, such as neural networks.
Using online and offline methods, we take the error distributions, or residuals, and fit a variety of distributions to these residuals. We choose the distribution with the lowest sum of squared estimate of errors (SSE). SSE was chosen as the metric to ensure that both positive and negative errors were treated equally, as well as ensuring that large errors were penalized more than smaller errors. We fit over 80 different distributions, which include the Johnson Bounded distribution, the uniform distribution and the gamma distribution. The distribution that best fits the respective residuals is then used and sampled from to adjust the demand in the ElecSim model. We then observe the differences in carbon emissions, and which types of power plants were both invested in and utilized, with each of the different statistical and machine learning methods. To the best of our knowledge, this is the most comprehensive evaluation of online learning techniques to the application of day-ahead load forecasting as well as assessing the impacts of the errors that these algorithms produce on the long-term electricity market dynamics.
We show that online learning has a significant impact on reducing the error for predicting electricity consumption a day ahead when compared to traditional offline learning techniques, such as multilayer perceptron artificial neural networks, linear regression, extra trees regression and support vector regression, which are algorithms used in the literature Lu1993, Ahmad2017, Chen2004.
We show that the forecasting algorithm has a non-negligible impact on carbon emissions and use of coal, onshore, photovoltaics (PV), reciprocal gas engines and CCGT. Specifically, the amount of coal, PV, and reciprocal gas used from 2018 to 2035 was proportional to the median absolute error, while wind is inversely proportional to the median absolute error.
Total investments in coal, offshore and photovoltaics are proportional to the median absolute error, while investments in CCGT, onshore and reciprocal gas engines are inversely proportional.
In this work, we make the following contributions:
In Section (ref), we review the literature. We introduce the dynamics of the ElecSim simulation as well as the methods used in Section (ref). We demonstrate the methodology undertaken in Section (ref). In Section (ref) we demonstrate our results, followed by a discussion in Section (ref). We conclude our work in Section (ref).
Multiple papers have looked at demand-side forecasting Singh2012. These include both artificial intelligence Kim2000, Tiong2008,Quilumba2014 and statistical techniques Huang2003,Nguyen2017. In addition to this, our research models the impact of the performance of different algorithms on investments made, electricity sources dispatched and carbon emissions over a 17 year period. To model this, we use the long-term electricity market agent-based model, ElecSim Kell2020.
Multiple electricity demand forecasting studies have been undertaken for offline learning Chen2004, Gross1987, Ghofrani. Studies have been undertaken using both smart meter data, as well as with aggregated demand, similar to the work in this paper. Smart meters are a type of energy meter installed in each house, which monitor electricity usage at short intervals, such as every 15 or 30 minutes. All of the papers reviews in this subsection focus on offline learning, as opposed to online learning like in this work. Additionally, we look at the long-term impact of poor predictions on the electricity market.
Fard et al. propose a new hybrid forecasting method based on the wavelet transform, autoregressive integrated moving average (ARIMA) and artificial neural network (ANN) Fard2014. The ARIMA method is utilized to capture the linear component of the time series, with the residuals containing the non-linear components. The non-linear parts are decomposed using the discrete wavelet transform which finds the sub-frequencies. These residuals are then used to train an ANN to predict the future residuals. The ARIMA and ANNs outputs are then summed. Their results show that this technique can improve forecasting results.
Humeau et al. compare MLPs, SVRs and linear regression at forecasting smart meter data Humeau2013. They aggregate different households and observe which algorithms work the best. They find that linear regression outperforms both MLP and SVR when forecasting individual households. However, after aggregating over 32 households, SVR outperforms linear regression.
Quilumba et al. also apply machine learning techniques to individual households' electricity consumption by aggregation Fard2014. To achieve this aggregation, they use k-means clustering to aggregate the households to improve their forecasting ability. The authors also use a neural network based algorithm for forecasting, and show that the number of optimum clusters for forecasting is dependent on the data, with three clusters optimal for a particular dataset, and four for another.
In our previous work, we evaluate the performance of ANNs, random forests, support vector regression and long short-term memory neural networks Kell2018a. We utilize smart meter data, and cluster by household using the k-means clustering algorithm to aggregate groups of demand. Through this clustering we are able to reduce the error, with the random forest performing the best.
There have been several studies in diverse applications on the use of online machine learning to predict time-series data, however, to the best of our knowledge there are limited examples where this is applied to electricity markets. In our work, we trial a range of algorithms to our problem. Due to time constraints, we do not trial the additional techniques discussed in this literature review within our paper.
Johansson et al. apply online machine learning algorithms for heat demand forecasting Johansson2017. They find that their demand predictions display robust behaviour within acceptable error margins. They find that artificial neural networks (ANNs) provide the best forecasting ability of the standard algorithms and can handle data outside of the training set. Johansson et al., however, do not look at the long-term effects of different algorithms, which is a central part to this work.
Baram et al. combine an ensemble of active learners by developing an active-learning master algorithm Baram2003. To achieve this, they propose a simple maximum entropy criterion that provides effective estimates in realistic settings. Their active-learning master algorithm is shown to, in some cases, outperform the best algorithm in the ensemble on a range of classification problems.
Schmitt et al also extends on existing algorithms through an extension of the FLORA algorithm in Schmitt2008, Widmer1996. The FLORA algorithm generates a rule-based algorithm, which has the ability to make binary decisions. Their FLORA-MC enhances the FLORA algorithm for multi-classification and numerical input values. They use this algorithm for an ambient computing application. Ambient computing is where computing and communication merges into everyday life. They find that their algorithm outperforms traditional offline learners. Our work focuses on electricity demand, however.
Similarly to us, Pindoriya et al. trial several different machine learning methods such as adaptive wavelet neural network (AWNN) for predicting electricity price forecasting Pindoriya2008. They find that AWNN has good prediction properties when compared to other forecasting techniques such as wavelet-ARIMA, multilayer perceptron (MLP) and radial basis function (RBF) neural networks. We, however, focus on electricity demand.
Goncalves Da Silva et al. show the effect of prediction accuracy on local electricity markets GoncalvesDaSilva2014. They compare forecasting of groups of consumers. They trial the use of the Seasonal-Naïve and Holt-Winters algorithms and look at the effect that the errors have on trading in an intra-day electricity market of consumers and prosumers. They found that with a photovoltaic penetration of 50%, over 10% of the total generation capacity was uncapitalized and roughly 10, 25 and 28% of the total traded volume were unnecessary buys, demand imbalances and unnecessary sells respectively. This represents energy that the participant has no control. Uncapitalized generation capacity is where a participant could have produced energy, however, it was not sold on the market. Additionally, due to forecast errors, the participant might have sold less than it should have. Our work, however, focuses on a national electricity market, as opposed to a local market.
Examples of online learning algorithms are Passive Aggressive (PA) Regressor Gzik2014, Linear Regression, Box-Cox Regressor Box1964, K-Neighbors Regressor forgy65 and Multilayer perceptron regressor Hinton1989. For our work, we trial the stated algorithms, in addition to a host of offline learning techniques. The offline techniques trialled were Lasso regression Tibshirani1996a, Ridge regression GeladiPaul1994Mrac, Elastic Net Geostatistics2010, Least Angle Regression Fike1988, Extra Trees Regressor Fike1988, Random Forest Regressor Breiman2001, AdaBoost Regressor Freund1997, Gradient Boosting Regressor 316 and Support vector regression Cortes1995. We chose the boosting and random forest techniques due to previous successes of these algorithms when applied to electricity demand forecasting Kell2018. We trialled the additional algorithms due to availability of these algorithms using the packages scikit-learn and Creme scikit-learn,creme.
{Linear regression.} Linear regression is a linear approach to modelling the relationship between a dependent variable and one or more independent variables. Linear regressions can be used for both online and offline learning. In this work, we used them for both online and offline learning. Linear regression algorithms are often fitted using the least squares approach. The least squares approach minimizes the sum of the squares of the residuals.
Other methods for fitting linear regressions are by minimizing a penalized version of the least squares cost function, such as in ridge and lasso regression Tibshirani1996a, GeladiPaul1994Mrac. Ridge regression is a useful approach for mitigating the problem of multicollinearity in linear regression. Multicollinearity is where one predictor variable can be linearly predicted from the others with a high degree of accuracy. This phenomenon often occurs in algorithms with a large number of parameters.
In ridge regression, the OLS loss function is augmented so that we not only minimize the sum of squared residuals but also penalized the size of parameter estimates, in order to shrink them towards zero:
Where $\lambda$ is the regularization penalty which can be chosen through cross-validation, or the value that minimizes the cross-validated sum of squared residuals, for instance. $n$ is the number of observations of the response variable, $Y$, with a linear combination of $m$ predictor variables, $X$, and we solve for $\hat{\beta}$, where $\hat{\beta}$ are the OLS parameter estimates. Where $y_i$ is the outcome and $x_i$ are the covariates, both for the $i^{th}$ case.
Lasso is a linear regression technique which performs both variable selection and regularization. It is a type of regression that uses shrinkage. Shrinkage is where data values are shrunk towards a central point, such as the mean. The lasso algorithm encourages models with fewer parameters and automates variable selection.
Under Lasso the loss is defined as:
The only difference between lasso and ridge regression is the penalty term.
Elastic net is a regularization regression that linearly combines the penalties of the lasso and ridge methods. Specifically, Elastic Net aims to minimize the following loss function:
where $\alpha$ is the mixing parameter between ridge ($\alpha=0$) and lasso ($\alpha=1$). The parameters $\lambda$ and $\alpha$ can be tuned.
Least Angle Regression (LARS) provides means of producing an estimate of which variables to include in a linear regression, as well as their coefficients.
{Decision tree-based algorithms.} The decision tree is an algorithm which goes from observations to output using simple decision rules inferred from data features Quinlan. To build a regression tree, recursive binary splitting is used on the training data. Recursive binary splitting is a greedy top-down algorithm used to minimize the residual sum of squares. The RSS, in the case of a partitioned feature space with $M$ partitions, is given by:
Where $y$ is the value to be predicted and $\hat{y}$ is the predicted value for partition $R_m$.
Beginning at the top of the tree, a split is made into two branches. This split is carried out multiple times and the split is chosen that minimizes the current RSS. To obtain the best sequence of subtrees cost complexity, pruning is used as a function of $\alpha$. $\alpha$ is a tuning parameter that balances the depth of the tree and the fit to the training data.
The AdaBoost training process selects only the features of an algorithm known to improve the predictive power of the model Freund1997. By doing this, the dimensionality of the algorithm is reduced and can improve compute time. This can be used in conjunction with multiple different algorithms. In our paper, we utilized the decision tree based algorithm with AdaBoost.
Random Forests are an ensemble learning method for classification and regression Breiman2001. Ensemble learning methods use multiple learning algorithms to obtain better predictive performance. They work by constructing multiple decision trees and output the predicted value that is the mode of the predictions of the trees.
To ensure that the individual decision trees within a Random Forest are not correlated, bagging is used to sample from the data. Bagging is the process of randomly sampling with replacement of the training set and fitting the trees. This has the benefit of reducing the variance of the algorithm without increasing the bias.
Random Forests differ in one way from this bagging procedure. Namely, using a modified tree learning algorithm that selects, at each candidate split in the learning process, a random subset of the features, known as feature bagging. Feature bagging is undertaken due to the fact that some predictors with a high predictive ability may be selected many times by the individual trees, leading to a highly correlated Random Forest.
ExtraTrees adds one further step of randomization Fike1988. ExtraTrees stands for extremely randomized trees. There are two main differences between ExtraTrees and Random Forests. Namely, each tree is trained using the whole learning sample (And not a bootstrap sample), and the top-down splitting in the tree learner is randomized. That is, instead of computing an optimal cut-point for each feature, a random cut-point is selected from a uniform distribution. The split that yields the highest score is then chosen to split the node.
{Gradient Boosting}. Gradient boosting is also an ensemble algorithm 316. Gradient boosting optimizes a cost-function over function space by iteratively choosing a function that points in the negative gradient descent direction, known as a gradient descent method.
{Support vector regression (SVR).} SVR is an algorithm which finds a hyperplane and decision boundary to map an input domain to an output Cortes1995. The hyperplane is chosen by minimizing the error within a tolerance.
Suppose we have the training set: $(x_1,y_1), \ldots,(x_i,y_i),\ldots,(x_n,y_n)$, where $x_i$ is the input, and $y_i$ is the output value of $x_i$. Support Vector Regression solves an optimization problem Chen2004, Shu2006, under given parameters $C>0$ and $\varepsilon >0$, the form of support vector regression is Drucker1997:
subject to
$x_i$ is mapped to a higher dimensional space using the function $\phi$. The $\varepsilon$-insensitive tube $(\omega^T\phi(x_i)+b)-y_i\leq\varepsilon$ is a range in which errors are permitted, where $b$ is the intercept of a linear function. $\xi_i$ and $\xi^*_i$ are slack variables which allow errors for data points which fall outside of $\varepsilon$. This enables the optimization to take into account the fact that data does not always fall within the $\varepsilon$ range Smola2004.
The constant $C>0$ determines the trade-off between the flatness of the support vector function. $\omega$ is the algorithm fit by the SVR. The parameters which control regression quality are the cost of error $C$, the width of the tube $\varepsilon$, and the mapping function $\phi$ Shu2006,Chen2004.
{K-Neighbors Regressor.} K-Neighbors regression is a non-parametric method forgy65. The input consists of a new data point, and the algorithm finds the k closest training examples in the feature space. The output is the mean value of the k nearest neighbours.
{Multilayer perceptron.} A neural network can be used in offline and online cases. Here, we used them for both.
Artificial Neural Networks is an algorithm which can model non-linear relationships between input and output data Akaike1974. A popular neural network is a feed-forward multilayer perceptron. Fig. (ref) shows a three-layer feed-forward neural network with a single output unit, k hidden units, $n$ input units. $w_{ij}$ is the connection weight from the $i^{th}$ input unit to the $j^{th}$ hidden unit, and $T_j$ is the connecting weight from the $j^{th}$ hidden unit to the output unit Pao2007. These weights transform the input variables in the first layer to the output variable in the final layer using the training data.
For a univariate time series forecasting problem, suppose we have N observations $y_1, y_2, \ldots, y_N$ in the training set, and $m$ observations in the test set, $y_{N+1}, y_{N+2}, \ldots, y_{N+m}$, and we are required to predict m periods ahead Pao2007. The training patterns are as follows:
where $f_{W}(\cdot)$ represents the MLP network and $W$ are the weights. For brevity we omit $W$. The training patterns use previous time-series points, for example, $y_p, y_{p-1},\ldots,y_1$ as the time series is univariate. That is, we only have the time series in which we can draw inferences from. In addition, these time series points are correlated, and therefore provide information that can be used to predict the next time point.
The $m$ testing patterns are
The training objective is to minimize the overall predictive mean sum of squared estimate of errors (SSE) by adjusting the connection weights. For this network structure the SSE can be written as $\sum_{i=p+m}^N(y_i-\hat{y}_i)$ where $\hat{y}_i$ is the prediction from the network. The number of input nodes corresponds to the number of lagged observations. Having too few or too many input nodes can affect the predictive ability Pao2007.
It is also possible to vary the the number of input units. Typically, various different configurations of units are trialled, with the best configuration being used in production. The weights $W$ in $f_W$ are trained using a process called backpropagation, which uses labelled data and gradient descent to optimize the weights.
{Box-Cox regressor.} In this subsection, we discuss the Box-Cox regressor. Ordinary least square is a method for estimating the unknown parameters in a linear regression algorithm. It estimates these unknown parameters by the principle of least squares. Specifically, it minimizes the sum of the squares of the differences between the observed variables and those predicted by the linear function.
The ordinary least squares regression assumes a normal distribution of residuals. However, when this is not the case, the Box-Cox Regression may be useful Box1964. It transforms the dependent variable using the Box-Cox Transformation function and employs maximum likelihood estimation to determine the optimal level of the power parameter lambda.
{Passive-Aggressive regressor.} The goal of the Passive-Aggressive (PA) algorithm is to change itself as little as possible to correct for any mistakes and low-confidence predictions it encounters Gzik2014. Specifically, with each example PA solves the following optimisation Ma2009:
Where $x_t$ is the input data and $y_i$ the output data, and $w_t$ are the weights for the PA algorithm and $w$ is the weight to be optimised. Updates occur when the inner product does not exceed a fixed confidence margin - i.e., $y_i(\boldsymbol{w}\cdot \boldsymbol{x}_t)\geq1$. The closed-form update for all examples is as follows:
where
$a_t$ is derived from a derivation process which uses the Lagrange multiplier Gzik2014.
In order to test the impact of the different residual distributions, we used the ElecSim simulation Kell,Kell2020. ElecSim is an agent-based model which mimics the behaviour of decentralized electricity markets. In this paper, we parametrized the model with data of the United Kingdom in 2018. This enabled us to create a digital twin of the UK electricity market and project forward. The data used for this parametrization included power plants in operation in 2018 and the funds available to the GenCos dukes_511, companies_house.
ElecSim is made up of six components: 1) power plant data; 2) scenario data; 3) the time-steps of the algorithm; 4) the power exchange; 5) the investment algorithm and 6) the GenCos as agents. ElecSim uses a subset of representative days of electricity demand, solar irradiance and wind speed to approximate a full year. Representative days are a subset of days which, when scaled up, represent an entire year Kell2020. We show how these components interact in Figure (ref) Kell. Namely, electricity demand is matched with the supply provided by power plants through the use of a spot market. Generator companies invest in power plants based upon information provided by the data sources and expectation of the data provided by the configuration file.
ElecSim uses a configuration file which details the scenario which can be set by the user. This includes electricity demand, carbon price and fuel prices. The data sources parametrize the ElecSim simulation to a particular country, including information such as wind capacity and power plants in operation. A spot market then matches electricity demand with supply.
The market runs a merit-order dispatch model, and bids are made by the power plant's short-run marginal cost (SRMC). A merit-order dispatch model is one which dispatches the cheapest electricity generators first. SRMC is the cost it takes to dispatch a single MWh of electricity and does not include capital costs. Investment in power plants is based upon a net present value (NPV) calculation. NPV is the difference between the present value of cash inflows and the present value of cash outflows over a period of time. This is shown in Equation (ref), where $t$ is the year of the cash flow, $i$ is the discount rate, $N$ is the total number of years, or lifetime of power plant, and $R_t$ is the net cash flow of the year $t$:
Each of the Generator Companies (GenCos) estimate the yearly income for each prospective power plant by running a merit-order dispatch electricity market simulation ten years into the future. However, it is true that the expected cost of electricity ten years into the future is particularly challenging to predict. We, therefore, use a reference scenario projected by the UK Government Department for Business and Industrial Strategy (BEIS), and use the predicted costs of electricity calibrated by Kell et al Kell2020, DBEIS2019. The agents predict the future carbon price by using a linear regression algorithm.
More concretely, the GenCos make investments by comparing the expected profitability of each of the power plants over their respective lifetime. They invest in the power plant which they deem to be the most profitable. A major uncertainty in power plant investment is the price of electricity whilst the power plant is in operation. This is often a 25 year period. This is where the predicted costs of electricity calibrated in Kell2020 is used.
{Data Preparation.} Similarly to our previous work in Kell2018a, we selected a number of calendar attributes and demand data from the GB National Grid Status dataset provided by the electricity market settlement company Elexon, and the University of Sheffield gbnationalgridstatus_2019. This dataset contained data between the years 2011-2018 for the United Kingdom. The calendar attributes used as predictors to the algorithms were hour, month, day of the week, day of the month and year. These attributes allow us to account for the periodicity of the data within each day, month and year.
It is also the case that electricity demand on a public holiday which falls on a weekday is dissimilar to load behaviours of ordinary weekdays Kim2000. We marked each holiday day to allow the algorithm to account for this.
As demand data is highly correlated with historical demand, we lagged the input demand data. In this context, the lagged data is where we provide data of previous time steps at the input. For example, for predicting $t+1$, we use $n$ inputs: $t,t-1,t-2,\ldots,t-n$. This enabled us to take into account correlations on previous days, weeks and the previous month. Specifically, we used the previous 28 hours before the time step to be predicted for the previous 1st, 2nd, 7th and 30th day. We chose this as we believe that the previous two days were the most relevant to the day to be predicted, as well as the weekday of the previous week and the previous month. We chose the previous 28 hours to account for a full day, plus an additional 4 hours to account for the previous day's correlation with the day to be predicted. We could have increased the number of days provided to the algorithm. However, due to time and computational constraints, we used our previously described intuition for lagged data selection.
In addition to this, we marked each of the days with their respective seven seasons. These seasons were defined by the National Grid Short Term Operating Reserve (STOR) Market Information Report ESO2019. These differ from the traditional four seasons by splitting autumn into two further seasons, and winter into three seasons. Finally, to predict a full 24-hours ahead, we used 24 different algorithms, 1 for each hour of the day.
The data is standardized and normalized using min-max scaling between -1 and 1 before training and predicting with the algorithm. This is due to the fact that the inputs such as day of the week, hour of day are significantly smaller than that of demand. Therefore, the demand will influence the result more due to its larger value. However, this does not necessarily mean that demand has greater predictive power.
{Algorithm Tuning.} To find the optimum hyperparameters, cross-validation is used. As this time-series data were correlated in the time-domain, we took the first six years of data (2011-2017) for training and tested on the remaining year of data (2017-2018).
Each machine learning algorithm has a different set of parameters to tune. To tune the parameters in this paper, we used a grid search method. Grid search is a brute force approach that trials each combination of parameters at our choosing; however, for our search space was small enough to make other approaches not worth the additional effort.
Tables (ref) and (ref) display each of the algorithms and respective parameters that were used in the grid search. Table (ref) shows the offline machine learning methods, whereas Table (ref) displays the online machine learning methods. Each of the parameters within the columns “Values” are trialled with every other parameter.
Whilst there is room to increase the total number of parameters, due to the exponential nature of grid-search, we chose a smaller subset of hyperparameters, and a larger number of regressor types. Specifically, with neural networks, there is a possibility to extend the number of layers as well as the number of neurons, to use a technique called deep learning. Deep learning is a class of neural networks that use multiple layers to extract higher levels of features from the input. For this paper, however, we decided to trial a large number of different algorithms, instead of a large number of different configurations for neural networks.
{Implementation methodology.} The implementation slightly differs between online and offline learning. In offline learning, batch processing occurs. That is, all the data from 2011 to 2017 is used to train the algorithm. Once each of the algorithms had been trained, the algorithms are used to predict the electricity demand from 2017 to 2018. For hyper-parameter tuning cross-validation is used. Specifically, the training data is randomly split ten times to select the best hyper-parameters. This allowed for an unbiased assessment of the data.
For online learning a similar process is undertaken. That is, the algorithms are trained in a batched approach using data from 2011 to 2017. Between the year 2017 and 2018, the next time-step is predicted and the error recorded between actual value and the predicted value. Next, the algorithm is updated using the actual value, and the next value predicted again.
{Prediction Residuals in ElecSim.} Each of the algorithms trialled will have a degree of error. Prediction residuals are the difference between the estimated and actual values. We collect the prediction residuals to form a distribution for each of the algorithms. We then trial 80 different closed-form distributions to see which of the distributions best fits the residuals from each of the algorithms. These 80 distributions were chosen due to their implementation in scikit-learn scikit-learn.
Once each of the prediction residual distributions are fit with a sensible closed-form distribution, we sample from this new distribution and perturb the demand for the electricity market at each time step within ElecSim.
By perturbing the market by the residuals, we can observe what the effects are of incorrect predictions of demand in an electricity market using ElecSim.
ElecSim has previously been validated in Kell2020. In this work, we validated our algorithm between the years 2013 and 2018, and recorded the difference between observed electricity mix to predicted electricity mix. We found that we were able to predict each different electricity source better than the naive approach. The naive approach, in this case, was predicting the electricity mix at the last known point in 2013. However, we were able to better predict coal, solar and wind by achieving a mean absolute scaled error (MASE) of ${\sim}$0.4 for these. CCGT and nuclear on the other hand had slightly worse results, achieving a MASE of ${\sim}$0.7.
In this Section, we detail the accuracy of the algorithms to predict 24 hours ahead for the day-ahead market. In addition to this, we display the impact of the errors on electricity generation investment and electricity mix from the years 2018 to 2035 using the agent-based model ElecSim.
In this work, the training data was from 2011 to 2017, and the testing data was from 2017 to 2018.
Figure (ref) displays the mean absolute error of each of the offline statistical and machine learning algorithms on a log scale. It can be seen that the different algorithms have varying degrees of success. The least accurate algorithms were linear regression, multilayer perceptron (MLP) and the Least Angle Regression (LARS), each with mean absolute errors over 10,000MWh. This error would be prohibitively high in practice; the max tendered national grid reserve is 6,000MWh, while the average tendered national grid reserve is 2,000MWh ESO2019.
A number of algorithms perform well, with a low mean absolute error. These include the Lasso, gradient Boosting Regressor and K-neighbours regressor. The best algorithm, similar to Kell2018a, was the decision tree-based algorithm, Extra Trees Regressor, with a mean absolute error of $1,604$MWh. This level is well within the average national grid reserve of 2,000MWh.
Table (ref) displays different metrics for measuring the accuracy of the offline machine learning techniques. These include Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE) and the Mean R-Squared. The results largely compliment each other. With high error values in one metric correlating to high error metrics in others for each of the estimators.
Figure (ref) displays the distribution of the best offline machine result (Extra Trees Regressor). It can be seen that the max tendered national grid reserve falls well above the 5% and 95% percentiles. However, there are occasions where the errors are greater than the maximum tendered national grid reserve. In addition, the majority of the time, the algorithm's predictions fall within the average available tendered national grid reserve. Therefore, there is room for improvement, to ensure that blackouts do not occur and predictions fall within the max tendered national grid reserve.
Figures (ref) and (ref) display the time taken to train the algorithm and time taken to sample from the algorithm versus the absolute error respectively for the offline algorithms. Multiple fits are trialled for each parameter type for each algorithm. The error bars indicate the results of multiple cross-validations.
It can be seen from Figure (ref) that the time to fit varies significantly between algorithms and parameter choices. The multilayer perceptron consistently takes a long time to fit, when compared to the other algorithms and performs relatively poorly in terms of MAE. There are many algorithms, such as the random forest regressor, and extra trees regressors which perform well, however, take a long time to fit, especially when compared to the K-Nearest neighbours.
For a small deterioration in MAE it is possible to decrease the time it takes to train the algorithm significantly. For example, by using the K-Nearest neighbours or support vector regression (SVR).
The scoring time, displayed in Figure (ref), also displays a large variation between algorithm types. For instance, the MLP regressor takes a shorter time to sample predictions when compared to the K-Neighbors algorithm and support vector regression. It is possible to have a cluster of algorithms with low sample times and low mean absolute errors. However, often a trade-off is required, with a fast prediction time requiring a longer training time and vice-versa. Practitioners, therefore, must decide which aspect is most important for them for their use case: speed of training or of prediction.
To see if we can improve on the predictions, we utilize an online machine learning approach. If we are successful, we should be able to reduce the national grid reserves, reducing cost and emissions.
Figure (ref) displays the comparison of mean absolute errors for the different trialled online regressor algorithms. To produce this graph, we show various hyperparameter trials. Where the hyperparameters had the same results, we removed them. For the multilayer perceptron (MLP), we aggregated all hyperparameters, due to the similar nature of the predictions.
It can be seen that the best performing algorithm was the Box-Cox regressor, with an MAE of 1100. This is an improvement of over 30% on the best offline algorithm. The other algorithms perform less well. However, it can be seen that the linear regression algorithm improves significantly for the online case when compared to the offline case. The passive aggressive (PA) algorithm improve significantly with the varying parameters, and the MLP performs poorly in all cases.
Table (ref) displays the metrics for each of the online methods. This includes the mean MSE, mean RMSE and mean MAE. Again, the metrics largely correlate with each other. Meaning, that the favoured metric can be used when selecting an estimator.
Figure (ref) displays the best online algorithm. We can see a significant improvement over the best online algorithm distribution, shown in Figure (ref). We remain within the max tendered national grid reserve for 98.9% of the time, and the average available tendered national grid reserve is close to the 5% and 95% percentiles. This model, therefore would be highly recommended over the best offline version to ensure demand is matched with supply.
Figure (ref) displays the residuals for a algorithm with poor predictive ability, the passive aggressive regressor. It displays a large period of time of prediction errors at -20,000MWh, and often falls outside of the national grid reserve. These results demonstrate the importance of trying a multitude of different algorithms and parameters to improve prediction accuracy.
Figure (ref) displays a comparison between the actual electricity consumption compared to the predictions. It can be seen that the Box-Cox algorithm better predicts the actual electricity demand in most cases when compared to the best offline algorithm, the Extra Trees regressor. The Extra Trees regressor often overestimates the demand, particularly during weekdays. Whilst the Box-Cox regressor more closely matches the actual results. During the weekend (between the hours of 120 and 168), the Extra Trees regressor performs better, particularly on the Saturday (between hours of 144 and 168).
Figures (ref) and (ref) display the mean absolute error versus test and training time respectively. In these graphs, a selection of algorithms and parameter combinations are chosen.
Clear clusters can be seen between different types of algorithms and parameter types. With the passive aggressive (PA) algorithm performing the slowest for both training and testing. Different parameter combinations show different results in terms of mean absolute error.
The best performing algorithm is the Box-Cox algorithm, which is also the fastest to both train and test. The linear regression, which performs worse in terms of predictive performance, is as quick to train and test as the Box-Cox algorithm. Additionally, the multilayer perceptron (MLP) is relatively quick to train and test when compared to the PA algorithms. We, therefore, recommend the Box-Cox algorithm as an optimal for training and testing speed as well as accuracy.
It is noted that when compared to the offline algorithms, the training time is a good indicator to the testing time. In other words, algorithms that are fast to train are also fast to test and vice-versa.
In this Section we explore the effect of these residuals on investments made and the electricity generation mix. To generate these graphs, we perturbed the exogenous demand in ElecSim by sampling from the best-fitting distributions for the respective residuals of each of the online methods. We did this for all of the online learning algorithms displayed in Figure (ref). We let the simulation run for 17 years from 2018 to 2035.
Running this simulation enabled us to see the effect on carbon emissions on the electricity grid over a long time period. For instance, does underestimating electricity demand mean that peaker power plants, such as reciprocal gas engines, are over utilized when other, less polluting power plants could be used?
In this Section we display the mean electricity mix contributed by different electricity sources from 2018 to 2035.
Figure (ref) displays the mean power contributed between 2018 and 2035 for each source vs. mean absolute error of the various online regressor algorithms displayed in Figure (ref). A positive correlation can be seen with PV contributed and mean absolute error. This is similar for coal and nuclear output. However, it can be seen that offshore wind reduces with mean absolute error. Output for the reciprocal gas engine also increases with mean absolute error.
The reciprocal gas engine was expected to increase with times of high error. This is because, traditionally, reciprocal gas engines are peaker power plants. Peaker power plants provide power at times of peak demand, which cannot be covered by other plants due to them being at their maximum capacity level or out of service. It may also be the case, that with higher proportions of intermittent technologies, there is a larger need for these peaker power plants to fill in for times where there is a deficit in wind speed and solar irradiance.
It is hypothesized that coal and nuclear output increase to cover the predicted increased demands of the service. As these generation types are dispatchable, meaning operators can choose when they generate electricity, they are more likely to be used in times of higher predicted demand.
In this Section, we detail the difference in total technologies invested in over the time period between 2018 to 2035, as predicted by ElecSim.
CCGT, onshore, and reciprocal gas engines investment is less with an increase in MAE, as shown in Figure (ref). While coal, offshore, nuclear and photovoltaics all exhibit increasing investments with MAE. Therefore, a smaller error leads to an increased usage of onshore wind, where lulls in wind supply are covered by CCGT and reciprocal gas engines.
It is hypothesized that coal and nuclear increase in investment due to their dispatchable nature. While onshore, non-dispatchable by nature, become a less attractive investment.
CCGT and reciprocal gas engines may have decreased in capacity over this time, due to the increase in coal. This could be because of the large consistent errors in prediction accuracy that meant that reciprocal gas engines were perceived to be less valuable.
Figure (ref) shows an increase in relative mean carbon emitted with mean absolute error of the predictions residuals. The reason for an increase in relative carbon emitted could be due to the increased output of utility of the reciprocal gas engine, coal, and decrease in offshore output. Reciprocal gas engines are peaker plants and, along with coal, can be dispatched. By being dispatched, the errors in predictions of demand can be filled. It is therefore recommended that by improving the demand prediction algorithms, significant gains can be made in reducing carbon emissions.
In this Section we run a sensitivity analysis to visualise the effects of different errors on the average electricity mix over the 2018 to 2035 time period. To conduct this sensitivity analysis, we used a normal distribution with a mean of 0 and modified the standard deviation between 1,000 and 20,000, in increments of 1,000. We selected the normal distribution due to its observation in nature, and its symmetric properties. We chose to increase the standard deviation until 20,000 due to it being 33% larger than the errors shown in the previous subsection. This gave us a larger error than had previously been explored.
Figure (ref) displays the results of this sensitivity analysis. At all standard deviations, photovoltaics displays the highest contributed energy, CCGT the second most and nuclear the third most. Coal, onshore and the others contribute less energy than the top three.
Whilst photovoltaics remains high throughout, it reduces up until a standard deviation of 14,000MW, after which it begins to increase. This reduction up until 14,000MW may be due to the fact that the predicted demand changes so quickly, that photovoltaics are unable to be reliably dispatched on the day-ahead market to meet this changing predicted demand. Nuclear is, however, able to fill the demand that photovoltaics can not, due to its dispatchable nature.
After a standard deviation of 14,000MW, photovoltaics increases, whilst nuclear decreases. This may be due to the large positive error predictions, which photovoltaics believes it is able to be dispatched on and displaces the more expensive nuclear energy technology.
From our results, it can be seen that different algorithms yield differing prediction accuracies. Online algorithms can result in a decrease in 30% of prediction error on the best offline algorithms. We calculated this by comparing the MAE for Extra Trees to the MAE for the Box-Cox regressor. We, therefore, recommend the use of online machine learning for predicting electricity demand in a day-ahead market.
Similar to our assumptions, the online learning algorithms were able to outperform the offline algorithms. This is due to the non-stationary nature of the data. An online method is able to use the most up-to-date knowledge of the complex system of energy demand. For instance, a certain year may have a particularly warm winter when compared to previous years, reducing the amount of electricity used for heating.
However, contrary to our assumptions, the online linear regression techniques outperformed the online machine learning techniques. This may be due to their simpler nature and ability to learn from a smaller subset of new data as opposed to relying on a large historic subset. For the offline algorithms, the best performing algorithms were the decision tree approaches such as extra trees and random forests. This is a similar outcome to our previous work, which showed that the best performing method for demand forecasting were random forests Kell2018. Contrary to our assumptions, however, the lasso and ridge regression outperformed the machine learning techniques support vector regression and multilayer perceptron. This may be due to the ability of feature selection by lasso and ridge regression, which only uses the most important features.
To the best of our knowledge, more work has been done using offline learning to predict electricity demand. This may be due to the additional complexity of running online algorithms, and a smaller number of available algorithms to run in an online fashion.
In terms of computing power, finding the optimal input parameters, hyperparameters and algorithms to use can be a large undertaking. This is due to the exponential growth of the number of choices that can be made. This can be an issue where accuracy is of importance, especially when the data changes over time, meaning it may be necessary to retest previous results. However, due to the financial and sustainability implications, we believe the trade-off between compute time and accuracy is balanced towards compute time. There are also large implications if the algorithm were to break at a certain point in time. We, therefore, recommend the reliance on multiple well-performing algorithms, as opposed to solely the best performing algorithm at any one time.
For training time and prediction time, there is often a trade-off between training and predicting. For instance, the k-nearest neighbours is fast to train, but slow to sample from. Therefore stakeholders must make a decision based upon accuracy, speed of training and sampling.
The amount of time taken to test and cross-validate the algorithms increases exponentially with the number of algorithms and hyper-parameters trialled. It is, therefore, suggested that cloud computing is used to train the algorithms. This would enable the trialling of many different algorithms and hyper-parameters within a reasonable time limit for this time-sensitive application. However, once the algorithms have been trained and are used for making predictions the predictions can be made within a two minutes in the worst case. For the application of predicting 24-hours ahead, this falls within a reasonable time.
The impact on the broader electricity market has been shown to be significant. Principally, the investment behaviours of GenCos change as well as the dispatched electricity mix. The relative mean carbon emitted over this time period increases, due to an increase in the utilization of coal and reciprocal gas engines, at the expense of offshore wind.
In this paper, we evaluated 16 different machine learning and statistical algorithms to predict electricity demand in the UK for the day-ahead market. Specifically, we used both online and offline algorithms to predict electricity demand 24 hours ahead. We compared the ability for the offline algorithms: lasso regression, random forests, support vector regression, for both online and offline learning: linear regression, multilayer perceptron and for just online learning: the Box-Cox transformation and the passive aggressive regressor, amongst others. The Box-Cox, as well as the passive aggressive regressors, were used as online learning algorithms, the multilayer perceptron and linear regression were used as both, whereas the rest were used as offline learning algorithms.
We measured the errors and compared these to each algorithm as well as the national grid reserve. We found that through the use of an online learning approach, we were able to significantly reduce error by 30% on the best offline algorithm. We were also able to reduce our errors to significantly below the national grid's mean and maximum tendered reserve, thus significantly reducing the chances of blackouts.
In addition to this, we took these errors, or residuals, and perturbed the electricity market of the agent-based model ElecSim. This enabled us to see the impact of different error distributions on the long-term electricity market, in terms of investment and electricity mix.
We observed that with an increase in prediction errors, we get a higher proportion of electricity generated by coal, offshore, nuclear, reciprocal gas engines and photovoltaics. This could be due to the fact that more peaker and dispatchable plants are required to fill in for unexpected demand. In addition, a higher proportion of intermittent renewable energy sources leads to a higher use of peaker power plants to fill in the gaps of intermittency of wind and solar irradiance. However, by reducing the mean absolute error, we are able to reduce the amount of reciprocal gas engine and coal usage.
In future work, we would like to trial a different selection of algorithms inputs to the algorithms, for instance, by providing the algorithm with two months worth of historical data as dependent variables. Additionally, we would like to see the impact of predicting wind speed and solar irradiance to see how these impact the overall investment patterns and electricity mix. We would also like to use ensemble models in future, which combine the results of multiple algorithms.
This work was supported by the Engineering and Physical Sciences Research Council, Centre for Doctoral Training in Cloud Computing for Big Data [grant number EP/L015358/1].