# Wavelet Analysis of Daily Energy Demand and Weather Variables

Authors: Abdou Latif Bonkaney; Ibrah Seidou Sanda; Ahmed A. Balogun
Journal: Journal of Energy
 (2019)

---

## Abstract

In this paper, we applied the Wavelet Transform Coherence (WTC) and phase analysis to analyze the relationship between the daily electricity demand (DED) and weather variables such as temperature, relative humidity, wind speed, and radiation. The DED data presents both seasonal fluctuations and increasing trend while the weather variables depict only seasonal variation. The results obtained from the WTC and phase analysis permit us to detect the period of time when the DED significantly correlates with the weather variables. We found a strong seasonal interdependence between the air temperature and DED for a periodicity of 256-512 days and 128-256 days. The relationship between the humidity and DED also shows a significant interdependence for a periodicity of 256-512 days with average coherence equal to 0.8. Regarding the radiation and wind speed, the correlation is low with average coherence less than 0.5. These results provide an insight into the properties of the impacts of weather variables on electricity demand on the basis of which power planners can rely to improve their forecasting and planning of electricity demand.


---

## Body

## 1. Introduction

The energy sector, particularly the electricity demand, is the most sensible sector to climate change due to the fact that it is influenced by weather variables. According to the fifth assessment report of the Intergovernmental Panel on Climate Change (IPCC, AR5) both mean and extreme temperature will increase. Consequently the required cooling demand will increase too. So, in order to sustain efficiently the electricity supply and meet the future demand, it is worth understanding how the various weather parameters influence the present electricity demand.Indeed, several works have already shown the correlation between the electricity demand and weather variables [1–5].Valoret al.(2001) attributed the seasonal variation of electricity demand to weather variables and the increasing trend to socioeconomic factors [1]. The work ofGiannakopoulos & Psiloglou (2006) also showed that energy demand in Athens varies both seasonally and from year to year, which they have respectively attributed to weather fluctuations and socioeconomic factors [2].Gastliet al.(2013) pointed out that the maximum daily air temperature is the most influential climate parameter in Qatar [3].Ali et al. (2013), in their study entitled the relationship between extreme temperature and electricity demand in Pakistan, showed that the electricity demand is more for the summer season, and this demand will be higher (6785.6 GWh) in July 2020 due to rise in air temperature [4].Akilet al.(2014) showed a correlation between the electricity demand and weather variables in Indonesia [5]. Due to the fact that the weather variables may differ from one location to another, it is worth investigating the impacts of these variables on the electricity demand in a specific climate zone. Also in Niger, however, the relationship between the electricity demand and weather variables remains an area to be explored. Therefore, in this work, we will examine this relationship between electricity demand and weather variable using the wavelet analysis.The most common methods used to assess the relationship between climate variables and electricity consumption is the regression analysis. The limitation of this method comes from the fact that they are too simplistic and only provide a general view of the relationship between two series.The wavelet analysis (WA) is a young mathematical technique that has gained a lot of interest in recent years. The attractiveness of this technique lies in its decomposition properties in time-frequency space. The WA technique presents two classes of the wavelet transform: the continuous wavelet transform (CWT) and the discrete wavelet transform (DWT). The latter is often used for noise reduction and data compression, whereas the former is useful for feature extraction purposes. The CWT expands a time series into a time-frequency space. In fact, the CWT is a desirable method to examine two time series together, which may be linked in some way. Furthermore, from the CWT, we can construct the Cross Wavelet Transform (XWT), which explores regions of very high common power and further reveals the phase relationship. Moreover, the Wavelet Transform Coherence (WTC), which is a measure of how coherent the cross wavelet is in time-frequency space, is calculated from two XWTs. Since our interest is to investigate the relationship between the electricity demand and the weather variables, we will use the WTC in this study.Several researchers have already applied the WA technique across many disciplines. Cazelles et al. (2008) applied the wavelet analysis to ecological time series [6]. In examining the relationship between the arctic oscillation index and Baltic maximum sea ice score,Grinstedet al.(2004) used the cross wavelet (XT) transform and Wavelet Transform Coherence (WTC) [7]. In addition, Labat (2010) found the correlation between freshwater discharge and some climate indices using the wavelet analysis [8]. However, in energy application, there is also a study regarding the use of wavelet analysis.Avdakovicet al.(2013) used both linear regression and WTC to study the properties of UK power consumption and found that the WTC approach provides insight into the properties of the impact of the main factors on power consumption [9]. Furthermore, Khoaet al.(2004);Senjyuet al.(2002);Zhanget al.(2010) successfully apply the wavelet analysis in conjunction with neural networks to forecast the electricity consumption [10–12]. Hence, in this study, we applied the WTC of examining the relationship between the electricity demand and the weather variables such as air temperature, relative humidity, solar radiation, and wind speed in Niamey.


