# Forecasting Maximum Seasonal Temperature Using Artificial Neural Networks “Tehran Case Study”

## Abstract

The main purpose of this research is maximum temperature prediction using neural network techniques. For this purpose, 70% of the data were allocated for network training and 30% of the data were devoted for testing and validation. The most appropriate neural network structure for predicting Tehran maximum winter temperature is a model with three neurons in the input layer, and a hidden layer with 9 neurons and the use of a hyperbolic tangent function in the hidden layer, that is, 3–9-1 arrangement in which the root mean of square error, correlation coefficient and the mean of absolute error for the training phase and the testing phase are respectively 0.001, 0.997, 0.61 and 0.104, 0.997, 0.311. The determination coefficient and correlation coefficients for both training and testing periods equal 0.99 and 0.99 and the correlation coefficient is significant at the level of 1%.

## Keywords

Maximum temperature Artificial neural network Tehran Forecast Hyperbolic tangent function## 1 Introduction

The process of climate change, particularly changes in temperature and rainfall is the most important issue in the field of environmental sciences. Climate change has increasing importance due to its scientific and practical aspects (environmental, economic-social impacts). The earth temperature change in the report of the Intergovernmental Panel on Climate Change has been calculated between 0.3 to 0.6 °C for 1900 to 1995 (Intergovernmental Panel on Climate Change, 2001). Most climatologists believe the main reason for the increase in temperature of the Earth is human activity, which through excessive increase in greenhouse gases increases the temperature of the planet in the last century (Alijani 2011).

Shumway et al. (1988) also showed that temperature has a major role in Los Angeles death rate. The stressful effect of climate on death rate (mortality) has been proved which means that the farther the temperature from the human comfort zone, the further the stress, resulting in increased death rate (Marmor 1975; Ramlow et al., 1990). A significant relationship has been determined between temperature and death rate for some world cities. Deaths that are directly related to the temperature such as increased body temperature can be the result of cardio-respiratory diseases or poor functioning of the vessels that transfer nutrients and blood to the body (Kalkstein 1991; Martens 1998).

Since climate has a wonderful effect on human’s social and individual life, climatic weather forecast is performed based on current and predicted values of atmospheric parameters (Teshnehlab & Monshi., 2003). The role of maximum temperature is quite clear in increasing the evaporation and transpiration, reduction of surface and underground water, the spread of various diseases, forest fires, the process of melting glaciers, and drought and water shortages in other areas (Hosseini, 2009). Significant changes in global temperatures or global warming are considered as the most important aspects of climate change in the present century. If estimating and predicting methods have enough accuracy, they can be used in planning and management (Karamooz et al. 2006). High temperature can also cause many disasters in road transportation. Direct impact on the vehicle through evaporation of gasoline and water (Keay and Simonda 2005) and driver fatigue (Eriksoon and Lindqvist 2003) are among these cases. Nowadays, one of the efficient methods that has many uses in the science of climate is the artificial neural networks. According to the researchers, its power and high-speed in simulating the processes that are not properly understood or checking them with other methods is time-consuming and difficult is the main reason for its acceptance and growing use. Generally, it can be said that artificial neural network is a high-capability robust model that can be positively viewed on climate and hydrological issues. Specially, this network can extract the law the data even the noisy data (Dehghani and Ahmadi 2008).

Jain (2003) predicted the temperature of South Georgia for the next one to twelve hours using the artificial neural network. Rahman and Mohandas (2008) showed that neural network could estimate the solar radiation of Saudi Arabia through temperature and relative humidity during the statistical period of 1998 to 2000. Cadenas and Rivera (2009) could predict wind speed in Lamenta, Osaka, and Mexico for short periods of time with good precision. Ahmadi (2005) classified Boushehr rainfall changes using artificial neural network based on his self-organizing map model (SOM). SoheiliKhah and Teshnehlab (2004) predicted daily maximum temperature using a new dynamic structure of neuro-fuzzy network. They could increase the accuracy of prediction using their self-proposed algorithm. Rahmani and Teshnehlab (2005) proposed a new structure based on artificial neural network named TD-CAMC which is an expansion of cerebellum or CAMC model and used it for predicting daily maximum and minimum values. Alijani and Ghavidel Rahimi (2005) predicted and compared Tabriz annual temperature changes with global temperature anomalies using artificial neural network and linear regression. Khosravi et al. (2010) considered the use of artificial neural network in the field of atmospheric sciences and calculating climatological parameters. They used variables such as relative humidity, average wind speed, average hours of sunshine, and the difference between the average minimum temperature and the average maximum temperature as Perceptron multilayer neural network input.

