Wavelet discrete transform , ANFIS and linear regression for short-term time series prediction of air temperature

An air temperature conditions from year to year changes along with the global warming is happening in the world. Cyclical changes in cropping patterns by farmers of maize, rice, vegetables, wheat and others have traditionally been a shift in the stage of planting to harvest. The condition of the river is always in the flow of water will turn to the adequacy of the consumption of agricultural land as well as the flora and fauna that needed water. The rising temperature changes resulting forest fires and pollution on living beings. It needs the knowledge to predict the temperature to do preventive actions considered to overcome the undesirable condition and as a reference for mitigation.


I. Introduction
An air temperature conditions from year to year changes along with the global warming is happening in the world.Cyclical changes in cropping patterns by farmers of maize, rice, vegetables, wheat and others have traditionally been a shift in the stage of planting to harvest.The condition of the river is always in the flow of water will turn to the adequacy of the consumption of agricultural land as well as the flora and fauna that needed water.The rising temperature changes resulting forest fires and pollution on living beings.It needs the knowledge to predict the temperature to do preventive actions considered to overcome the undesirable condition and as a reference for mitigation.

A. Object Study Location
The studied region is the monitoring station at Bungus fishery port in Padang, Indonesia (Fig. 1).The stations were built by the Research Center for Informatics -LIPI in cooperation with the Research Station Resources and Coastal Vulnerability (LPSDKP) of Ministry of Maritime and Fisheries Affairs.Monitoring station in Bungus port located on the west coast of Sumatera Island (1.0301107 latitudes and 100.395639 longitudes).Bungus Ocean Fishery Port frequented by many fishing vessels above 60 GT.These boats are generally types of long liner and purse-seiner the fishing ground in deep water or until ZEEI Indian Ocean.Nearly twice weekly tuna boats unload their catches in this port and hereinafter will be exported to Japan and America.
The second location named weather monitoring station Muaro-Anai, close at Minangkabau International Airport.Measured data from Bungus monitoring stations is then stored to the LIPI server in every 10 minutes.Observed temperature data April to July 2016 is characterized as the short-term prediction with 8335 data pairs 1 .

B. Mackey Glass Chaotic Time Series
The Mackey glass equation is nonlinear time delay differential equation [8]: τ is a nonnegative delay time for evaluating the signal.n is a non-negative parameter that helps to illustrate the feedback/response time-delayed.β and γ are two nonnegative parameters in the equation (1).Since this is delay differential equation, initial conditions must be determined at the interval, and that made it infinite dimensional systems.

C. Discrete Wavelet Transform
Discrete Wavelet Transform (DWT) is data frequency decomposition.Implementation of discrete wavelet transformation can be done by passing the signal through a low pass filter (low pass filter / LPF) and high passes filter (high pass filter / HPF) and perform down sampling on the output of each filter.The wavelet transform is scientific tools for nonlinear and non-stationary of signal analysis [7].To overcome this difficulty, DWT has two scales of transformation algorithms, can be implemented in applied approach.In this case, it can reduce the computational complexity of other wavelet models such as the Continuous wavelet transform (CWT) [10].
Where t is an integer data type for the time, a and b is also a controller, each of scale and timing; Wa,b is the wavelet coefficients for the scale factor, s =2 a is the time factor, and τ = 2 a b.On the Discrete Wavelet Transform method, time-series data pass through two kinds of filter and wavelet decomposed into components of sub-time series, which were computed from the equation (2), without losing the element of instant information.Discrete Wavelet Transform conducted transformation the signal to a father and mother wavelet.Father wavelet represent the high-scale, low-frequency components (approach (A) component).Mother wavelet is a representation of scale low and high-frequency components (detail (D) component).To do decomposing signal x(t) into a detail of the hierarchical structure (high frequency) and approximations (low frequency) to some degree levels as follows: In the equation (3), D1, D2, D3,… , Dn show detail coefficients, and An show the approximation of n th level.

D. Adaptive Neuro Fuzzy Inference System (ANFIS)
Before recognizing ANFIS, using ANN becomes a good reference used in modeling [11].Neuro fuzzy is selected to manage linguistic factors, in this case for weather prediction.It is good for quality modeling human knowledge base and Alternative for decision making.Artificial Neural Network has potential learning.ANN can recognize patterns, just as humans do, which can be input and generate predictions.Integrating ANN and fuzzy logic can further improve performance, minimize errors and flexibility.In Fig. 2, ANFIS model for two inputs, in this figure seen circle and box are symbolizes non-adaptive and adaptive variable [12] Takagi-Sugeno model is a much more effective option to use especially at the time of calculation and more adaptive [9].
The ANFIS with two inputs the rules as following: Layer1: In this layer the connected inputs are adaptive can be changed as follows: In equation ( 6) ( 7) can be seen x and y are input node i,   and   are linguistic label labels connected with node.   And    is the membership function of each node.
Layer2: In this layer a circle node labeled Π is non-adaptive symbol.This function can be used also if the part of the premise is consistent and has some fuzzy set.This condition using multiplication operators: Layer3: In this layer, label N in the middle of circle use to normalize with calculate ratio of node i and sum of firing strength, the node function: Layer4: In this layer output from equation (9) (layer 3) is multiplied with equation (4) and equation ( 5) as following function: Layer5: In this layer all parameters corresponding to the mechanism are added to be output.This layer is fixed.

