ESTIMATION OF HOURLY MEAN AMBIENT TEMPERATURES WITH ARTIFICIAL NEURAL NETWORKS

In this study, the artificial neural networks have been used for the estimation of hourly ambient temperature in Denizli, Turkey. The model was trained and tested with four years (2002-2005) of hourly mean temperature values. The hourly temperature values for the years 2002-2004 were used in training phase, the values for the year 2005 were used to test the model. The architecture of the ANN model was the multi-layer feedforward architecture and has three layers. Inputs of the network were month, day, hour, and two hourly mean temperatures at the previous hours, and the output was the mean temperature at the hour specified in the input. In the model, Levenberg-Marquardt learning algorithm which is a variant of backpropagation was used. With the software developed in Matlab, an ANN was constructed, trained, and tested for a different number of neurons in its hidden layer. The best result was obtained for 27 neurons, where R, RMSE and MAPE values were found to be 0.99999, 0.92024 and 0.20900% for training, and 0.9999, 0.91301 and 0.20907% for test. The results show that the artificial neural network is powerful an alternate method in temperature estimations. KeywordsEstimation, Neural network, Ambient temperature


INTRODUCTION
The information about the climatic parameters like mean hourly values of relative humidity, ambient temperature and wind velocity are useful in the thermal analysis of building, heating and cooling load calculations to decide the correct sizing of an airconditioning system for thermal comfort and in the performance evaluation and optimum design of many solar energy system [1].Accurate forecasting of hourly air temperatures has a number of important applications in the industry, agriculture and the environment [2].For example, the knowledge of variation in ambient temperature has a considerable value in predicting the solar radiation [3,4,5], hourly energy consumption and cooling load estimation in buildings [6,7] and room air temperature prediction [8].
Artificial Neural Network (ANN) technique can be used as an alternative method in the analysis of rather complex and ill-defined engineering problems and modeling the estimation studies.ANN does not require the formulation of the physical relation of the concerned problem [9].Moreover, one of the important properties of ANN models is their capability in detecting the patterns existing in a complex natural system and adopting themselves to recurrent changes [10].
In this study, an ANN model was developed in order to use to estimate the hourly ambient temperature in Denizli, Turkey.The model was trained and tested with four years (2002)(2003)(2004)(2005) of hourly mean temperature values obtained from Turkish State Meteorological Service.While the hourly temperature values for the years 2002-2004 were used in training phase, the values for the year 2005 were used to test the model.Moreover, Levenberg-Marquardt (LM) and tangent sigmoid (tansig) were chosen as the learning algorithm and transfer function of the model, respectively.The output of the network was the hourly mean temperature at the date and time specified by the inputs.The hourly mean temperature values one and two hours earlier than the specified date and time was also used in the input layer.

ARTIFICIAL NEURAL NETWORK
ANN is a branch of Artificial Intelligence which was developed in 1950s in order to imitate the biological structure of the human brain [11].The ANN models work like a black box without requiring the detailed information of a system.Instead of requiring this information, they learn the relation between the input parameters and the controlled and uncontrolled variables by studying the previously recorded data like non-linear regression.One more advantage of using ANNs is the capability of managing large and complex systems with a vast number of interrelated parameters.On the other hand they don't take into account the excess data which is very important [12].
The basic component of an ANN is an artificial neuron which is shown in Fig. 1.The input signals, represented by x 1 , x 2 , ..., x n , are modified by the associated weights, w i1 , w i2 , ..., w in , to form the weighted inputs.These weighted inputs are processed in two parts.First, they are combined together and added with the bias b i .Then this combined signal is transformed along by a function, which is called the transfer function, to form the output of the neuron.Thus, the output is given by Where There are a number of possible transfer functions.However, sigmoidal functions are more common.
An ANN is organized as layers of neurons.Each neuron in a layer is connected to all neurons in the previous layer.An example of this type of arrangement, which is used also in this study, is shown in Fig. 2. The network consists of an input layer, one hidden layer and an output layer.The input layer is not an actual neural computing layer because the neurons in this layer have no weights, biases and transfer functions.It simply presents the input data to the network.The output layer presents the response of the network to the given input.The hidden layer (or sometimes layers) has no connections to the outside world.

