Lecture 8,9 - STLF - Part 1
Lecture 8,9 - STLF - Part 1
Lecture 8,9 - STLF - Part 1
Forecasting
Generalities
` Short-Term Load Forecasting (STLF) is the starting point of the daily energy
supply routine required for power system operation
` STLF has become increasingly important since the rise of the competitive
energy markets
` STLF is based on statistical procedures that use past load values and
exogenous variables to forecast the short-term power demand and
electricity price
` The use of the STLF begun around 1920 and grew up rapidly, employing at
first classic statistical methods
2
Generalities …
` Artificial Neural Networks (ANN) were first proposed in the sixties, and after
some initial criticism, quickly gained popularity in several fields
` In fact, STLF was the first application of neural networks in the field of
Power Systems (late eighties)
3
Basic concepts of
Load Forecasting
5
Time horizon of the electric load forecasting
6
Long-term load forecasting
7
Medium-term load forecasting
8
Methods for Long and Medium term load forecasting
` Econometric models
− estimate the relationship between the energy consumption and
the economic factors that influence the energy consumption
− combine economic theory and statistical techniques (linear
regression or time series methods)
9
Short-term load forecasting
10
Importance
p of the STLF
` STLF is also required to estimate the power flows for the on-line
security assessment.
assessment It helps to make decisions that prevent
overloading, particularly in the deregulated energy market
11
Italian daily load profile and forecast (Aug 27, 2012)
12
The profile of the electric load depends on:
` Social habits
` Work organization
13
Electric load as a time series
y ( t ) = f ( yt −1 , yt − 2 ,…) + g ( et , et −1 , et − 2 ,…) + ε ( t )
where:
14
Characteristics of the load time series
` Cyclicity:
y y repetition
p of similar load p
patterns ((weekdays,
y , Saturday,
y,
Sunday) with weekly periodicity
` Anomalous days:
y holidays,
y bank holidays
y and days y between close
holidays, where the load shape is most irregular
15
Available load time series: AEM
Azienda Energetica
g Municipale
p TORINO (AEM)
( )
` small electric utility (now IREN) that supplies the area of Torino
` values in MW
16
Available load time series: ISONE
` values in MW 2.5
05
0.5
17
Some features of the load profile
p
` Seasonal dependence
18
Typical daily load curve (ISONE)
4
x 10
21
2.1
1.9
1.8
1.7
1.6
1.5
1.4
1.3
12
1.2
0 5 10 15 20 25
19
Load profiles of weekdays, Saturday and Sunday (AEM)
Mon.
Sat.
Sun.
2.1 Mon
Mon.
2 Sat.
Sun.
1.9
1.8
1.7
1.6
1.5
1.4
1.3
12
1.2
0 20 40 60 80 100 120 140 160 180
21
Effects of the anomalous days (New Year’s Day, Epiphany)
22
Effects of the anomalous days (Thanksgiving)
4
x 10
2
19
1.9
1.4
1.3
1.2
1.1
1
0 20 40 60 80 100 120 140 160 180
23
Seasonal dependence (AEM)
24
Seasonal dependence (ISONE)
4
x 10
2.8
2.6
2.4
22
2.2
1.8
1.6
1.4
1.2
0.8
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
25
Similarity between corresponding weeks of different years (AEM)
Mon. Tue.
Sun.
— 1995
— 1996
AEM 2
AEM. 2nd
d week
k off 1995 and
d 1996
26
Similarity between corresponding weeks of different years (ISONE)
4
x 10
2.2
Mon
Tue
2
Sun
1.8
— 2006
— 2007 1.6
6
1.4
1.2
1
0 20 40 60 80 100 120 140 160 180
2
Sun
— June 2006
— Jan.
Jan 2007
1.5
1
0 20 40 60 80 100 120 140 160 180
` Exogenous variables
− weather conditions (temperature, humidity, cloudiness, wind speed)
− clock and calendar variables (time of day
day, day of week)
29
Dependence on the past load values
` D
Darbellay
b ll and
d Slama
Sl (“F
(“Forecasting
ti th short-term
the h tt d
demand d for
f
electricity: do neural networks stand a better chance?”, 2000)
assessed that the total correlation with the past values is the sum of
a linear component and a (small) non-linear component
` They
y introduced a new complexp non-linear correlation coefficient
and assessed the difference with the usual linear correlation
30
Dependence
p on temperature
p and weather variables
38
Hourly load and hourly temperature time series (ISONE 2006)
4
x 10
3
2.5
2
MW
1.5
1
— hourly load 0.5
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
80
temperature
60
°F
40
20
0
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
39
Load forecasting
g methods and algorithms
g
44
Similar day approach
45
Similar day approach: an example of “naïve forecast”
4
x 10
1.8
1.7
1.6
1.5
MW1.4
— actual
1.3
— forecast 1.2
1.1
1
0 5 10 15 20 25
46
Least squares
q regression
g
47
Time series models
where Xi is the load time series, εi the error time series, ϕ and ϑ the
regression parameters
` The parameters are estimated by linear regression, but the model
formulation is not a simple task
` Classic method used by many electric utilities
48
Neural networks
` Realistic target values for the MAPE error are now 2.5% (24-
hours-ahead)) and 1.5% ((1-hour-ahead))
49
Support
pp vector machines
` In the last years SVMs have gained large popularity in the field of
STLF
50
Fuzzyy logic
g
` Generalization, p
proposed
p by
y Lotfi Zadeh in 1965, of the Expert
p
Systems (Boolean logic)
` Under fuzzy logic, inputs are not exactly known but only defined
within
ithi a certain
t i range
` A set of user-defined fuzzy rules transforms fuzzy inputs in outputs,
so fuzzy logic can be also considered a technique for mapping
inputs to outputs.
` Unlike neural networks, fuzzy logic allows to explain the input-output
relationship
l ti hi
` However, in many cases fuzzy rules are learned from examples, like
in neural networks, and the explanatory capabilities are lost (neuro
(neuro-
fuzzy techniques)
51
Some experiments of STLF using linear regression
52
AEM data set
` Each file contains a matrix with 4 columns (features) and 8760
rows (hourly observations)
53
ISONE data set
` Each file contains a matrix with 6 columns (features) and 8760
rows (hourly observations)
54
Example of records from ISONE 2006 data set
55
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Selection of the independent
p variables ((regressors)
g )
` Autoregressive
g q
quantities:
− hourly loads of 1-2 previous days
− hourly loads of the corresponding day a week before
− hourly loads of the corresponding day a year before
` Clock and calendar quantities (hour and day number)
56
Autocorrelation analysis of a load time series (AEM 1995 – all days )
0.8
0.6
0.4
0.2
-0
0.2
2
0 20 40 60 80 100 120 140 160 180
Th correlation
The l ti reaches
h its
it maximum
i values
l every 24 h
hours
57
Autocorrelation analysis of a load time series (AEM 1995 – working days only)
0.8
0.6
0.4
02
0.2
-0.2
-0.4
0 20 40 60 80 100 120 140 160 180
M
More correlation
l ti b between
t allll d
days
58
Correlation analysis shows that:
` The most correlated past hourly loads are lags: -1, 1 -24,
24 -48,
48 -72,
72
-23, -25, with correlation coefficient from 0.98 to 0.91
` Maximum correlation (0
(0.98)
98) occurs every 24 hours (lag –24)
24)
` Hourly loads at lag -1, lag -23 and lag - 25 present high
correlation values (about 00.92)
92)
` Nearest hourly loads (e.g. lag –23 and lag –24) show high
mutual correlation
59
Choice of the model and assemblage of the data set
60
Least squares
q regression
g equations
q
y = X h + ε → h = ( X X ) XT y = X† y
−1
ˆ T
yˆ = X hˆ
where:
– N: number of observations
yˆ : N ×1 estimated targets
– M: number of regressors
g
– y: N x 1 target load values hˆ : M ×1 estimated parameters
– X: N x M regressor matrix (past load values)
X† :M ×N pseudoinverse of X
– h: M x 1 pparameters
–
ε: N x1 normally distributed random noise
61
AEM 1995 data set (weekdays only): 24
24-hours-ahead
hours ahead forecast
` Parameter estimation
– Data set composed by 4 weeks of 5 weekdays each, from week 3
to week 6 of 1995 ((hourlyy loads from Mon.,, Jan. 16 to Fri.,, Feb. 10))
– Offset of 2 weeks
eeks (first 10 weekdays
eekda s – 120 hours)
ho rs) to avoid
a oid the
holiday period after the New Year’s day
` Forecast
– The five weekdays of the following 7th week (120 hourly loads from
Mon. Feb. 13 to Fri. Feb. 17)
62
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Building the regressor matrix
63
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
The corresponding MATLAB code
64
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Regressor matrix X (first 10 rows)
65
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Estimation of the regression parameters
The next step is to estimate the regression parameters by using the Moore-
Penrose pseudoinverse function pinv of MATLAB. Remember that we must
have N (number of observations) much greater than M (number of parameters),
otherwise the problem is ill-conditioned.
Finally, we plot the results and calculate the MAPE error. Here is the MATLAB
code
code:
plot(Y)
l t(Y) % plotting
l tti actual
t l and
d estimated
ti t d ttargett
hold % vectors
p ( , )
plot(YE,'r')
mape (YE,Y) % evaluation of the error (MAPE)
66
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Parameter estimation – 24-hours-ahead
— actual
— estimated
MAPE = 3.28%
Hourly load from Mon, Jan 16 to Fri, Feb 10 1995 (weekdays only)
67
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Forecast of the five following
g weekdays
y
` Usingg the p
previously
y estimated regression
g p
parameters we
forecast now the 5 weekdays of the following 7th week
` The p
parameters have been estimated on the hourly
y interval from
# 241 to # 720 (4 weeks, weekdays only)
` The range of the forecast is now from Mon Feb 13, 1995 to Fri
Feb 17,
17 1995 (hourly interval from # 721 to # 840)
68
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Forecast of the five following
g weekdays
y ((MATLAB code))
first = 240+480+1; % new input set (120 hourly loads)
last
ast = 240+480+120;
0 80 0;
x = [ ];
for lag = 24:48, % compose the matrix of the
x = [x xl(first
xl(first-lag:last-lag)];
lag:last lag)]; % past load regressors
end
xd = data(first:last, 2); % day calendar number regressor
xh = data(first:last, 3); % hour clock number regressor
X = [x xh xd]; % regressor X (120x27) matrix
Y = xl(first:last); % target Y (120x1) vector
YE = X*H; % forecasted target vector YE (120x1)
plot(Y), hold, plot(YE,'r‘) % plotting actual and estimated target
% vectors
mape (YE,Y) % evaluation of the error (MAPE)
69
Neural methods for Short-Term Load Forecasting - F. Piglione, 2012
Forecast of the five following
g weekdays
y ((results))
— actual
— forecast
MAPE = 3.59%
Hourly load from Mon, Feb 13 to Fri, Feb 17 1995 (weekdays only)
70
Forecast error (residual)
( )
Error
parameters:
MaxAE = 23 MW
MinAE = 0.3 MW
MAE = 6.4 MW
71
Error analysis
− the autocorrelation of the residual for all lags must be low ⇒ no further
regressors are available
72
Tests for assessing
g the normality
y of the residual
` Lilliefors test
Estimates the mean and the variance of the sample and makes a
comparison
i with
ith theoretical
th ti l values
l from
f a normall distribution
di t ib ti
73
Error analysis (1)
Correlation between residual and regressors
74
Error analysis (2)
Autocorrelation of the residual
75
Error analysis (3)
Histogram with normal fit
14
12
10
0
-1.5 -1 -0.5 0 0.5 1 1.5
76
Error analysis (4)
Normal probability plot
` The availability
y of some regressor
g inside the time window
between lag –1 and lag –24 could increase the quality of the
forecast
78
ISONE 2006 data set (all days): 1
1-hour-ahead
hour ahead forecast
` Let’s
Let s try now an example of 1
1-hour-ahead
hour ahead forecast using the
ISONE 2006 data set (all days)
79
Parameter estimation: MATLAB code
load NE2006 %load ISONE 2006 data set
xl = NE2006(:,6); % hourly loads
xtemp = NE2006(:,4); % dry bulb temperature
xdp = NE2006(:,5); % dew point temperature
hh = NE2006(:,2); % hour of day
dd = NE2006(:,3); % day of week
80
Parameter estimation: MATLAB code …
81
Parameter estimation – 1-hour-ahead
4
x 10
2.2
1.8
— actual
— estimated 1.6
1.4
MAPE = 1.04%
12
1.2
1
0 100 200 300 400 500 600 700
Hourly load from Tue, Jan 3, 2006 to Mon, Jan 30 2006 (ISONE)
Short-Term Load Forecasting -F. Piglione, 2012
82
Forecast of the following week (MATLAB code)
first = 48+672+1; % following 5th week (hourly loads)
last = 48+672+168;
x = [];
for lag = 1:24,
x = [x xl(first
xl(first-lag:last-lag)];
lag:last lag)];
end
lag=1; xt1 = xtemp(first-lag:last-lag);
lag=1; xp1 = xdp(first-lag:last-lag);
xh = hh(first:last);
xd = dd(first:last);
( );
X = [x xh xd xt1 xp1];
Y = xl(first:last);
YE = X*H; % forecast
mape (YE,Y) % evaluation of the error (MAPE)
83
Forecast of the following week
4
x 10
2
19
1.9
1.8
1.7
— actual 1.6
— forecast 1.5
14
1.4
1.3
1.1
1
0 20 40 60 80 100 120 140 160 180
Hourly load from Tue, Jan 31, 2006 to Mon, Feb 6, 2006 (ISONE)
Short-Term Load Forecasting -F. Piglione, 2012
84
Error analysis (1)
Correlation between residual and regressors
residual/regressors correlation
01
0.1
0.08
0.06
n coefficient
0.04
correlation
0.02
-0.02
0 5 10 15 20 25 30
⇒ no significant
g correlation exists
85
Error analysis (2)
Autocorrelation of the residual
residual autocorrelation
06
0.6
0.4
n coefficient 0.2
0
correlation
-0.2
-0.4
-0.6
-0.8
0 10 20 30 40 50 60 70 80 90
⇒ no significant
g autocorrelation exists
86
Error analysis (3)
Histogram with normal fit
14
35
12
30
10
25
20
8
15
6
10
4
2
5
0
-0.8
-1.5 -0.6-1 -0.4-0.5 -0.2 0 0 0.5 0.2 10.4 1.5
0.6
87
Error analysis (4)
Normal probability plot
Normal Probability Plot
0 997
0.997
0.99
0.98
0.95
0 90
0.90
0.75
obability
0.50
Pro
0.25
0.10
0.05
0.02
0.01
0.003
-1200
1200 -1000
1000 -800
800 -600
600 -400
400 -200
200 0 200 400 600
Data
89
Linear regression
g examples:
p conclusions
` The 24-hours-ahead
24 hours ahead forecast made with regression analysis
gives unsatisfactory results in both time series (MAPE from 3%
to 5%)
` The main limit of the method lies in the linear combination of the
time series
series. A non-linear
non linear combination would be more flexible
90