FINANCIAL TIME SERIES PREDICTION USING WAVELET AND ARTIFICIAL NEURAL NETWORK

This paper focuses on the modelling of financial time series using the coupling of the discrete wavelet transform and nonlinear autoregressive neural network. This hybrid modelling method is based on the use of decomposed time series using the discrete wavelet transform as inputs to the artificial neural networks. This method has been applied to three financial series (exchange rate EUR/USD, the Brent price and NASDAQ composite price). The simulation results using R software show the robustness of the proposed model compared to other modelling methods applied to the same financial time series.


INTRODUCTION
Forecasting financial time series is an essential element of any investment activity in the entire investment industry. Traditional financial time series forecasting methods include sales percentage method and linear regression analysis method. One of the most popular method is the autoregressive integrated moving average (ARIMA). However, in order to improve the quality of financial forecasting, we need to rely on more accurate forecasting methods. Time series forecasting method is a method specially used to analyse a series of observations arranged in chronological order. It has extremely important significance in economics, especially in macroeconomics. Although there are already many machine learning and deep learning models applied to financial time series analysis, such as stacked auto-encoders (SAE) [1], artificial neural network (ANN) and long short-term memory (LSTM) [2]. In recent years, wavelet transformation has been proposed for time series analysis [3,4].
In this paper, we propose a prediction method, based on the combination between the non-linear autoregressive neural network and the discrete wavelet transform. As with other prediction methods, the basic idea is that we use the data available, constituting the past evolution of the series, to determine, at least partially, its future development. To overcome the insufficient accuracy of traditional financial time series forecasting methods, the hybrid proposed model is established including three stages, which are data pre-processing stage, data prediction stage and prediction result analysis stage. In the first stage, we decompose the financial time series using the discrete wavelet transform into sub-series. In the second stage we use to pre-processed data as input for the ANN and in the final stage we analyse the predicted data using evaluation criteria.
The rest of this paper is organized as follows. The section 2 briefly presents the artificial neural network. In section 3, the concept of wavelet analysis will be introduced, while in section 4 we describe the prediction method. In section 5, we apply the proposed model and ARIMA model to three financial time series (exchange rate EUR/USD, the Brent price and NASDAQ composite price). Finally, section 6 is dedicated to the conclusions.

NONLINEAR AUTOREGRESSIVE NEURAL NETWORK
Artificial neural network was first introduced to solve complex classification problems. But due to their universal approximation property [5,6], they were quickly used as nonlinear regression models, and then for the modelling of time series and forecasting [7,8]. In this paper we consider a family of multilayer perceptron (MLP see figure 1) models called nonlinear autoregressive neural network model (NAR), defined by: where ∈ ℝ, ℎ represents a function implemented by a multi-layered perceptron with a single output unit, − , = 1, … , are the delays of the time series ( ) and is a white noise.
The NAR model can be defined exactly by the following equation: The weight of the connection between the input unit i and the hidden unit j The weight of the connection between the hidden unit j and the output unit 0 Constants that correspond to the output unit 0 Constants that correspond to the hidden unit j  There are many training functions used to train an ANN [10,11]. Most of the learning algorithms of neural networks are optimization algorithms, they seek to minimize, by nonlinear optimization methods, a cost function which constitutes a measure of the difference between the desired responses and the real responses of the network. This optimization is done iteratively, by modifying the weights as a function of the gradient of the cost function: the gradient is estimated by a method specific to neural networks, called the backpropagation method. In our work, we chose the Levenberg-Marquardt method, characterized by its great computational and memory requirements.
The Levenberg-Marquardt algorithm is given by: where, 'W' is the weights of the neural network, 'J' is the Jacobian matrix of the performance criteria to be minimized, 'I' is the unit matrix, µ is a learning rate that controls the learning process and 'e' is the residual error vector. Hence, µ is decreased after each successful step and increased only when a step increases the error.