Artificial neural networks are effective tools for modeling nonlinear systems. Because these networks do not consider mathematical relationships for complex phenomenon (Kumar et al. 2002). Today, researchers developed sciences like intelligent methods that are flexible and powerful tool, looking for ways beyond the usual methods for understanding and forecasting important meteorological parameters. Artificial neural networks are one of the methods able to calculate the arithmetic and logical functions (Sharma and Bose 2014). Hence, modeling of temperature variables is important in water resources management and agriculture, especially in arid and semi-arid regions. Due to climate change and global warming in recent decades and the importance of simulating and forecasting climate parameters and also given the power and speed of artificial neural network, this article considers and estimates Tehran maximum temperature in winter using neural network model.

## 2 Materials and Methods

### 2.1 Study Area

*Km*

^{2}. City height in south in Mehrabad airport is 1200 m and in north is 2000 m. Figure 1 shows the area under study. Monthly data of maximum temperature of Tehran Mehrabad Synoptic station during the periods of 1951 to 2010 are used in order to predict winter maximum temperature. Just the mentioned Synoptic station has above 50 years, data from other stations are not used. Concerning the general climate divisions, this region is among semi-arid climate, from June to August is almost dry, and the rest of the months of the year is wet. Average annual rainfall and average annual temperature during a period of 55 years are 333 mm and 17.2 °C respectively. An important part of rainfall pour during December to May. Average temperature of January as the coldest month of the year is 3.3 °C.

With respect to the length of the statistical period used, 70% (43 years) of the statistical period was considered for network training and 30% (17 years) of this used for the test period. Qnet 2000 software was used to design the artificial neural network (ANN). Cross validation method was used in this research to perform a sensitivity analysis on the results of the model.

The combination of input variables in the designed models

Model name | Input parameters | ||||
---|---|---|---|---|---|

Model 1 | Tmean | Rtemp | RHmean | n | U |

Model 2 | Tmean | Rtemp | RHmean | n | |

Model 3 | Tmean | Rtemp | RHmean | ||

Model 4 | Tmean | Rtemp | n | ||

Model 5 | Tmean | Rtemp |

In order to obtain the best network layout, designing models begins with one hidden layer and then two and three hidden layers. Three values of 0.6, 0.7, and 0.8 were considered to study the effect of momentum. Since changes in the number of the hidden layer nodes can have a significant impact on the accuracy of the network output, the number of nodes was changed between 1 and 10 to determine the best number of hidden layer nodes. Due to the above, to estimate the maximum temperature using Artificial Neural Networks, 450 models (5 combinations of input vector × a number of 1–3 hidden layer × 3 momentum states × a number of 1–10 nodes in the hidden layer) were designed to achieve the most suitable combination and arrangement of the network.

### 2.2 Artificial Neural Network

*x*

_{1},

*x*

_{2},

*x*

_{3}, …,

*x*

_{n}enter the neuron which are briefly represented by vector

*x*. Each neuron input belongs to one of the input signals. Each signal is multiplied by a corresponding related weight including

*w*

_{i1},

*w*

_{i2},

*w*

_{i3}, …,

*w*

_{ij}which is briefly shown as vector W. The values obtained are added inside the neurons and the output value is calculated:

^{2}), and the Maximum Absolute Error (MAE) were used to determine the best type of network arrangement. The appropriate method is the one that has the lowest RMSE and MAE. The smaller the value of RMSE and MAE, the closer the calculated values by the model to the true values.

In which O is the observed values, E is the predicted maximum temperature to observe i … n. O and E are also the average observed values and the average predicted values respectively and N is the number of observations.

## 3 Results and Discussion

Network performance evaluation for the designed models

The network name | Optimized structure | Momentum term | RMSE | R | MAE | |||
---|---|---|---|---|---|---|---|---|

Train | Test | Train | Test | Train | Test | |||

Model 1 | 5–4-1 | 0.8 | 0.0105 | 0.112 | 0.999 | 0.996 | 0.6 | 0.285 |

Model 2 | 4–6-1 | 0.8 | 0.009 | 0.109 | 0.997 | 0.996 | 0.586 | 0.265 |

Model 3 | 3–7-1 | 0.8 | 0.1 | 0.107 | 0.997 | 0.996 | 0.589 | 0.3 |

Model 4 | 3–9-1 | 0.8 | 0.001 | 0.104 | 0.997 | 0.997 | 0.61 | 0.275 |

Model 5 | 2–8-1 | 0.8 | 0.01 | 0.109 | 0.997 | 0.996 | 0.586 | 0.311 |

Validation of the training data by cross-validation method

