Recurrent neural networks and sequence to sequence models require a predetermined length for prediction output length. Our model addresses this by allowing the network to predict a variable length output in inference. A new loss function with a tailored gradient computation is developed that trades off prediction accuracy and output length. The model utilizes a function to determine whether a particular output at a time should be evaluated or not given a predetermined threshold. We evaluate the model on the problem of predicting the prices of securities. We find that the model makes longer predictions for more stable securities and it naturally balances prediction accuracy and length.
This makes markets inherently noisy and prone to fluctuations. Such inconsistencies in the valuation of stock prices has been the subject of a longstanding academic debate centred on the efficient market [see 3, 4] and random walk hypotheses [see 5, 6, 7], meaning whether such lagged correlations in the stock markets exist at all. Ferreira and Dioníso  deliver evidence against the efficient market hypothesis in the U.S. stock market, identifying market memory in the form of correlations over seven months, with related research finding evidence for long-term correlation in market indices . Previous research establishes the existence of lagged correlations in nonvolatile market environments for day-to-day forecasts when combined with infinite impulse response filtering in the data preprocessing. These inputs can be used to realise above-average accuracies in predicting price trend changes without the inclusion of data from the target stock as an input, delivering evidence against the random walk hypothesis and most forms of the efficient market hypothesis in stable market environments . The growing interest in research dealing with the use of artificial neural networks for stock market prediction is facilitated by the availability of large historical stock market trading data [11, 12, 13, 14].
Forecasting time series data is an important subject in economics, business, and finance. Traditionally, there are several techniques to effectively forecast the next lag of time series data such as univariate Autoregressive (AR), univariate Moving Average (MA), Simple Exponential Smoothing (SES), and more notably Autoregressive Integrated Moving Average (ARIMA) with its many variations. In particular, ARIMA model has demonstrated its outperformance in precision and accuracy of predicting the next lags of time series. With the recent advancement in computational power of computers and more importantly developing more advanced machine learning algorithms and approaches such as deep learning, new algorithms are developed to forecast time series data. The research question investigated in this article is that whether and how the newly developed deep learning-based algorithms for forecasting time series data, such as "Long Short-Term Memory (LSTM)", are superior to the traditional algorithms. The empirical studies conducted and reported in this article show that deep learning-based algorithms such as LSTM outperform traditional-based algorithms such as ARIMA model. More specifically, the average reduction in error rates obtained by LSTM is between 84 - 87 percent when compared to ARIMA indicating the superiority of LSTM to ARIMA. Furthermore, it was noticed that the number of training times, known as "epoch" in deep learning, has no effect on the performance of the trained forecast model and it exhibits a truly random behavior.
Financial time series prediction, especially with machine learning techniques, is an extensive field of study. In recent times, deep learning methods (especially time series analysis) have performed outstandingly for various industrial problems, with better prediction than machine learning methods. Moreover, many researchers have used deep learning methods to predict financial time series with various models in recent years. In this paper, we will compare various deep learning models, such as multilayer perceptron (MLP), one-dimensional convolutional neural networks (1D CNN), stacked long short-term memory (stacked LSTM), attention networks, and weighted attention networks for financial time series prediction. In particular, attention LSTM is not only used for prediction, but also for visualizing intermediate outputs to analyze the reason of prediction; therefore, we will show an example for understanding the model prediction intuitively with attention vectors. In addition, we focus on time and factors, which lead to an easy understanding of why certain trends are predicted when accessing a given time series table. We also modify the loss functions of the attention models with weighted categorical cross entropy; our proposed model produces a 0.76 hit ratio, which is superior to those of other methods for predicting the trends of the KOSPI 200.
Twitter is a microblogging and social media platform that allows users to communicate via short messages (280 characters) known as tweets [1, 2, 3]. It enables millions of users to express their opinions on a daily basis on a variety of different topics ranging from reviews on products and services to users' political and religious views, making Twitter a potent tool for gauging public sentiment . Thus, it manifestly follows that twitter data can be regarded as a corpus, forming the basis on which predictions can be made, and researchers have indeed exploited this fact to seek trends by performing numerous and varied analyses. A characteristic feature of the stock market is volatility and there is no general equation describing the prediction of stock prices, which is a complex function of a range of different factors. The methods of stock market prediction can be broadly classified into Technical Analysis and Fundamental Analysis . The latter involves the consideration of macroeconomic factors as well as industry specific news and events to guide investment strategies . The analysis of public sentiment via tweets performed in this project can be regarded as an aspect of Fundamental Analysis. Although the prediction of stock prices is highly nuanced, the Efficient Market Hypothesis (EMH), propounded by Eugene Farma in the 1960's, suggested a relation between public opinion and stock prices . The semi-strong form of the EMH implies that current events and new public information have a significant bearing on market trends [1, 6].