## 2. Data and Methods

### 2.1. Data

In this study, the series of daily electricity demand for Niamey with the weather variables such as the air temperature, relative humidity, solar radiation, and wind speed have been used. Indeed, Niamey (13.28N, 2.11E) is the biggest city in Niger and consumes about 63% of the total electricity in Niger. It has a tropical climate with relatively colder dry winter (December-February) and Hot summer (March-June). The average maximum temperature ranges from 24°C to 45°C in summer months while the average minimum temperature is from 9°C to 33°C in winter months.The data spanned from January 2011 to November 2015. The electricity data are obtained from the national company of electricity of Niger (NIGELEC).Indeed, NIGELEC is the only company, which has the monopole of producing and distributing the electricity in the country. In addition to electricity data, we obtained the weather variables for automatic weather station in AGRHYMET for the same period. The AGRHYMET (Agronomy-Hydrology-Meteorology) automatic weather station aims at collecting very high resolution quality weather variables such as temperature, humidity, radiation, precipitation, wind speed, and so on that are relevant for the centre to conduct research in the area of agronomy, hydrology, and meteorology in benefit of state members.Figure1 shows the time series evolution (left panel) and the monthly climatology (right panel) of the electricity demand and the daily weather variables considered in this study. The time series of daily electricity demand in Niamey depicts both increasing trend and seasonal fluctuations. The latter is due to prevailing weather conditions while the former is a result of socioeconomic development. Regarding weather variables, they all depict seasonal variations. Indeed, the time series of daily temperature shows two peaks, one in May and the other in October. The minimum values are obtained during the months of January, August, and December. The minimum values in August are attributed to cloudy conditions while the ones in December and January are due to prevailing winter conditions. As far as relative humidity is concerned, only one peak is observed in August, which can be attributed to the high moisture flow from the Atlantic Ocean over Sahelian zone. As for solar radiation, we can observe maximum values of irradiation in March-June and minimum in August. The minimum values observed in August are mainly due to prevailing cloudy conditions [13, 14]. Finally, the time series of daily wind speed depicts also seasonal variation with maximum values recorded in June and minimum in November. The maximum values of wind speed could be attributed the onset of rainy season.Figure 1
Time series plot (left panel) and monthly climatology (right panel) of electricity demand, air temperature, humidity, radiation, and wind speed.


### 2.2. Methods

The methodological approach used in this study is the Wavelet Transform Coherence (WTC) and phase analysis. Indeed, the WTC and phase analysis allow us to illustrate efficiently the relationship between two times series.Equations (1) and (2) give the formulas of WTC and phase difference of x over y.(1)WTC=sWave.xy2sPower.x.sPower.y(2)Angleτ,s=Phasex-Phaseywhere the prefix s indicates the need of smoothing and angle (τ, s) indicates the phase difference between the two series.The phase difference between the two series provides information on the delays of oscillations between these series.An absolute value of the phase difference less (larger) thanπ/2 indicates that x and y are in phase (antiphase, respectively) referring to the instantaneous time as time origin and at period in question while the sign between the two phase difference shows which series is leading in the relationship. In this study, the x represents our influential factor while the y represents the electricity demand.The R package Wavelet Comp proposed by [15] is used to carry out the WTC and phase analysis of between electricity demand and temperatureThe phase differences and their interpretation are given in Table1.Table 1
Phase differences and their interpretations.
Phasex-Phasey Dependent Electricity demand [ 0 ,  π / 2 ] Leading Lagging [ π / 2 ,  π ] Lagging Leading [ - π ,  - π / 2 ] Leading Lagging [ - π / 2 ,  0 ] Lagging LeadingIn this study, the WTC is used to measure the intensity of the covariance of the two time series (temperature and electricity demand) in time-frequency space. The WTC ranges from 0 to 1 and it can be interpreted as the correlation coefficient. The closer the value is to one the more correlated are the two series [16].