Year | Observed values | Simulated values | Validation values |
---|---|---|---|

1951 | 7.83 | 7.75 | 7.74 |

1952 | 10.83 | 10.89 | 10.87 |

1953 | 10.10 | 10.14 | 10.15 |

1954 | 9.90 | 9.93 | 9.90 |

1955 | 12.10 | 12.08 | 12.05 |

1956 | 9.97 | 10.06 | 10.07 |

1957 | 8.13 | 8.08 | 8.02 |

1958 | 10.97 | 11.02 | 11.01 |

1959 | 7.57 | 7.44 | 7.45 |

1960 | 12.93 | 12.77 | 12.75 |

1961 | 9.80 | 9.90 | 9.92 |

1962 | 10.93 | 10.98 | 10.99 |

1963 | 11.70 | 11.76 | 11.75 |

1964 | 6.10 | 6.01 | 6.00 |

1965 | 8.93 | 8.97 | 9.03 |

1966 | 13.83 | 13.36 | 12.98 |

1967 | 9.63 | 9.65 | 9.72 |

1968 | 9.60 | 9.61 | 9.62 |

1969 | 7.30 | 7.16 | 7.12 |

1970 | 10.47 | 10.56 | 10.55 |

1971 | 10.07 | 10.11 | 10.14 |

1972 | 3.63 | 4.24 | 4.85 |

1973 | 8.60 | 8.65 | 8.69 |

1974 | 5.10 | 5.12 | 5.08 |

1975 | 7.17 | 7.10 | 7.07 |

1976 | 8.70 | 8.69 | 8.69 |

1977 | 7.90 | 7.78 | 7.77 |

1978 | 10.87 | 11.02 | 11.01 |

1979 | 10.23 | 10.39 | 10.36 |

1980 | 8.53 | 8.46 | 8.43 |

1981 | 11.70 | 11.70 | 11.71 |

1982 | 7.00 | 6.86 | 7.42 |

1983 | 7.53 | 7.42 | 7.42 |

1984 | 6.43 | 6.31 | 6.27 |

1985 | 9.90 | 10.00 | 10.01 |

1986 | 9.80 | 9.94 | 9.97 |

1987 | 11.87 | 11.90 | 11.88 |

1988 | 9.97 | 10.08 | 10.10 |

1989 | 7.40 | 7.35 | 7.37 |

1990 | 8.47 | 8.45 | 8.47 |

1991 | 8.13 | 8.04 | 8.03 |

1992 | 7.60 | 7.50 | 7.53 |

1993 | 8.53 | 8.50 | 8.55 |

To evaluate the methods used in this study, the correlation coefficient, Root Mean Square Error (RMSE), and Mean Absolute Error (MAE), of the models have been calculated using (Cadenas and Rivera 2009), (Chauhan and Shrivastava 2009) and (Dehghani and Ahmadi 2008) relationships. RMSE and MAE values for validation period are 0.01 and 0.127 respectively. And the obtained Mean of Bias Error is −0.005. The obtained results suggest that the average amount of observed and estimated values has fewer differences which results in predicting the maximum temperature of the area under study with less deviation by the model.

Changes in the input neurons combination and creation of 5 different models provide the chance of selecting the best network structure in each model and finally, considering the results of 5 models’ best structure and selecting the best model with the least error.

The results generally show that the increase of momentum term decreases the amount of error. In performing the above models, increasing momentum term from 0.7 to 0.8 decreases the amount of error in the network but increasing the momentum term from 0.8 to 0.9 increases each model’s amount of error. On the other hand, the obtained results from changing the number of the designed network hidden layers show that increasing the number of hidden layer from one to two increases the amount of network error. In many studies, just one hidden layer has been used due to higher efficiency and also faster performance of the model (Sudheer et al. 2002; Wang et al., 2008; Chauhan and Shrivastava 2009).

The comparison of observed and predicted maximum temperature during testing phase

Year | Observed values | Simulated values |
---|---|---|

1994 | 8.53 | 8.53 |

1995 | 9.47 | 9.57 |

1996 | 11.03 | 11.11 |

1997 | 9.97 | 10.03 |

1998 | 10.70 | 10.72 |

1999 | 10.00 | 10.10 |

2000 | 9.90 | 9.89 |

2001 | 11.20 | 11.26 |

2002 | 10.03 | 10.19 |

2003 | 10.40 | 10.52 |

2004 | 11.17 | 11.26 |

2005 | 10.20 | 10.29 |

2006 | 9.13 | 9.11 |

2007 | 10.03 | 10.10 |

2008 | 7.20 | 7.07 |

2009 | 11.33 | 11.36 |

