A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
SEASONAL DYNAMIC FACTOR ANALYSIS AND SEASONAL DYNAMIC FACTOR ANALYSIS AND
BOOTSTRAP INFERENCE: APPLICATION TO BOOTSTRAP INFERENCE: APPLICATION TO
ELECTRICITY MARKET FORECASTINGELECTRICITY MARKET FORECASTING
Carolina García-Martos, María Jesús SánchezCarolina García-Martos, María Jesús Sánchez (Universidad Politécnica de Madrid)(Universidad Politécnica de Madrid)
Julio Rodríguez Julio Rodríguez (Universidad Autónoma de Madrid)(Universidad Autónoma de Madrid)
Andrés M. AlonsoAndrés M. Alonso (Universidad Carlos III de Madrid)(Universidad Carlos III de Madrid)
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
OUTLINE
1. Objectives and motivation
2. Methodology: Previous results
3. Seasonal Dynamic Factor Analysis (SeaDFA).
4. Bootstrap scheme for SeaDFA
5. Simulation results
6. Application: Forecasting electricity prices in the Spanish Market
7. Conclusions
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
1. Objectives
APPLICATION
Long-run forecasting of electricity prices in the Spanish market
METHODOLOGY
Extend nonstationary dynamic factor analysis to be able to reduce dimensionality in vector of time series with seasonality.
Common factors follow a multiplicative VARIMA model.
Inference for the parameters of the model by means of bootstrap techniques.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
2. Methodology. Previous results.
• García-Martos, C., Rodríguez, J. and Sánchez, M.J. (2007). Mixed model for short-run forecasting of electricity prices: Application for the Spanish market, IEEE Transactions on Power Systems.
• VARMA models for the 24 hours vector. Curse of dimensionality.
• Alonso, A.M., Peña, D. and Rodríguez, J. (2008). A methodology for population projections: An application to Spain.
• Take advantage of the common dynamics of the 24 hourly time series of electricity prices.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
2. Methodology of de DFA. Antecedents and previous results.
Dimensionality reduction
Alonso, A.M., García-Martos, C., Rodríguez, J. and Sánchez, M.J. (2008, working paper): Extension to the case in which common factors follow a multiplicative seasonal VARIMA model.
Bootstrap procedure to make inference on parameters of the SeaDFA.
Peña-Poncela Model (2004, 2006): Non-stationary Dynamic Factor Analysis.A priori test for the number of non-stationary and stationary factors.
Lee-Carter Model (1992). Demographic application.
Peña-Box Model (1987). Valid only for the stationary case.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
Methodology: Use Dynamic Factor Analysis to extract common dynamics of the vector of time series.
Particular case in which the vector of time series comes from a series with double seasonality.
Common and specific component of seasonality.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
yt vector of m time series, generated by set of r common unobserved factors.
ft is a vector of time series containing the r common factors.
Ω loading matrix that relates the vector of observed series yt ,with the set of unobserved common factors.
εt vector of specific components, m-dimensional, with zero mean and
diagonal variance-covariance matrix.
Common unobserved factors, ft , follow a multiplicative VARIMA model:
(1-Bs)Ds(1-B)d ft φ(B) Φ(Bs) = c + θ(B) Θ(Bs) ut
( ) , E( , ') if , E( , ') (diagonal)t t t t t t ty f E t S 0 0
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
Measurement and transition equations in the state-space:
State-space formulation is the natural way of writing down SeaDFA, which relates a m-dimensional vector of observed time series with an r-dimensional vector of unobserved common factors that follow a multiplicative seasonal VARIMA model.
t t t t
t t t t
x A B C
D F G
1
( ) , E( , ') if , E( , ') (diagonal)
( ) , E(u , ') if , E(u , ')t t t t t t t
t t t t t t t
y f E t S
f c f u E u u t u Q
1
0 0
0 0
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
Estimation of the model is performed by EM algorithm.
( ) , E( , ') if , E( , ') (diagonal)
( ) , E(u , ') if , E(u , ')t t t t t t t
t t t t t t t
y f E t S
f c f u E u u t u Q
1
0 0
0 0
Kalman filter and smoother
Log-likelihood LY(Θ)
Initialize procedure
j=1 E-step
M-step. Obtain Q, S, Ω, Φ, μ0, P0
0Convergence
Yes
END
No
j = j+1
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
Estimation of the model is performed by EM algorithm.
( ) , E( , ') if , E( , ') (diagonal)
( ) , E(u , ') if , E(u , ')t t t t t t t
t t t t t t t
y f E t S
f c f u E u u t u Q1
0 0
0 0
ln ln | | ( ) '( ) ( )
ln | | ( ) ' ( )
ln | | ( ) ' ( )
T T
T
t t t t t tt
T
t t t tt
L P f P f
T Q f f B Q f f B
T S y f S y f
0 0 10 0 0 0
11 1
1
1
1
2
The expression for the log-likelihood of complete data is:
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
EM ALGORITHM
E-step
Conditional expectation of log-likelihood:
( )ln | ,
ln | | (( ) ( )( ) ') ln | |
(( ' ' ') ( ) ')
ln | | ( ( )(
jT
T T
TT T
t tt
TT T
t t t tt
E L Y
P tr P f f T Q
tr Q S S S S f f T cc
T S tr S y f y f
1
0 0 10 0 0 0
111 10 10 00 1
1
1
1
2
2
) ' ')TtP
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
Where…
… are obtained from the Kalman filter and smoother
( )ln | ,
ln | | (( ) ( )( ) ') ln | |
(( ' ' ') ( ) ')
ln | | ( ( )(
jT
T T
TT T
t tt
TT T
t t t tt
E L Y
P tr P f f T Q
tr Q S S S S f f T cc
T S tr S y f y f
1
0 0 10 0 0 0
111 10 10 00 1
1
1
1
2
2
) ' ')TtP
,( ' ), ( ' ), ( ' )T T T
T T T T T T T T Tt t t t t t t t t t
t t t
S f f P S f f P S f f P10 1 1 10 11 1 1 11 1 1
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
3. Seasonal Dynamic Factor Analysis (SeaDFA).
EM ALGORITHM
M-step
Maximization of the conditional expection of log-likelihood (E-step).
Non-linear optimization procedure with non-linear constraints. Non linear restrictions appear between parameters involved in the seasonal multiplicative VARIMA model, i.e., between elements in .
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
4.1 Estimate SeaDFA, parameters involved are obtained:
.t t ty f
00 0 ˆ, , , , ,c S P
ˆ ˆvar( ),t tS S
4.2 The specific factors are calculated:
Here is important to introduce a correction for matrixestimation using the following relation:
4. Bootstrap scheme for SeaDFA
't tS E
where can be expressed by the estimated loads and the variance of the state variables.
ˆvar( )t t
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
4.5 Draw B resamples from the empirical distribution function of the standarized residuals of the VARIMA model for the common factors.
4.4 Calculate the residuals and correct them in the same way that it was done for , but bearing in mind that we impose , so:
/ /
ˆˆˆ( )t ts s1 2 1 2
t
ˆt ttu f f c1
4. Bootstrap scheme for SeaDFA
4.3 Draw B resamples from the empirical distribution function of the centered and corrected specific factors:
Q I
1 2 / ( )t t
uu Q u u
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
4. Bootstrap scheme for SeaDFA
4.6 Generate B bootstrap replicas of the common factors using the transition equation:
4.7 Generate B bootstrap replicates of the SeaDFM using the bootstrap replicas of the common and specific factors obtained in steps 4.3 and 4.6:
1 * * *ˆ .t t tf c f u
* * * .t t ty f
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
Inference is based on percentiles obtained from the bootstrap distribution functions of the parameters involved.
* **
*, , andc S
4. Bootstrap scheme for SeaDFA
From estimating the SeaDFA for each one of the B replicas obtained in step 4.7, we obtain the estimated bootstrap distribution functions of:
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
4. Bootstrap scheme for forecasting
Bootstrap procedure described is modified to replicate the conditional distribution of future observations given the observed vector of time series.
For each specific and common factor the corresponding last observations are fixed.
, , ,t tf
1
*** * * *, if t
tT h T h T h tf c f u f f T
*
* * * .T h T h T hy f
and the future bootstrap observation are generated by
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
5. Simulation results
Bootstrap procedure was validated using a Monte Carlo experiment using three different models:
Model 1: A common nonstationary factor (1-B)ft = c + wt, i.e. an I(1) with non null drift (c=3), for m=4 observed series.
This model has been selected because it appears in Peña and Poncela (2004), and we have added the constant to validate its estimation, since we have included this possibility in our model.
Model 2: A common nonstationary factor (1-B)(1-0.5B) ft = wt, for m=3 observed series.
Model 3: We check the performance of our procedure when there is a seasonal pattern. There is a common nonstationary factor following a seasonal multiplicative ARIMA model (1-B7)(1-0.4B)(1-0.15B7)ft = wt, for m=4 observed series.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
5. Simulation results for Model 1
Lag Sample size Series CM (se) Cov (below) Cov (above) LT LM (se)h T m 2,5% 2,5%
1 50 1 93,16 0,33 2,99 3,85 5,56 5,51 0,04
2 93,38 0,26 2,66 3,96 5,52 5,54 0,04
3 92,90 0,30 2,68 4,42 5,55 5,49 0,04
4 92,85 0,32 2,79 4,37 5,54 5,50 0,04
100 1 93,32 0,24 3,28 3,39 5,55 5,51 0,03
2 93,50 0,30 3,30 3,21 5,54 5,56 0,03
3 93,48 0,24 3,34 3,18 5,53 5,55 0,03
4 93,48 0,27 3,43 3,09 5,53 5,52 0,03
3 50 1 94,12 0,19 2,47 3,40 7,85 7,82 0,04
2 93,96 0,20 2,54 3,50 7,83 7,84 0,05
3 93,79 0,17 2,35 3,86 7,80 7,79 0,03
4 94,01 0,19 2,45 3,54 7,85 7,84 0,05
100 1 93,93 0,19 2,79 3,29 7,84 7,78 0,04
2 94,15 0,17 2,94 2,91 7,85 7,85 0,04
3 94,08 0,16 3,02 2,90 7,85 7,85 0,04
4 93,98 0,18 3,03 2,99 7,84 7,81 0,04
Theoretical 95%
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
5. Simulation results for Model 2
Lag Sample size Series CM (se) Cov (below) Cov (above) LT LM (se)h T m 2,5% 2,5%
1 50 1 91,84 0,68 3,72 4,18 5,56 5,87 0,08
2 91,70 0,64 3,73 4,43 5,57 5,88 0,08
3 92,17 0,55 3,58 4,08 5,54 5,85 0,08
100 1 92,12 0,47 3,48 4,92 5,56 5,67 0,05
2 92,50 0,58 3,69 4,23 5,57 5,76 0,05
3 92,19 0,56 3,19 4,56 5,54 5,71 0,05
3 50 1 92,12 0,42 3,76 4,03 10,21 10,03 0,12
2 92,15 0,43 3,97 3,96 10,21 10,05 0,13
3 92,41 0,39 3,64 3,75 10,17 10,09 0,13
100 1 93,80 0,23 2,98 3,80 10,21 10,24 0,08
2 93,74 0,23 2,95 3,42 10,21 10,37 0,08
3 93,42 0,27 3,08 3,53 10,17 10,26 0,09
Theoretical 95%
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
5. Simulation results for Model 3
Lag Sample size Series CM (se) Cov (below) Cov (above) LT LM (se)h T m 2,5% 2,5%
1 50 1 91,84 0,50 3,68 4,48 5,55 5,50 0,052 91,60 0,46 3,86 4,55 5,55 5,40 0,043 91,39 0,41 4,03 4,59 5,54 5,36 0,054 91,84 0,45 3,87 4,29 5,54 5,41 0,05
100 1 90,99 0,47 5,00 4,01 5,51 5,31 0,042 91,18 0,39 4,83 4,00 5,52 5,31 0,033 91,32 0,36 4,67 4,01 5,55 5,31 0,044 91,00 0,37 4,94 4,06 5,58 5,27 0,04
3 50 1 91,69 0,46 4,08 4,23 5,76 5,62 0,052 91,30 0,46 4,40 4,30 5,81 5,56 0,053 90,87 0,44 4,63 4,51 5,82 5,51 0,044 91,04 0,43 4,47 4,49 5,83 5,53 0,05
100 1 92,07 0,34 4,03 3,90 5,78 5,55 0,042 92,03 0,31 4,30 3,68 5,81 5,56 0,043 91,58 0,29 4,30 4,13 5,82 5,48 0,054 91,94 0,30 4,09 3,97 5,80 5,53 0,04
Theoretical 95%
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
Long-run forecasting in the Spanish market.
Compute forecasts for year 2004 using data from January 1998 to December 2003.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
VARIMA(1,0,0)x(1,1,0)7 model with constant for the common factors.
, ,
, ,
t t
t t
f ucI B I B I B
f uc
1 1111 112 111 112 17 7
2 2121 122 121 122 2
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
Inference using the bootstrap scheme described implies that Constants are not significant.
The model is re-estimated including these constraints.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
Inference using the bootstrap scheme described implies that Φ121 not significant .
The model is re-estimated including this constraint.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
Estimated loading matrix:
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
Forecasts for the whole year 2004, using data from 1998-2003. Forecasting horizon varying from 1 day up to 1 year.
MAPE for the whole year is 21.56%.
Relationship with short-run forecasting MAPE (one-day-ahead). MAPE is around 13-15%.
The mixed model of García-Martos et al (2007) obtained a short-run forecasting MAPE equal to 12.61%.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish MarketMAPE for the whole year is 21.56% with SeaDFM and 45.62% with the
Mixed Model.
SeaDFA DFA (2004) Mixed model (2007)MAPE(%) MAPE(%) MAPE(%)
January 2004 25.02 23.86 31.9February 2004 18.61 21.93 35.72March 2004 23.55 24.57 46.2April 2004 20.3 34.41 39.42May 2004 18.96 33.68 41.82June 2004 19.36 29.77 45.31July 2004 20.6 33.6 46.52August 2004 14.55 31.7 45.72September 2004 25.39 25.48 53.36October 2004 18.44 25.84 51.94November 2004 23.26 26.21 52.92December 2004 30.67 27.09 56.59
Year 2004 21.56 28.18 45.62
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
Third week of February 2004, MAPE 16.38%.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
24th-30th May 2004, prediction intervals including uncertainty due to parameter estimation
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
6. Application: Forecasting electricity prices in the Spanish Market
20th-26th December 2004, prediction intervals including uncertainty due to parameter estimation
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
7. Conclusions
Extension of the Non-Stationary Dynamic Factor Model to the case in which the common factors follow a multiplicative VARIMA model with constant.
Constant included by means of an exogenous variable. Extension to the case in which there are exogenous variables in the SeaDFA is straightforward.
Bootstrap procedure to make inference and forecasting. Valid for all models that can be expressed under state-space formulation.
MAPE around 20% for year ahead forecasts of electricity prices. Most previous works obtain around 13% for one-day-ahead forecasts.
A.M. Alonso, C. García-Martos, J. Rodríguez, M. J. Sánchez
Seasonal dynamic factor model and bootstrap inference: Application to electricity market forecasting
SEASONAL DYNAMIC FACTOR ANALYSIS AND SEASONAL DYNAMIC FACTOR ANALYSIS AND
BOOTSTRAP INFERENCE: APPLICATION TO BOOTSTRAP INFERENCE: APPLICATION TO
ELECTRICITY MARKET FORECASTINGELECTRICITY MARKET FORECASTING
Carolina García-Martos, María Jesús SánchezCarolina García-Martos, María Jesús Sánchez (Universidad Politécnica de Madrid)(Universidad Politécnica de Madrid)
Julio Rodríguez Julio Rodríguez (Universidad Autónoma de Madrid)(Universidad Autónoma de Madrid)
Andrés M. AlonsoAndrés M. Alonso (Universidad Carlos III de Madrid)(Universidad Carlos III de Madrid)