## 2.1. Data

In this study, the series of daily electricity demand for Niamey with the weather variables such as the air temperature, relative humidity, solar radiation, and wind speed have been used. Indeed, Niamey (13.28N, 2.11E) is the biggest city in Niger and consumes about 63% of the total electricity in Niger. It has a tropical climate with relatively colder dry winter (December-February) and Hot summer (March-June). The average maximum temperature ranges from 24°C to 45°C in summer months while the average minimum temperature is from 9°C to 33°C in winter months.The data spanned from January 2011 to November 2015. The electricity data are obtained from the national company of electricity of Niger (NIGELEC).Indeed, NIGELEC is the only company, which has the monopole of producing and distributing the electricity in the country. In addition to electricity data, we obtained the weather variables for automatic weather station in AGRHYMET for the same period. The AGRHYMET (Agronomy-Hydrology-Meteorology) automatic weather station aims at collecting very high resolution quality weather variables such as temperature, humidity, radiation, precipitation, wind speed, and so on that are relevant for the centre to conduct research in the area of agronomy, hydrology, and meteorology in benefit of state members.Figure1 shows the time series evolution (left panel) and the monthly climatology (right panel) of the electricity demand and the daily weather variables considered in this study. The time series of daily electricity demand in Niamey depicts both increasing trend and seasonal fluctuations. The latter is due to prevailing weather conditions while the former is a result of socioeconomic development. Regarding weather variables, they all depict seasonal variations. Indeed, the time series of daily temperature shows two peaks, one in May and the other in October. The minimum values are obtained during the months of January, August, and December. The minimum values in August are attributed to cloudy conditions while the ones in December and January are due to prevailing winter conditions. As far as relative humidity is concerned, only one peak is observed in August, which can be attributed to the high moisture flow from the Atlantic Ocean over Sahelian zone. As for solar radiation, we can observe maximum values of irradiation in March-June and minimum in August. The minimum values observed in August are mainly due to prevailing cloudy conditions [13, 14]. Finally, the time series of daily wind speed depicts also seasonal variation with maximum values recorded in June and minimum in November. The maximum values of wind speed could be attributed the onset of rainy season.Figure 1
Time series plot (left panel) and monthly climatology (right panel) of electricity demand, air temperature, humidity, radiation, and wind speed.


## 2.2. Methods

The methodological approach used in this study is the Wavelet Transform Coherence (WTC) and phase analysis. Indeed, the WTC and phase analysis allow us to illustrate efficiently the relationship between two times series.Equations (1) and (2) give the formulas of WTC and phase difference of x over y.(1)WTC=sWave.xy2sPower.x.sPower.y(2)Angleτ,s=Phasex-Phaseywhere the prefix s indicates the need of smoothing and angle (τ, s) indicates the phase difference between the two series.The phase difference between the two series provides information on the delays of oscillations between these series.An absolute value of the phase difference less (larger) thanπ/2 indicates that x and y are in phase (antiphase, respectively) referring to the instantaneous time as time origin and at period in question while the sign between the two phase difference shows which series is leading in the relationship. In this study, the x represents our influential factor while the y represents the electricity demand.The R package Wavelet Comp proposed by [15] is used to carry out the WTC and phase analysis of between electricity demand and temperatureThe phase differences and their interpretation are given in Table1.Table 1
Phase differences and their interpretations.
Phasex-Phasey Dependent Electricity demand [ 0 ,  π / 2 ] Leading Lagging [ π / 2 ,  π ] Lagging Leading [ - π ,  - π / 2 ] Leading Lagging [ - π / 2 ,  0 ] Lagging LeadingIn this study, the WTC is used to measure the intensity of the covariance of the two time series (temperature and electricity demand) in time-frequency space. The WTC ranges from 0 to 1 and it can be interpreted as the correlation coefficient. The closer the value is to one the more correlated are the two series [16].