2010 | 13.43 | 13.15 |

The relative importance of the input variables in the best structure of each the composition (percent)

The network name | Optimized structure | Momentum term | T | RH | U | n | R |
---|---|---|---|---|---|---|---|

Model 1 | 5–4-1 | 0.8 | 64 | 0.97 | 0.57 | 0.31 | 34.16 |

Model 2 | 4–6-1 | 0.8 | 64.34 | 1.22 | 0.33 | 34.11 | |

Model 3 | 3–7-1 | 0.8 | 64.9 | 0.96 | 34.14 | ||

Model 4 | 3–9-1 | 0.8 | 65.56 | 0.04 | 34.4 | ||

Model 5 | 2–8-1 | 0.8 | 64.53 | 34.47 |

Two parameters from the 5 input climate parameters, that is, the difference between maximum and minimum temperature and the mean temperature have the most influence on the output model (the maximum temperature). The combination and the number of parameters have been changed in designing each model. The results of the model show that more number of input parameters does not increase the accuracy of the model.

## 4 Final Results

Estimating temperature as one of the important climate factors which is a nonlinear, temporal-spatial phenomenon influenced by many climatic and geographical factors is of great importance. In this research, neural network has been used as a powerful tool in modeling nonlinear and undetermined processes to predict Tehran maximum temperature in winter. Considering the influence of using climate variable for model input shows that model 4 with three variables of the mean temperature, sunny hours and the difference between maximum and minimum temperature is the most accurate model because it can predict Tehran maximum temperature in winter with the least error and the most correlation coefficient. The most suitable structure to predict Tehran maximum temperature in winter showed that a model with three neurons in the input layer, a hidden layer with nine neurons and using hyperbolic tangent function in the hidden layer, that is, 1–9-3 arrangement in which the amount of Root Mean Square Error, correlation coefficient, and the Mean Absolute Error is respectively 0.61, 0.997, 0.001 for the training phase and 0.104, 0.997, 0.311 for the testing phase. The determination coefficient and the correlation coefficient for both training and testing phases equal 0.99 and 0.99 and the correlation coefficient is significant at the level of 1%. Given that the other network assessment criteria is acceptable and the estimated maximum temperature is closest to true values (Fig. 7), it can be said that the designed network has a very good performance. Neural network is of more importance relative to classical models because of having nonlinear and undetermined characteristics. Of course, it should be mentioned that neural networks consist linear models inside them, which are more comprehensive in relation to other classical methods.

Generally, it can be concluded that artificial neural network model is a powerful model which can be viewed positively in predicting climatic and hydrological issues. Specially, the ability of this network in extracting the law governing the data, even the noisy data, is one of the outstanding characteristics of this model in comparison with other models. The results of predicting maximum temperature can be used in environmental planning such as controlling pests and diseases, water resources management, ecological studies, and etc.

## Notes

## References