. ANN model used in the study
The process of training the network is the adjustment of the weights so that the network can produce the desired response to the given inputs.A set of inputs and the desired outputs corresponding to these inputs is called a training set.In order to train the network all weights and biases are randomized to small values and an input-output pair is selected from the training set.The selected inputs are applied to the network and the output is calculated.Then, the difference between the network output and the desired output, the error, is found.The weights and biases are adjusted by using a method called the learning algorithm to minimize this error.This process is applied to all the pairs in the training set.This training cycle which is called an epoch, is repeated until the error reduces to an acceptable value.
One of the most effective learning algorithms in ANN is the Backpropagation algorithm.For this reason, Backpropagation and its variants are the most popular learning algorithms [13].
In general, gradient descent and gradient descent with momentum are relatively slow algorithms because they require small learning rates for a stable learning.Moreover, the success of these algorithms depends on the learning rate of the dependent parameters and the momentum constant.The algorithms like Conjugategradient (SCG), BFGS quasi-Newton and Levenberg-Marquardt are faster than other algorithms and use standard numeric optimization techniques [9].

NEURAL NETWORK TRAINING AND TESTING
Artificial Neural Networks are used in a wide range of areas like pattern classification and identification, estimation, and optimization.In order to train the network, input data and target values corresponding to these data are required.The data used in this study was the hourly mean temperature values belonging the years 2002 through 2005, measured by Turkish State Meteorological Service for Denizli.
In this study, in order to predict the mean temperature at a desired hour, previous two hourly mean temperature values were used.Thus inputs of the network were month, day, hour, and two hourly mean temperatures at the previous hours, and the output was the mean temperature at the hour specified in the input.
A total of 35062 data, 26302 of which for training and 8760 of which for test were used.The architecture of the ANN model was the multi-layer feedforward architecture and has three layers.The first layer is the input layer with 5 inputs, the second layer is the hidden layer and the last one is the output layer.In the model, Levenberg-Marquardt learning algorithm which is a variant of backpropagation was used.
With the neurons in the hidden layer the tansig transfer function and with the neuron in the output layer pure linear transfer function, which are given by the equations below, were used.
The network was trained and tested for different number of neurons, varying from 3 to 30, in the hidden layer.In order for a comparison of errors, R 2 , RMSE and MAPE values defined by ( ) Where t is the target value, o is the output value and p is the number of input-output pairs [9], were used.

RESULT AND DISCUSSION
The ANN model was trained with the mean hourly temperature values of the years 2002-2004, and the trained model was tested for the mean hourly temperature values of the year 2005 by using software developed in Matlab.The process of ANN model is started with a network having 3 neurons in its hidden layer, and repeated by increasing the number of neurons up to 30 neurons.The output of the network was found to be very close to the measured values.The predicted values and their comparisons with the measured values are shown in Fig. 3, 4 and 5, each of which corresponds to one year of data in the training set.Test results are also shown in Fig. 6.In order for the clearness of the figures, the training and test results are depicted only for the first 500 hours of each year.As shown in the figures, it was found that the predicted temperature values which are the output of the network is very close to measured values for all years.However, predicted values deviate from the measured ones in some points.These points correspond to the sharp changes in measured values which were not predicted successfully by the ANN.The calculated root-mean squared error (RMSE), absolute fraction (R 2 ) and mean absolute percentage error (MAPE) values of the errors of the ANN forecasted mean hourly temperature were listed in Table 1, for each networks.From table, the best result was obtained for 27 neurons, where R 2 , RMSE and MAPE values were found to be 0.99999, 0.92024 and 0.209 % for training, and 0.9999, 0.91301 and 0.20907% for test.

CONCLUSION
The aim of this study was to predict the mean hourly ambient temperature in Denizli, by using the neural network technique.The paper introduced the ANN technique for modeling ambient temperatures.From the total of 35062 data, 26302 of which for training and 8760 of which for test were used.In the model LM learning algorithm has been used and the best results were obtained 27 neurons.These predictions can be useful in thermal analysis of buildings, heating and cooling load calculations so that the sizing of air-conditioning systems can be done more correctly.
The training and test results show that there is a good correspondence between the predicted and measured values.Thus, ANN technique can be used as an alternate method in temperature estimations.

Fig. 3 .Fig. 4 .
Fig. 3. Predicted and measured hourly mean ambient temperatures for the first 500 hours of the training year 2002.

Fig. 5 .
Fig. 5. Predicted and measured hourly mean ambient temperatures for the first 500 hours the training year 2004.

Fig. 6 .
Fig. 6.Predicted and measured hourly mean ambient temperatures for the first 500 hours the test year 2005.

Table 1 .
RMSE , R 2 and MAPE values of the training and test results -