## 3. Results and Discussions

### 3.1. Relationship between Air Temperature and Daily Electricity Demand (DED)

Significant correlation exists between the DED and the temperature at different periods’ band in Niamey (Figure2) with in phase relationship. The most significant correlation between the DED and the temperature can be identified in the period 256-512 days period band with in phase relationship. In other words, a positive relationship does exist between the DED and the air temperature for a periodicity of 256-512 days, suggesting the strong seasonal relationship between the two variables. With a phase difference in the quadrant (0, π/2), the air temperature is leading the electricity demand. Moreover, in the period between 64 and 128 days, another significant coherence is also identified for the entire observed time horizon with in phase relationship. Furthermore, the average coherence of the two observed bands is greater than 0.8 suggesting a strong seasonal correlation between the air temperature and DED.Figure 2
WTC, phase analysis, and average coherence between the air temperature and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


### 3.2. Relationship between the Relative Humidity and Daily Electricity Demand

Figure3 shows the WTC, phase difference, and average coherence between the humidity and DED. For the entire time horizon, the significant coherence region is identified in the 256-512 days period band with antiphase relationship indicating negative correlation between the humidity and DED for a periodicity of 256-512 days. With arrows in the quadrant [-π/2,0], the humidity is lagging the DED in this region. Also, other significant regions are observed for specific period during the July-August of 2011, 2012, and 2013 for a periodicity of 8-64 days with antiphase relationship suggesting negative correlation between these two time series. Indeed, high humidity during these months is associated by low DED because of the low energy requirement as the temperature drastically decreases. The arrows are in the quadrant [π/2,π], indicating that for this period the humidity is leading the DED.Figure 3
WTC, phase analysis, and average coherence between the relative humidity and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


### 3.3. Relationship between the Radiation and Daily Electricity Demand

Figure4 shows the WTC, phase difference, and average coherence between the solar radiation and DED. The significant coherence region is observed for the 128-512 period bands with in phase relationship suggesting positive correlation between the radiation and the DED. With the phase difference in the quadrant [0,π/2], the radiation is leading the DED. In addition, the overall coherence in this band is higher (>0.7). Consequently, we can conclude that the radiation and the DED are strongly correlated for the 128-512 days period band.Figure 4
WTC, phase analysis, and average coherence between the solar radiation and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


### 3.4. Relationship between the Wind Speed and Daily Electricity Demand

Finally, the WTC, phase analysis, and average coherence of the wind speed and DED is shown in Figure5. Unlike the other variables there is not much coherence between the two time series. Only some random localized regions can be identified. The average coherence between the two time series is also weak (less than 0.5). Therefore, we can conclude that, on average, there is not significant coherency between the wind speed and DED in Niamey.Figure 5
WTC, phase analysis, and average coherence between the wind speed and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


## 3.1. Relationship between Air Temperature and Daily Electricity Demand (DED)

Significant correlation exists between the DED and the temperature at different periods’ band in Niamey (Figure2) with in phase relationship. The most significant correlation between the DED and the temperature can be identified in the period 256-512 days period band with in phase relationship. In other words, a positive relationship does exist between the DED and the air temperature for a periodicity of 256-512 days, suggesting the strong seasonal relationship between the two variables. With a phase difference in the quadrant (0, π/2), the air temperature is leading the electricity demand. Moreover, in the period between 64 and 128 days, another significant coherence is also identified for the entire observed time horizon with in phase relationship. Furthermore, the average coherence of the two observed bands is greater than 0.8 suggesting a strong seasonal correlation between the air temperature and DED.Figure 2
WTC, phase analysis, and average coherence between the air temperature and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


