You are on page 1of 8

A Novel 2-D Model Approach for the Prediction

of Hourly Solar Radiation

F. Onur Hocaoglu, O. Nezih Gerek, and Mehmet Kurban

Anadolu University, Dept. of Electrical and Electronics Eng., Eskisehir, Turkey


{fohocaoglu,ongerek,mkurban}@anadolu.edu.tr

Abstract. In this work, a two-dimensional (2-D) representation of the


hourly solar radiation data is proposed. The model enables accurate fore-
casting using image prediction methods. One year solar radiation data
that is acquired and collected between August 1, 2005 and July 30, 2006
in Iki Eylul campus of Anadolu University, and a 2-D representation is
formed to construct an image data. The data is in raster scan form, so
the rows and columns of the image matrix indicate days and hours, re-
spectively. To test the forecasting eciency of the model, rst 1-D and
2-D optimal 3-tap linear lters are calculated and applied. Then, the
forecasting is tested through three input one output feedforward neu-
ral networks (NN). One year data is used for training, and 2 month(from
August 1,2006 to September 30,2006) for testing. Optimal linear lters
and NN models are compared in the sense of root mean square error
(RMSE). It is observed that the 2-D model has advantages over the 1-
D representation. Furthermore, the NN model accurately converges to
forecasting errors smaller than the linear prediction lter results.

1 Introduction
The prediction of hourly solar radiation data has important consequences in
many solar applications. Such data can be regarded as a time series and its
prediction depends on accurate modeling of the stochastic process. The compu-
tation of the conditional expectation, which is in general non-linear, requires the
knowledge of the high order distribution of the samples. Using a nite data, such
distributions can only be estimated or t into a pre-set stochastic model. Meth-
ods like AutoRegressive (AR) [1] prediction, Markov chains [2,4] and ARMA
model [3] for designing the non-linear signal predictors are examples to this ap-
proach. The neural network (NN) approach also provides a good to the problem
by utilizing the inherent adaptive nature. Since NNs can be trained to predict
results from examples, they are able to deal with nonlinear problems. Once
the training is complete, the predictor can be set to a xed value for further pre-
diction at high speed. A number of researchers have used NN for prediction of
hourly global solar radiation data. In these works, the data is treated in its raw
form as a 1-D time series, therefore the inter-day dependencies are not exploited.
This paper introduces a new and simple approach for hourly solar radiation
forecasting. First, the data are rendered in a matrix to form a 2-D image-like

F. Sandoval et al. (Eds.): IWANN 2007, LNCS 4507, pp. 749756, 2007.

c Springer-Verlag Berlin Heidelberg 2007
750 F.O. Hocaoglu, O.N. Gerek, and M. Kurban

model, as explained in Section 2. As a rst attempt to test the 2-D model


eciency, optimal linear image prediction lters [5] are constructed in Section 3.
In order to take into account the adaptive nature for complex and non-stationary
time series, neural networks are also applied to the forecasting problem in Section
4. The training algorithms for feed forward neural networks are also discussed
briey in this Section. In Section 5, the prediction (forecasting) results that
are obtained from both optimal linear lters and neural network models are
presented.

2 The 2-D Representation of Solar Radiation Data


The collected hourly solar radiation data is a 1-D discrete-time signal. In this
work, we render this data in a 2-D matrix form as given in equation 1.

x11 . . . x1n

Rad = ... . . . ... (1)
xm1 xmn

where the rows and columns of the hourly solar radiation matrix indicate days
and hours, respectively. Such 2-D representation provides signicant insight
about the radiation pattern with time. The informational insight is apparent
from the sample surface-plots and image visualizations (in gray-scale) presented
in Figures 1 and 2.

600

500

400
Solar Radiation(W/m2)

300

200

100

0
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
Hours

Fig. 1. Plot of hourly solar radiation data

Although the surface-plot provides an intuitive information, the 2-D gray-


scale image interpretation enables tools that can be borrowed from the well
established image processing world. By inspecting the image version of the data
in Fig. 3, it is easy to interpret daily and seasonal behavior of solar radiation.
Dark regions of the image indicate that there is no sun shine on horizontal sur-
face. The transition from black to white indicates that solar radiation fall on
horizontal surface is increasing or decreasing. During winter time, the dawn to
A Novel 2-D Model Approach for the Prediction of Hourly Solar Radiation 751

600

500

Solar radiation(W/m )
2
400

300

200

100

0
400

300 25
20
200 15
100 10
5
0 0
Day
Hour

Fig. 2. Plot of hourly two dimensional solar radiation data

dusk period is shorter, producing a narrower protruding blob. Conversely, the


white blob is wider during summer times, indicating that the day-time is longer.
The width behavior of the white blob clearly indicates the seasonal changes of
sun-light periods. The horizontal and vertical correlations within the 2-D data
is quite pronounced. This implies that, given the vertical correlation among the
same hours of consecutive days, it is benecial to use 2-D prediction for hourly
forecasting. The prediction eciency of the proposed model is illustrated with
2-D optimum linear prediction lters and neural networks.

