Skip to content
Analytica > Blogs > Electricity price forecasting via time-series, regression & nearest neighbor models

Electricity price forecasting via time-series, regression & nearest neighbor models

Flip the switch and the light goes on. How simple it is to take this for granted. Large-scale engineered and networked systems manage our daily electrical needs, and many negotiations and transactions happen so that we can fire up our machines and appliances. Electricity markets facilitate the buying and selling of this commodity, and predicting electricity price (even for the next day) is crucial for players in the market.

Planning by market players

Electricity generation companies seek to maximize their profit when transacting in a deregulated electricity market. Explored in a 2008 power engineering paper by a Chalmers University of Technology researcher, a general description of this objective is below.

The objective described is based on the process below, which are typical steps involved in the short-term operational planning by electricity market players.

Short-term planning

Analytically, this suggests designing strategic bidding plans that seek to maximize profit given system behaviors and constraints. Solution approaches range from simple heuristics to game-theoretic algorithms. However, an important component in all approaches is the next-day forecast of the market electricity price. Systems analysts may be tempted to model the system and use a simulation approach to forecast the electricity price, but this requires a lot of information, including the behavior of other commodities and natural phenomena like weather. Although I am all for creating virtual worlds, this one may cause you to be squeamish- but don’t let me stop you from simulating. It’s doable using, say, Monte Carlo simulation.

Time-series models

Electricity price forecasting can be wrangled by one of several mathematical models. In contrast to a simulation approach, a time-series approach is what I call a response-focused approach. Instead of trying to model the different player behaviors in a market along with effects from other factors, a time-series model seeks to forecast electricity price Z (the response) using the values of Z at previous points in time. The 2008 power engineering paper presents this well, beginning with an autoregressive (AR) model as shown below.

AR model

We can sometimes get a higher rate of accuracy using a more encompassing approach like an autoregressive moving average (ARMA) model as shown below.

ARMA model

Other more sophisticated time-series models like ARIMA and GARCH exploit certain possible behaviors in the data. I discuss the application of time-series models to crude oil price forecasting in a prior blog, another heavy problem in forecasting.

Causal forecasting models

Causal forecasting might be too bold of a name, but it suggests that we can forecast electricity price using variables that seem to influence it. This is technically called regression modeling. The power engineering paper shows a practical regression using some standard variables.


These models can be set up and explored in Lumina Decision System’s Analytica platform. A more general approach for electricity price forecasting that can incorporate previous prices and other variables based on time is called a dynamic regression model. This is discussed in a 2006 paper by a University of Waterloo researcher, and the general mathematical form is below.

Dynamic regression

A machine learning model

By no means shall I present a tour of plausible learning models that can be used for electricity price forecasting. Instead, I’ll present a simple machine-learning model that seems to work well. The model is called weighted nearest neighbors, and the idea is to forecast based on the properties of neighboring data points. This method is discussed in a 2007 paper published in IEEE Transactions on Power Systems. Using a few days in the past, we pick several data points close to the current day and use those hourly electricity prices to predict the hourly prices for each hour for the next [future] day. This is illustrated below.


You should now see a cloud of questions above your head. The paper addresses four major items: 1) how far back we should go, 2) the number of data points (neighbors) to choose, 3) how we can identify neighboring data points, and 4) the formula to use to compute the future price. As you can imagine, the formula can be a linear combination of weights and previous prices. The paper shares the quite astonishing results of this method along with a comparison. Promising, I tell you.


Notice that we’ve reviewed methods and progress in forecasting an important commodity for just one day in the future! What do you think causes electricity price forecasting to be such a tough nut to pry open? What social, cooperative, and competitive factors are at play?

Share now 

See also

air conditioner outdoor unit

Building electrification: heat pump technology for California homes

Lumina set out to build a useful tool to assess the benefits of heat pumps. Learn more about heat pumps and their impact.

Heat Pumps 101: heat and cool your home while saving energy and reducing emissions!

Heat and cool your home while saving energy and reducing emissions by adopting heat pump technology. Learn more.

Navigating the heat pump landscape

Fort Collins, Lumina, and Apex Analytics have created a tool to help reduce greenhouse gas emissions by optimizing building electrification programs.

US gas leaks much larger than previously estimated

Can alternative technologies such as biofuels, natural gas, electric vehicles, or hydrogen fuel cells reduce greenhouse gas emissions and dependency on oil?