E. Linear Regression
Linear Regression is corresponding to create between variables with rule dependencies.There are 2 types of variables that are defined: independent variables and dependent variables.Variable Z shows the result of the estimated calculation in equation ( 12).This process is show dependent variable, while the independent variable is X. both of these variables has interconnection.If an equation there is one variable X then this is called simple regression, while the independent variable is more than one, it is called multi linear regression.The function as following: Z represent dependent variable,  0 −   parameters that need in equation, while  1 −   is independent variable.(16) n is numbers of set data test, while the Linear Regression, ANFIS and Wavelet model are shown by Qi, Oi as observation value and Si, Ei represent estimation value.,  is average value of observation and ,  is the average value estimates.

III. Results and Discussion
At the initial stage, data's are separated into training and testing data using equation (1).To utilize the data in present with the time series required collection of data within a certain time.For example, when t is the reference value for predicting the next minutes, then the value is t + P. The standard method for this kind of forecast to create a mapping from D point data sample, a sample of each unit Δ in time, (x (t (D-1) Δ), ..., x (t-Δ), x (t)), with a predicted next value x (t + P).After an ordinary arrangement for predicting Mackey Glass time series data, set D = 4 and Δ = P = 6.For each t, the training data input for Wavelet and Linear Regression is a four-dimensional vector of the shape of each sub-time series as following t+24)] as an input and s(t) = x(t+30) as an output with the distribution of the output values data are separated into training and testing data, x(0) = 1.2, τ = 27, and x(t) = 0 for t <0.
All of 8335 data pairs used to facilitate the 8200 data pairs.Initialize the data, start 28 th to 8227 th with the initialization of data to be divided into five intervals of data.Fig. 3 show the data will be started of the interval x + 6.In other words, for 10 minutes interval x + 6 = 60 minutes, x + 12 = 120 minutes, x + 18 = 180 minutes, x + 24 = 240 minutes.

A. Wavelet and Linear Regression Models
Temperature data is used, like time series format in decomposing into various sub time series components (DS) using the Discrete Wavelet Transform (DWT) to estimate the temperature next t minutes.Five levels of resolution wavelet were used in this study.Stages (n = 1, 2, 3, 4, 5) while branching decompose resulting from the process is 2 n (2-4-8-16-32).Qt refers to D as sub-time series at time t+i and temperature measurements at time t.All data time-series with 10 minutes interval is used in this model.Relationship values information for resolve of valuable components of wavelet on the temperature.It is shown in Table 2 represents all data that show low correlation to D1 component, while the component D5 has the highest correlation.In order to select the components D dominant, the number of absolute correlation was evaluated.Total correlation is given in the last column of Table 2 show the total correlation of Dt+6 data point up to 1 hour ahead, Dt+30 data point 5 hours ahead, D2 showed better correlation than the D1, D3 showed better correlation than D2, D4 showed better correlation than D3, D5 showed better correlation than the D4.All of D2, D3, D4 and D5 better than D1 for sub-time series detail coefficient and Approximation.Interpretation t represents the interval of 10 minutes.Estimation can be done by calculating the 1 hour intervals from the average time-series data.Decompose time series of temperature data can be seen in Fig. 4, using Daubechies wavelet decompose DB4 level 5.In Table 3  While the estimated error data by using MAE shown in Table 4, measurement data using wavelet decomposition analysis produces approximation component at each level.Analysis of the resulting error can be seen with increasing periodic predictions of 1 hour (Dt+6), 2 hours (Dt+12) to 5 hours (Dt+30) ahead, the resulting error will also increase proportionally in wavelet decomposes level except all level 1 are considered to be consistent.Reconstructed approximation generates MAE minimum for all sub-time series data at approximate level 1 is 0.0719 °C/10min for training data.While the MAE minimum generated by sub-time series Dt + 30 for Approximate level 1 for testing the data was 0.0759 °C/10min.4 it can be seen rising estimates for sub-time series Dt+30 became maximum, then error RMSE, MAE will be minimum and R 2 will increase in value in the testing data.