350

300

250

200

150

100

50

0 5 10 15 20 25

Fig. 3. Image view of solar radiation data

3 Optimal 2-D Linear Prediction Filter Design


Due to predictive image coding literature, it is known that a 2-D matrix can be
eciently modeled by linear predictive lters. The prediction domain is a free
752 F.O. Hocaoglu, O.N. Gerek, and M. Kurban

parameter determined according to the application. Consider a three coecient


prediction lter structure as given in expression 2:

xi,j xi,j+1
(2)
xi+1,j xi+1,j+1 =?

The linear lter coecients: a1 , a2 and a3 are optimized, and the prediction
result xi+1,j+1 is estimated as

xi+1,j+1 = a1 xi,j + a2 xi,j+1 + a3 xi+1,j . (3)

The prediction error for this term is:

i+1,j+1 = xi+1,j+1 xi+1,j+1 . (4)

The total error energy corresponding to the whole image prediction can be cal-
culated as:
m  n
= 2ij (5)
i=1 j=1

where m and n correspond to the width and height of the image, which are, for
the solar data, 365 and 24, respectively. The lter coecients that minimize this
function can be found from the solution of the minimization derivative equation:

= = =0 (6)
a1 a2 a3
The solution to equation 6 yields the following matrix-vector equation:

R11 R12 R13 a1 r1
R21 R22 R23 a2 = r2 (7)
R13 R23 R33 a3 r3

which is compactly written as R a = r, so the optimal lter coecients can be


obtained as
a = R1 r (8)
where a contains the lter tap coecients, r includes the correlation of the
target pixel to the prediction template, and R includes correlation within the
prediction template [5]. Similar analysis holds for 1-D prediction, as well. The
performance comparisons of various sizes of 2-D prediction are presented in Sec-
tion 5. The results indicate that by using larger prediction templates, better
prediction performance can be achieved.

4 Learning Techniques of Feed Forward NNs


An alternative method to exploit the proposed 2-D representation is to use
adaptive methods that converge to a global predictor for the solar radiation
A Novel 2-D Model Approach for the Prediction of Hourly Solar Radiation 753

data. There are several techniques to achieve high speed NN algorithms. Among
these techniques, heuristic techniques were developed from an analysis of the
performance of the standard steepest descent algorithm. Among the category
of fast algorithms, the methods use standard numerical optimization techniques
such as conjugate gradient, quasi-Newton, and Levenberg-Marquard. The basic
back propagation algorithm adjusts the weights in the steepest descent direction.
It turns out that, although the function decreases most rapidly along the negative
of the gradient, this does not necessarily produce the fastest convergence. In the
conjugate gradient algorithms a search is performed along conjugate directions,
which produces generally faster convergence than steepest descent directions.
Newtons method is an alternative to the conjugate gradient methods, which often
converges faster. As a drawback, the method is complex and expensive for its the
Hessian matrix calculation in feed forward neural networks. The computationally
simpler quasi-Newton methods do not require calculation of second derivatives.
Similarly, the Levenberg-Marquardt algorithm was also designed to approach
second-order training speed without having to compute the Hessian matrix [6].
Since Levenberg-Marquardt algorithm supplies faster convergence it is adopted
and used in this study.

5 Experimental Results

In order to reduce computational complexity and to focus to the proposition,


relatively short 1-D and 2-D prediction lters are used in this work. The lter
templates are given in Fig. 4. These templates are also widely used in predictive
image and signal coding.

1D predict. temp. 2D predict. temp.

x 11 x 12 .x.13. . . x 1n x 11 x 12 . . . . . x 1n
.
. x 22 . x 21 x 22 .
. .
. . . .
. .
x m1 . . . x mn x m1 . . . x mn

Fig. 4. 1-D and 2-D prediction templates used for modeling the image

For the minimum RMSE linear prediction, the optimal coecients are analyt-
ically determined by solving Eq. 8. The 2-D image data is fed to the prediction
system, and error gures are obtained for each hour. The error gure for 2-D
3-tap optimum lter is given in Fig. 5.
As a second step prediction model, two neural network structures given in
Fig. 6 are applied to the data. In the rst structure, the input is treated as
1-D, and the input network elements are i th , i+1 th and i+2 th elements of the
754 F.O. Hocaoglu, O.N. Gerek, and M. Kurban

400

200

Error
200

400

600
400
300 25
20
200 15
100 10
5
Day 0 0
Hour

Fig. 5. Error image obtained from 2-D optimal linear lter

NN2-2D NN1-1D NN1-1D NN2-2D


inputs inputs output output
Rad (i, j) C(i)

C(i+1) C(i+3) Rad (i+1, j+1)


Rad (i+1, j)

Rad (i, j+1) C(i+2)

Input Layer Hidden Layer Output Layer