WAVELET ANALYSIS
The introduction to theory and practice of wavelet analysis are described by several authors in numerous books and articles [12,13,14]. Some other authors have described the application of wavelets in statistics and time series analysis [15,16]. Unlike the Fourier transform, which does not work well when it has to locally describe a function that shows discontinuities, wavelet analysis offers a wide range of basic functions from which one we can choose the most appropriate for a given application. In his article, Strang make a more in-depth comparison between the Fourier transform and the wavelet transform [17]. The wavelet transform offers the possibility of analysing a signal simultaneously in the time domain and in the frequency domain (necessary for a nonstationary signal), it can be used to explore, denoise and smoothen any kind and size of time series [18]. A wavelet is an oscillating function of mean zero, possessing a certain degree of regularity and whose support is finite. The mother wavelet of a signal is defined by: where 't' stands for time, 'τ' is a translation parameter in time and 'a' is a dilation parameter, who referred to a scale parameter, with a value selected in the range of 0 < < 1 . Regularity conditions also can be imposed such as multiple vanishing moments: second the integral of the square of the wavelet function is unity In addition, it is usually assumed that the following condition is true: where will be within the range of 0 < < ∞. We called the admissibility condition, which is necessary to reconstruct the signal. In this study, to analyse the financial time series, we choose the discrete wavelet transform (DWT), defined as follows: where ( ) is the basic wavelet with effective length (t) that is usually shorter than the target time series ( ). Using the DWT the original time series ( ) is decomposed to approximate series (A) and detailed (D) contains the rapid and sudden changes (see figure 2).

HYBRID SYSTEM DESIGN DWT-ANN
In this section, the prediction method will be described in detail. The main idea is to use as inputs for the MLP (NAR) network, the components of the subseries (details and approximations) which are derived from the use of the discrete wavelet transform on the original data of the time series according to the following steps: • Step 1: Dividing the data into a training set and testing set (65%, 25%, 10%).
• Step 2: Data Pre-processing, using the discrete wavelet transform in order to obtain the approximation coefficients and detail coefficients of the original time series.
• Step 3: We use the approximation and detail coefficients as input to the nonlinear autoregressive neural network models. The network gives output as coefficients only.
• Step 4: We reconstructed the output coefficients from the ANN using inverse wavelet function.

Performance evaluation
This step consists in evaluating the models formed by comparing the difference between the , with ̅ = 1 ∑ =1 and N is the number of sample.

RESULTS AND DISCUSSION
The data used in this study was collected from the "https://www.investing.com/" website. It represents the daily exchange rate EUR/USD, the Brent oil price and NASDAQ composite price between 02 January 2015 and 31 December 2020 (see figures 3, 4 and 5).
In a first part of the simulation, we apply the Box and Jenkins methodology [19] to the three financial time series, in order to determine the best ARIMA model, by following to three main step: Identification, Estimation, and Model checking according to the smaller AIC and BIC values and the higher likelihood value [20]. The most suitable model according to the smaller AIC and BIC values and the higher likelihood value for the daily exchange rate EUR/USD is ARIMA (1,1,1), for the Brent oil price is ARIMA (1,1,0) and for the NASDAQ composite price is ARIMA (0,1,2).
In the second part of the simulation, we have chosen the Daubechies wavelet as the mother wavelet 5493 FINANCIAL TIME SERIES PREDICTION and a decomposition number equal to 7 to represent our signals in the time scale domain. The level of decomposition depends on the sampling frequency of the signal to be analysed, it is determined by the application of to the following formula: where 'L' is the level of decomposition and 'N' is the signal length. Note that the original time series can be synthesized by the approximation and detail sequences, i.e., = 7 + 7 + 6 + 5 + 4 + 3 + 2 + 1 (see figures 6, 7 and 8). After decomposing the time series, we use the sub series as inputs to our artificial neural network. In this study, the number of hidden nodes was determined by the learning algorithm [9]. The architecture and parameters of the NAR and DWT-NAR used for each data are described in the following table.    Table III. We find that the decomposition of the financial series in detail and approximation coefficients and use them as new entries of the studied system, optimizes the results obtained (see figures 9, 10 and 11).

CONCLUSION
In this article, a method for predicting financial time series was presented. This method was developed by the combination of the nonlinear autoregressive neural network and the wavelet transform. This combination was performed by taking as inputs to the neural network the approximations and details obtained by decomposing each input variable using the discrete wavelet transform. This method was applied to the series of exchange rate EUR/USD, the Brent price and NASDAQ composite price. The results clearly surpass those obtained by using the ARIMA model and nonlinear autoregressive neural networks (inputs undecomposed).

DATA AVAILABILITY
The data used to support the findings of this study are available from the corresponding author upon request.

CONFLICT OF INTERESTS
The author(s) declare that there is no conflict of interests.