Implications of Neural Networks in Price Forecasting

In many ways, the world revolves around money. Money flows in and out of markets at all demographic levels and are very important to societies as a whole. Markets have historically proven themselves to be volatile and unstable, and one point of predicting markets is to look at price forecasts. Price forecasting is the prediction of a certain entity's price with respect to many external factors. It without a doubt is one of the most pivotal techniques that provides incredibly important insight to businesses and investors hence playing a pivotal role in the overall economy. For decades, people have struggled to generate accurate and reliable forecasts, however, with further research and developments within the field of machine learning, many new methods are being integrated in order to create predictive models that can perform with great accuracy. One such topic/system being utilized is the neural network. Arguably the most interesting application technique from the field of machine learning to price forecasting, neural networks have significant upside to their predictive accuracy due to their ability to compute problems that are otherwise infeasible to complete by any human and statistical standards. Though often vaguely compared to the human brain, their speed and operation are quite the contrary, making the human brain look like a brick. Neural networks by nature have the property of being nonlinear models, making them very useful to learn heavy and complex data sets, which inherently is better suited for real world applications. In short, neural networks provide a strong path to solving the longtime challenge of predicting dynamic prices and markets, which would allow many people to have gained wealth through easily made proper investments and/or benefit from a heightened economy.

One of the papers that was analyzed was a 1988 publication by IBM, titled “Economic Prediction Using Neural Networks: The case of IBM Daily Stock Returns”, published by Dr. Halbert White from the University of California San Diego. The problem in this article is that financial traders were trying to search for and decode nonlinear regularities for asset price movements, in order to yield a profit. This proposal attempts to utilize neural networks to determine minute-to-minute fluctuations in stock prices. They use the IBM stock in order to train and evaluate performance. The neural network training data consists of 1,000 training days from 1975 to 1978 and 500 evaluation days from 1972 to 1974 and and from 1978 to 1980. The metric that the researchers want to solve is the return price which is the  profit divided by the opening price. The neural network equation is a result of the multiplication of certain weights and previous return percentages and a bias term. The researchers want to measure the correlation with the neural network, using a sigmoid function and a gradient descent function to determine the least squares weights that would result in the output, or return percentages on future testing time series.  The researchers determined a correlation value of 0.0097. This value is very low, failing to refute the simple efficient market hypothesis. The researchers then added a hidden layer to the neural network in order to see if the complexity can benefit the accuracy of the evaluation network. The network utilized both backpropagation and a tanh squashing function to predict future returns, and eventually, future prices. This was a nonlinear least squares method that yielded a correlation coefficient of 0.175, which is promising. However, this “correlation” still fails to successfully refute the simple efficient market hypothesis, since the evaluation network yielded another insignificant correlation (0.0996) due to overfitting. This means that a perceptron neural network is not a money-making machine. 


After analyzing both the networks created, the researchers concluded that utilizing their perceptrons failed to produce a significant correlation with price prediction success. The efficient markets hypothesis is indicative that all of the weights are theoretically zero, since there would be no correlation between the network prediction and the actual market results. However, the researchers only measured this empirical model with a very simple model. What they should have done was attempt to add more hidden networks, vary the values of the gradient more often, or compare many different activation functions. Since the hidden network seemed to show more promise, adding more layers might possibly increase the correlation coefficient. This correlation is measured by 1 divided by the quotient between variation of the original series of returns and the variation of the predicted series, indicating that the researchers are looking for similar variations among the test and evaluation models based on the same group of weights. The researchers must be careful to refute the efficient markets hypothesis, since the out-of-sample forecast experiments failed to produce similar results, and more out-of-sample correlations should be produced to confirm this statement. The least squares method might not be the best way to evaluate the network performance. Outlier removal, or even support vector machines are other viable options to test. 


Another article that was analyzed, The Application of Stock Index Price Prediction with Neural Network, was published in August of 2020 by data engineers at the Xi’an Jiaotong-Liverpool University. In this article, the authors used 4 different machine learning methods to test their effectiveness on predicting stock index price positions on the CSI300, the SP500, and the Nikkei225 indexes. The 4 methods were the Multi-Layer Perceptron, the Long Short-Term Memory, Convolutional Neural Networks and Uncertainty-Aware Attention (UA). A multilayer perceptron is a standard neural network with inputs, hidden-layers and outputs and utilizes backpropagation to update its values. LSTMs are composed of cell, input, output, and forget gate. It remembers the values given over a certain time interval and has 3 gates that regulate the flow of information into and out of the cell. CNNs contain convolution, pooling, and fully connected layers, with nonlinear activation functions between each layer. It uses convolution, which is a linear operation in place of matrix multiplications, and it can reduce the complexity of a network by not having as many interconnected weights as a standard perceptron. UA is an attention-based model using Recurrent Neural Networks (RNN) as its basic structure, using 2 RNNs with raw time series data and generates “attention” using inference. The inputs to each network are dependent on 7 parameters. These parameters are as follows: the daily opening price, the daily closing price, the trading volume for a particular index, the price volatility, the Moving Average Convergence Divergence, the exchange rate, and the input weight. There is 1 output with 2 possible values : 1 if the stock goes up and 0 if the stock goes down. 90% of the data are used to train models and 10% of the data are used to test the models.There are 5 hidden layers with the RELU activation function. The sigmoid and Tanh functions are used in the LSTM model. For CNN, each convolution layer has the same kernel size of 3, and for all methods, time step is 20 learning rate is 0.001 and the Mean-squared error is used as the measurement for performance. This uses PyTorch and the loss function implements Adam. Performance is calculated with the Mean Absolute percentage error, the root mean squared error, and the correlation coefficient. The results yielded promising data with the attention-based model achieving the best results in terms of financial time series prediction, followed closely by the convolutional neural network in all metrics. The data predictions were the most consistent with the actual results for the SP500 index.