- Ahmadi, E.: The precipitation classification of Bushehr using neural network (ANN) based on the self-organizing Kuhunn model (SOM). A Thesis Submitted to the Geography Faculty of Kharazmi University of Tehran in Partial Fulfillment of the Requirements for the Degree Master of Science, Tehran (2005)Google Scholar
- Alijani, B., Ghavidel, R.: Comparison and prediction of annual temperature changes in Tabriz with the anomalies of the global temperature using linear regression and neural network methods. Geography and Development Iranian Journal. 21–38 (2005)Google Scholar
- Alijani, B.: Spatial analysis of extreme temperatures and rains in Iran. J. Geogr. Sci.
**17**(20): 9–30, Spring (2011)Google Scholar - Cadenas, E., Rivera, V.: Short term wind speed forecasting in La Venta, Oaxaca, Mexico, using artificial neural networks. Renew. Energy.
**34**, 274–278 (2009)CrossRefGoogle Scholar - Chauhan, S., Shrivastava, R.K.: Performance evaluation of reference evapo-transpiration estimation using climate based methods and artificial neural network. J. Water Resour. Manag.
**23**, 825–837 (2009)CrossRefGoogle Scholar - Dehghani, A.A., Ahmadi, R.: Estimated discharge of drainage areas without statistical using neural network. The First International Conference on Water Crisis. Zabol University, 22–20 March 2008Google Scholar
- Eriksoon, M., Lindqvist, S.: Regional influence on road slipperiness during winter precipitation events. Physical Geography, Department of Earth Science, box 460, se 405 (2003)Google Scholar
- Hosseini, S.A.: Estimation and analysis of maximum temperatures in Ardabil city using Artificial Neural Networks Theory Model. Master's thesis. University of Mohaghegh Ardabili (2009)Google Scholar
- Intergovernmental Panel on Climate Change (IPCC): Climate change 2001: impacts, adaptation and vulnerability. Cambridge University Press, Cambridge (2001)Google Scholar
- Jain, A.; Predicting air temperature for frost warning using artificial neural network. A Thesis Submitted to the Graduate Faculty of The University of Georgia in Partial Fulfillment of the Requirements for the Degree Master of Science, Athens, Georgia, 92 p. (2003)Google Scholar
- Kalkstein, L.S.: A new approach to evaluate the impact of climate on human mortality. Environ. Health Perspect.
**96**, 145–150 (1991)CrossRefGoogle Scholar - Karamooz, M., Ramezani, F., Razavi, S.: Long Term Forecast of Rainfall Using Meteorological Signals: Application of Neural Networks. The Seventh International Congress on Civil Engineering. Tarbiat Modarres University, Tehran (2006)Google Scholar
- Keay, K., Simonda, I.: The association of rainfall and other weather variables with road traffic volume in Melbourne, Australia. Accid. Anal. Prev.
**37**, 109–127 (2005)CrossRefGoogle Scholar - Khosravi, M., Azhdari Moghaddam, M., Nazari Pure, H., Razmjoee, Sh.: Predict of Shiraz maximum temperature using an artificial neural network, the Fourth Congress of the Islamic World Geographers, pp. 1–14 (2010)Google Scholar
- Kumar, M., Raghuwanshi, N.S., Singh, R., Wallender, W.W., Pruitt, W.O.: Estimating evapo-transpiration using artificial neural network. J. Irrig. Drain. Eng.
**128**, 4.224–4.233 (2002)CrossRefGoogle Scholar - Marmor, M.: Heat wave mortality in New York City, 1949 to 1970. Arch. Environ. Health.
**30**, 130–136 (1975)CrossRefGoogle Scholar - Martens, W.J.M.: Climate change, thermal stress and mortality changes. Soc. Sci. Med.
**46**(3), 331–344 (1998)CrossRefGoogle Scholar - Rahman, S., Mohandas, M.: Artificial neural network estimation of global solar radiation using air temperature and relative humidity. Energy Policy.
**36**(2), 571–576 (2008)CrossRefGoogle Scholar - Rahmani, A.A., Teshnehlab, M.: Predicting temperature using neural network. Int. J. Eng. Sci.
**16**(3), 8–1 (2005)Google Scholar - Ramirez, M.C.V., Velho, H.F., Ferreira, N.J.: Artificial neural network technique for rainfall forecasting applied to the Sao Paulo region. J. Hydrol.
**301**, 146–162 (2005)CrossRefGoogle Scholar - Ramlow, J.M., Kuller, L.H.: Effects of the summer heat wave of 1988 on daily mortality in Allegheny County, PA Public Health Reports.
**105**, 283–289 (1990)Google Scholar - Sharma, A., Bose, M.: Rainfall prediction using k-NN based similarity measure. In: Biswas, G., Mukhopadhyay, S. (eds.) Recent advances in information technology. Advances in intelligent systems and computing, vol 266. Springer, New Delhi (2014)Google Scholar
- Shumway, R.H., Azari, A.S., Pawitan, Y.: Modeling mortality actuation in Los Angeles as function of pollution and weather. Environ. Res.
**45**, 224–241 (1988)CrossRefGoogle Scholar - SoheiliKhah, S., Teshnehlab, M.: Predicting weather daily temperature using a dynamic new structure and the fuzzy neural networks. 6th Intelligent Systems Conference (2004)Google Scholar
- Sudheer, K.P., Gosain, A.K., Mohana Rangan, D., Saheb, S.M.: Modeling evaporation using an artificial neural network algorithm. Hydrol. Process.
**16**(16), 3189–3202 (2002)CrossRefGoogle Scholar - Teshnehlab, M., Monshi, M.: Climate prediction of meteorological parameters using neuralfuzzy networks based on the training of Tali section parameters. Third Climate Change Conference, Isfahan, Meteorological Organization, Isfahan University (2003)Google Scholar
- Teshnehlab, M., Monshi, M.: Predicting Meteorological Parameters Using Neural Network-Based on Fuzzy Parameters of Taille Part. The Third Regional Conference on Climate Change, University of Isfahan, p. 80 (2004)Google Scholar
- Wang, Y.M., Traore, S., Kerh, T.: Neural network approach for estimating reference evapotranspiration from limited climatic data in Burkina Faso. WSEAS Trans Comput.
**7**, 704–713 (2008)Google Scholar

## Copyright information

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.