Fig. 6. The ANN structure

data, where the output is the i+3 th element for each sample in the data. In the
second structure, the proposed 2-D image matrix form is used. The inputs of the
networks are i,j th , i+1,j th and i,j+1 th elements of the 2-D data matrix and the
output is i+1,j+1 th element of the data matrix for each i and j. For each case,
1/6 of the hourly solar radiation data (2 months) is used for training.

600

500
Solar radiation(W/m2)

400

300

200

100

0
0

20

40 0
5
60 10
15
20
80 25
Day Hour

Fig. 7. The test data


A Novel 2-D Model Approach for the Prediction of Hourly Solar Radiation 755

400

200

Error
0

200

400
60
25
40 20
15
20 10
5
Day 0 0
Hour

Fig. 8. Test error image obtained from feed forward BP-NN

Table 1. RMSE values for proposed structures and Autocorrelation coecients be-
tween actual values and predicted values of solar radiation data

RMSE RMSE for R R for


test data test data
1-D lin. lter 44.33 - 0.963 -
2-D lin. lter 41.09 - 0.968 -
NN1 1-D 45.12 42.012 0.963 0.973
NN2 2-D 39.17 38.66 0.971 0.976

600

R = 0.976

500

400
Actual pixel values(W/m2)

300

200

100

0
0 100 200 300 400 500 600
Predicted pixel values(W/m2)

Fig. 9. Plot of actual pixel values versus predicted pixel values obtained from NN 2-D

The sigmoid function and the gradient descent algorithm with Levenberg-
Marquard modication are used during learning process with three neurons at
the hidden layer. To accelerate the speed of learning process a momentum term
is used and is updated by a fraction of the previous weight update to the current
one. After the learning phase, the network is simulated by the remaining image
data (Fig. 7) and error samples ere obtained (Fig. 8). Root Mean Square Error
(RMSE) values that are obtained from proposed optimum linear prediction l-
ters and neural networks are presented in Table I. The correlation coecients
756 F.O. Hocaoglu, O.N. Gerek, and M. Kurban

between actual data values and predicted data values are also tabulated here.
The correlation coecients are also presented as a plot of actual pixel values
versus predicted pixel values obtained from 2-D NN2 in Fig. 9.

6 Conclusion
In this work, a novel approach is proposed for hourly solar radiation forecasting.
The hourly solar radiation is interpreted and rendered as an 2-D image and
its properties are examined. It is observed that two dimensional representation
gives more insight to the solar pattern than the regular 1-D interpretation. As an
illustration, 1-D and 2-D optimal linear prediction lters with 3 coecients are
designed and compared in the sense of RMSE and correlation coecients. The
RMS energy value of the data and the prediction sequence are around 198. After
applying the prediction, the RMS value of the prediction error reduces down to
44.33 using 1-D prediction. This value also constitutes the standard deviation
of the statistical system. By using 2-D prediction, this value is reduced further
to 41.09. To emphasize the eciency of the proposed 2-D representation, two
feed forward neural network structures, one for 1-D modeling and the other for
the 2-D, are built and trained by the same data. The RMSE values are obtained
as 42.012 and 38.66 for 1-D and 2-D case, respectively. This observation also
justies the eciency of the 2-D data representation that exploits inter-day
dependencies of the solar radiation pattern. Furthermore, it is clear that the
2-D NN structure provides better prediction than the optimum linear lter. The
2-D representation has potential uses for dierent meteorological parameters
and dierent models such as surface matching, clustering based classication,
etc. Dynamical time varying behavior of the model may also be analyzed. Such
analysis can be regarded as future works of this study.

References
1. Maa, A., Adane, A.: A Two State Markovian Model of Global Irradiation Suitable
for Photovoltaic Conversion. Solar and Wind. Technology 6, 247252 (1989)
2. Amato, U., Andretta, A., Bartolli, B., Coluzzi Cuomo, B.V., Fontana, F., Serio,
C.: Markov Process and Fourier Analysis as a Tool to Describe and Simulate Solar
Irradiation. Solar Energy 37, 197201 (1986)
3. Mellit, A., Benghanem, M., Hadj Arab, A., Guessoum, A.: A Simplied Model
for Generating Sequences of Global Solar Radiation Data for Isolated Sites: Using
Articial Neural Network and a Library of Markov Transition Matrices Approach.
Solar Energy 79, 469482 (2005)
4. Aguiar, J., Collares-Perrira, M., Conde, S.P.: Simple Procedure for Generating of
Daily Radiation Values Using Library of Markov Transition Matrices. Solar En-
ergy 49, 229279 (1988)
5. Gonzalez, R.C., Woods, R.E.: Digital Image Processing, pp. 461463. Prentice-Hall,
Englewood Clis (2002)
6. Hagan, M.T., Menhaj, M.B.: Training Feedforward Networks with the Marquardt
Algorithm. IEEE Transactions On Neural Networks 5, 989993 (1994)

You might also like