After analyzing the article in the above paragraph, it was concluded that the price of financial markets are majorly affected by news, volatility and events that occur around the planet. In contrast to the example with Dr.Halbert White, where only one index (IBM) was trained and evaluated, the following data that the Jiaotong-Liverpool researchers exploited came from various sectors, including Automotive, Banking, and Information Technology. This helped to guarantee less bias and more variety, producing possibly more reliable results. The researchers did a fine job ensuring that there is sufficient variety of methods (and combination of methods) in order to reach a viable conclusion, testing the data on all 3 indexes with 4 different methods, resulting in 12 outputs to compare and evaluate. There were also more inputs in contrast to merely the just the previous price time series distribution, allowing more weights and factors to tweak in the network and giving the authors more insight into what directly affects the index price patterns. Also in contrast to the first article the researchers measured error and accuracy in 3 metrics: the Mean Absolute percentage error, the root mean squared error, and the correlation coefficient (versus. just the Root Mean Square Error in the IBM article). It is believed that since the Uncertainty-Aware Attention model utilized Natural Language Processing (NLP) to drive its predictions, the news and any information reported on social media networks play an integral effect into determining the price of any stock index. The article also states that the SP500 had more stable/less volatile price changes resulting in greater accuracy for each of the algorithms. This is mostly likely because the stocks in well-developed countries as a whole are regulated more and fluctuations are prevented in contrast to the stock indices of developing countries, such as the CSI300 index in China.


Another article that was analyzed, “Indian stock market prediction using artificial neural networks on tick data”, was published by D. Selvamuthu, V. Kumar, and A. Mishra. Through the use of tick data, the change in price of a security between trades, this group modeled neural networks based on three separate types of learning algorithms: Bayesian Regularization, Levenberg-Marquardt (LM), and Scaled Conjugate Gradient (SCG). They did this in order to determine which of these learning algorithms is the best by comparing results of their accuracy in response to said tick data. Bayesian regularized artificial neural networks (BRANN) penalize large weights so that the mapping becomes smoother. As more hidden layers are added to a neural network, the odds of overfitting skyrocketed. BRANNs by nature are difficult to overtrain because they have aforementioned penalties implemented in validation steps. They also found that BRANNs perform more freely than typical backpropagation as they demand less cross-validation. The LM algorithm is commonly applied to solving nonlinear least squares problems with the purpose of avoiding having to compute the Hessian. Instead it uses Jacobian matrices, that for some parameter ranges can behave like small step gradient descent. This makes it very well suited to handle slow convergence situations. SCG is steps along the conjugate directions which is typically faster than stepping in the commonly used steepest-descent direction. SCG is much faster than LM as it is fully-automated and doesn’t have any user-dependent parameters. Through their tests, they found that the algorithms were highly accurate. The tick data they used was from a multinational conglomerate company called Reliance Private Limited. This data spanned a time period between 11/20/17 to 01/11/18, that had approximately 15,000 data points per day. This amounts to a total of roughly 430,000 data points! This large data set in combination with their evidently correct mathematics involved with their algorithmic implementations, provide grounds of evidence that their approach is effective. All three had an accuracy of 99.9% using just the tick data but then over a 15 minute dataset (taking stock price from the beginning of each 15 minute interval of the tick data, essentially quantizing the data), the accuracy dropped for BR, LM, SCG to 98.9%, 96.2%, and 97%. Despite the significant drops, it showed that Bayesian Regularization reigned superior, over the other two learning algorithms for the neural network.