## 3.2. Relationship between the Relative Humidity and Daily Electricity Demand

Figure3 shows the WTC, phase difference, and average coherence between the humidity and DED. For the entire time horizon, the significant coherence region is identified in the 256-512 days period band with antiphase relationship indicating negative correlation between the humidity and DED for a periodicity of 256-512 days. With arrows in the quadrant [-π/2,0], the humidity is lagging the DED in this region. Also, other significant regions are observed for specific period during the July-August of 2011, 2012, and 2013 for a periodicity of 8-64 days with antiphase relationship suggesting negative correlation between these two time series. Indeed, high humidity during these months is associated by low DED because of the low energy requirement as the temperature drastically decreases. The arrows are in the quadrant [π/2,π], indicating that for this period the humidity is leading the DED.Figure 3
WTC, phase analysis, and average coherence between the relative humidity and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


## 3.3. Relationship between the Radiation and Daily Electricity Demand

Figure4 shows the WTC, phase difference, and average coherence between the solar radiation and DED. The significant coherence region is observed for the 128-512 period bands with in phase relationship suggesting positive correlation between the radiation and the DED. With the phase difference in the quadrant [0,π/2], the radiation is leading the DED. In addition, the overall coherence in this band is higher (>0.7). Consequently, we can conclude that the radiation and the DED are strongly correlated for the 128-512 days period band.Figure 4
WTC, phase analysis, and average coherence between the solar radiation and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


## 3.4. Relationship between the Wind Speed and Daily Electricity Demand

Finally, the WTC, phase analysis, and average coherence of the wind speed and DED is shown in Figure5. Unlike the other variables there is not much coherence between the two time series. Only some random localized regions can be identified. The average coherence between the two time series is also weak (less than 0.5). Therefore, we can conclude that, on average, there is not significant coherency between the wind speed and DED in Niamey.Figure 5
WTC, phase analysis, and average coherence between the wind speed and the daily electricity demand. The black lines show area with 95% of confidence while red and blue points depict the points of 5% and 10% significance level.


## 4. Conclusion

As part of the efforts to understand the relationship between the electricity demand and weather variables in Niger, this paper analyzes the relationship between the daily electricity demand and weather variables such as air temperature, relative humidity, solar radiation, and wind speed in Niamey using the wavelet analysis technique. The results are summarized as follows:(i)
The electricity demand in Niamey varies both seasonally and year to year. The latter is attributed to the socioeconomic development while the former is a result of weather fluctuations.(ii)
The weather variables present seasonal fluctuations with peaks and valleys. For instance, the air temperature indicated two peaks; one in May and another one in October and one dip in August. For the relative humidity, the maximum value is in August. Maximum values of solar radiation are in summer months (April-June) while the minimum are in winter months (December-February). As for the wind speed, a maximum wind is observed in June, corresponding to the onset of precipitation in Niamey.(iii)
A strong seasonal relationship is obtained between the DED and temperature, humidity, and solar radiation in the 256-512 periods. The arrows indicated that there is positive relationship between the DED and temperature and radiation while a negative relationship is shown between DED and humidity. As for wind speed, a very low coherence is observed though there is some very localized coherence.This works has permitted us to explore more efficiently the relationship between the daily electricity demand and weather variables in Niamey in more efficient ways. Unlike the simple correlation, which gives a general view of the relationship between two variables, the WTC technique permits us to explore the relationship between in time-frequency space. In addition, it also provides information on the variables, which is leading in the time series. These results from WTC and phase analysis are unlikely to be derived from a simple linear regression analysis. Therefore, it is necessary to include the temperature and relative humidity variables for the mid and long term planning and forecasting of electricity demand in Niamey.



---

*Source: 4974107-2019-01-02.xml*