B. ANFIS and Linear Regression Models
For the ANFIS model uses four inputs of four temperature parameters from extension values of one temperature sensor (Tx+6, Tx+12, Tx+18, Tx+24) and one component of temperature parameter as output (Tx+30).The data is used ten minutes interval as shown in Table 1.Training data use 80% of all of data and the others 20% of data for validation.There is data from monitoring station with 10minute interval then the next output can be determined for input combination.Tx+30 (5 hours) is optimum combination for the temperature input to create the applicable for the output.By using the ANFIS method and generate the desired model can be known combination of training and validation to obtain the resulting performance.In Fig. 5 illustrates the effect of several input parameters.The sequence of parameters from left shows effect for the output.Parameter one input optimal affects on output of Tx+30 (for next 5 hours).Tx+24 (for next 4 hours) create the smallest error (RSME) to affect output on one input without a combination.6) In the next phase using 2 input combinations of variables that affect Tx+30 output as shown in Table 7.The optimal value can be reach by combination of Tx+6 and Tx+24.RMSE result 0.9379 o C/10min training value and 0.9390 o C/10min for testing value.The results obtained using ANFIS method of determining the suitability value of training and testing data by concern average comparable error value.Table 8 show that training process for 3 inputs, RSME value will increase to 0.9011 o C/10min, and get value 0.9028 o C/10min in the testing phase.Optimization occurs on the input variable Tx+6, Tx+18, Tx+24.In this phase, experiment is limited only by using 3 input combinations.

C. Analysis Combinations
From the above performance of analysis plotting wavelet against observations showing the more optimum value if was compared with other input models.Plotting data input-1 in Fig. 6, the value of data for approximates observed at level 1 (minimum error is the result of sub-time series analysis up to level 5).The combined analysis of data is generated from training and testing.
In Fig. 6, for 1 input, it seen differentiating between real data (Dt+18) with predicted value of Wavelet (approximates), use performance of evaluation criteria such as MEA, RMSE, and R 2 .Acquired 1 input MAE = 0.4432 °C/10min, R 2 = 0.9466, RMSE = 0.6277 °C/10min in training phase, whereas MAE = 0.3193 °C/10min, R 2 = 0.9781, RMSE = 0.4789 °C/10min in testing phase. 1 input parameter creates an optimal analysis for temperature output.While for 2 inputs in Fig. 6 are data value observed with linear regression using multiple inputs and single output (minimum error is the result of sub-time series analysis for prediction output).The combined analysis of data is generated from training and testing.For 2 input, it seen differentiating between real data (Dt + 30) and predicted , Acquired of 2 input 2 MAE = 0.6706 °C/10min, R 2 = 0.8657, RMSE = 0.9396 °C/ 10min in training phase, whereas MAE = 0.7828 °C/10min, R 2 = 0.8721, RMSE = 1.1147 °C/10min in testing phase.
Plotting data for three inputs in Fig. 6, a data value wavelet with linear regression to perform plots for data drawn from analysis of minimum error of each input to each sub-time series of data is generated.The analysis of the data is also generated the training and testing.For 3 Input, it seen differentiating between real data and predicted, acquired 3 input MAE = 0.9564 °C/10min, R 2 = 0.6971, RMSE = 1.3389 °C/10min in training phase, whereas MAE = 0.7018 °C/ 0min, R 2 = 0.8922, RMSE = 0.9784 °C/10min in testing phase.The curve in Fig. 8 and 9 shows the prediction results comparing ANFIS, linear regression and Wavelet.The first line which characterized by a linear regression curve shows the predicted outcome value curve more wide enough from the line of observation.Wavelet line shows output predicted value more wide from line of observation too but closer than linear regression value.While ANFIS predicted curve shows with the one closest to the value of observation and is also characterized by prediction error is minimum than Wavelet and linear regression.Comparison of the results of the data analysis using interval data t (10)min for 350 first data with minimal RMSE comparison.Linear regression analysis using the model is done by multi-input to give one output result of each prediction.Input data of 60, 120, 180, 240 minutes produces output for data prediction for 300 minutes to determine a combination of the output for multi-input for each minute.The analysis was generated using this model is quite well.However, it is not as well as the ANFIS generated prediction.For the input combination, ANFIS against linear regression is the optimal combination performed on this experiment to this research.The application of computational can be combined with more complex models such as Support Vector Machine, Artificial Neural Network, and hope can step over to next experiment with long term and complex data.