The findings in this article were very intriguing and there are many benefits to the approach taken. One such plus in their methodology was that the dataset that they used was quite vast, with a total of around 430,000 data points. On the other hand, despite having such a large dataset, it is not made clear how much of the data was useful and reliable data or cleansed, especially given that several of the models require validation steps and some do not require any cross validation of the data. This in turn could make sway overfitting for some of the models. Any significant data anomalies in the dataset that could have influenced the overall accuracy of the model, this is only an assumption being made for the sake of saving time. Though the latter situation is unlikely, it is not ruled impossible by any means as this is a three week time period. It would have also been nice if they ran this experimental procedure for several sets of data (perhaps from different companies) to truly show that their findings are indeed universal. They run their models each for 16 epochs, 19 epochs, 60 epochs, 109 epochs, and 1000 epochs. It is unclear as to why they chose these very specific numbers of iterations, especially with a couple of them being quite similar. Their results could be a bit more established by doing one more run set with an even higher number of epochs (above 1000). Nonetheless, their regression plots showed that their overarching findings and results were solidified, and even if there were areas where they could have expanded their testing ranges, it wouldn’t have made much of a difference. Finally, the last thing that could have given more data accuracy for more direct meaning would be for them to use a minute by minute data set instead of a fifteen minute data set, which would significantly reduce the size of the dataset while also being more comparable to historical data. It was mentioned that the BR took a couple days to train, whereas SCG took a few minutes to train. So, these methods can be used realistically in day to day applications, though BR takes a long time, it gives much better results than LM and SCG. Overall, their findings do in fact seem legitimate as the mathematics and theory backs it up as well. While there are areas that could have been improved, they did prove a qualitative conclusion by the end of their trials.


The final article that was analyzed, “Stock Price Prediction using Artificial Neural Networks”, was published by P. Dhenuvakonda, R.Anandan, and N.Kumar. It should now be clear that neural networks can be helpful in stock market predictions, but what forms of neural networks provide an edge or benefit over each other. The group from Vels Institute of Science, Technology and Advanced study sought to analyze how different types of neural networks can be used for predicting the stock market. The five main classes that they considered were Recurrent Neural Networks (RNN), Convolutional Neural Networks (CNN), Multilayer Perceptrons (MP), Artificial Neural Networks (ANN), and Long Short-Term Memory Models (LSTM). RNNs have input from a ‘present’ source and a ‘past’ source and use these to model reaction to new input. LSTMs are a type of RNN that use memory blocks instead of neuron layers. A memory block has three gates and a state-machine that controls the flow of data in the cell. This group of researchers took a dataset from a company called Infratel that encapsulated many properties/associated information to the stocks of the company (high, low, volume, closing, opening, …). Their goal was to use this set of data and their various different classes of neural networks to predict a specific day’s (61st) stock market price for the company. Through their models, they came to the conclusion that all of the models were fairly efficient in recognizing underlying patterns in the stock market. This in itself is not trivial because this claim also asserts the fact that there are underlying patterns in the stock market, which is something that is debated upon heavily in regards to the degree of which there is a pattern and how realistic chasing a pattern is. Specific to their initial proposition of comparing the classes of neural networks, they found that the LSTM model could predict fairly close values, and was only topped by true ANNs that utilized deep learning.


The findings that they developed were not fully conceived for by the end of all of their trials and their main finding was that ANN surpassed ARIMA models (which are linear). This is really quite obvious given that the market does not operate linearly. Their data set was incredibly small, as they only had one data point per parameter (where there were a total of 6 measured parameters) over the 60 day dataset they were utilizing in order to predict the 61st day. This is very small, especially in comparison to the dataset size we saw used by the group in the previous article. It is difficult to say that their results can hold up multiple further predictions given that their lack of data probably gave them a severely under fitted model. On the other hand, it is in general difficult to quite specifically say how much data a model needs. The skepticism arises due to the complexity of the problem and algorithm they are trying to develop. Their computations are not super heavy and are definitely tractable for real world applications. While their evidence for effectiveness is not very compelling, the implementation of their method was correct. And though their method has some flaws in regards to their training, the conclusions drawn are still noteworthy.


To conclude, 4 different articles were analyzed in regards to implementing different types of Neural Networks for Price Forecasting. From the experiments, it was apparent that there was not a clear-cut solution for predicting index prices using Neural Networks, but there were potential candidates, such as using Natural Language Processing or Bayesian Networks, as they yielded promising results. It was also determined that price cannot be (or is very unlikely to be) determined by forecasting or linear patterns alone but by a combination of patterns, and news that directly contain index sentiments, along with mean averages and volatility measurements. The limitations of this work is that there is a great potential for overfitting, and it can be difficult to predict more volatile prices, as there is a greater element of uncertainty and risk for those funds. The researchers also weren't able to analyze the stocks in ever-growing sectors such as pharmaceuticals, a volatile market especially in the COVID-19 pandemic. The high-frequency of algorithmic trading prompts investors to collect more data, to help predict the probability of a company success, and invest in those promising corporations . Algorithmic trading also renders markets more liquid by eliminating the impact of emotions on trading activities, and as a result, prices.


Comments

Popular Posts