Fig. 1 .
Fig. 1.Weather monitoring station and tide gauge station at Bungus port, Padang city, West Sumatera Province -Indonesia In conducting the prediction data set is divided into training data (6668 10 minutes interval data, 80%) and testing data (1667 data 10 minutes interval, 20%).As in Table.1 every 10 minutes interval data statistically with variable sets TMean, TMedian, TMode, TMax, TMin, TStdev, TRange.Generally, each variable represents the Mean, Median, Minimum, Maximum, Standard Deviation and Range of temperature measurement results at the Bungus weather station.Tmin, Tmax representing Temperatures between 21.76 until 34.71 o C for training data sets, 21.47 to 33.16 °C for testing data sets, and 21.47 to 34.71°C for the entire data sets.Distribution of data can be observed from weather measurements Bungus station looks distribution of data almost evenly in both the training data, the testing data or entire data autocorrelations high enough, showing consistency tends to be high and evenly (for example, r1 = 0993, r2 = 0981, r3 = 0967, r4 = 0950) has high distribution of data.
1 every 10 minutes interval data statistically with variable sets TMean, TMedian, TMode, TMax, TMin, TStdev, TRange.Generally, each variable represents the Mean, Median, Minimum, Maximum, Standard Deviation and Range of temperature measurement results at the Bungus weather station.Tmin, Tmax representing Temperatures between 21.76 until 34.71 o C for training data sets, 21.47 to 33.16 °C for testing data sets, and 21.47 to 34.71°C for the entire data sets.Distribution of data can be observed from weather measurements Bungus station looks distribution of data almost evenly in both the training data, the testing data or entire data autocorrelations high enough, showing consistency tends to be high and evenly (for example, r1 = 0993, r2 = 0981, r3 = 0967, r4 = 0950) has high distribution of data.Vol. 3, No. 2, July 2017, pp.68-80 Devi Munandar (Wavelet discrete transform, ANFIS and linear regression for …)

Fig. 3 .
Fig. 3. Mackey Glass time series temperature data model

Fig. 4 .
Fig. 4. Five level wavelet decomposition of the air temperature data of Bungus Station.

Fig. 5 .
Fig. 5.One input parameter that affect temperature data for next 5 hours (Tx+30) The results contain training and testing for analyst of data for one input parameter to have the smallest RMSE value 1.1148 o C/10min in training step and 1.1140 o C/10min on testing step (red colour in Table 6)

Fig. 6 .
Fig. 6.Showing of wavelet model for one input (observed and wavelet), two input combinations (observed and linear regression), three input combinations (wavelet and linear regression) in training and testing phase.It can be seen the combination of ANFIS model parameters in the training and testing stage that have an effect to get the output, 1 input (Tx+24) and output (Tx+30) with using 100 epoch.In Fig. 7 for 1 input can be seen differentiating between ANFIS and Linear Regression, ANFIS model use performance of evaluation criteria such as RMSE, R 2 , r.And resulting 1 input r = 0.9994, R 2 = 0.9988 RMSE = 0.0807 o C/10min in training phase, and r = 0.9998, R 2 = 0.9982, RMSE = 0.0119 o C/10min in testing phase.Use of 1 parameter input is the optimal result in this experiment.The use of a combination of 2 input parameters at the training and testing phase, the combining affects is (Tx+6 and Tx+24) with Tx+30 output and resulting between 2 models r = 0.9893, R 2 = 0.9787 RMSE = 0.3497 o C/10min in training phase, and r = 0.9797, R 2 = 0.9599, RMSE = 0.5847 o C/10min in testing phase.For 3 input parameters at the training and testing phase, the combining affects is (Tx+6, Tx+18, Tx+24) with Tx+30 output and resulting both of models r = 0.9832, R 2 = 0.9667 RMSE = 0.4408 o C/10min in the training phase, and r = 0.9721, R 2 = 0.9449, RMSE = 0.6970 o C/10min for the testing phase.

Table 1 .
Variable input data statistically

Table 2 .
The correlation coefficients each of sub time series and observed temperature data in Bungus station , calculation of the estimated error, measurement data is divided into training data and testing data, results analysis wavelet decomposition produces approximation component at each level.Reconstructed approximation generates RMSE minimum for all sub-time series data.Approximate level 1 (A1) is 0.1042 °C/10min for training data.While the RMSE minimum generated by sub-time series Dt+18, Dt+24, Dt+30 for Approximate level 1 (A1) testing data is 0.1370 °C/10min.

Table 3 .
The RMSE statistics of different sub-time series of observed and wavelet approximation temperature data of Bungus station

Table 4 .
The MAE statistics of different sub-time series of observed and wavelet approximation temperature data of Bungus station

Table 5 .
The RMSE, MAE and R 2 statistics of different Linear Regression applications in sub-time series data of Bungus station