scholarly journals An LSTM and GRU based Trading Strategy Adapted to the Moroccan Market

Author(s):  
Yassine Touzani ◽  
Khadija Douzi

Abstract Forecasting stock prices is an extremely challenging job considering the high volatility and the number of variables that influence it (political, economical, social, etc.). Predicting the closing price provides useful information and helps the investor to make the right decision. The use of deep learning and more precisely the recurrent neural networks RNNs in stock market forecasting is an increasingly common practice in the literature. The Long Short Term Memory LSTM and Gated Recurrent Unit GRU architectures are among the most widely used types of RNN networks, given their suitability for sequential data. In this paper, we propose a trading strategy designed for the Moroccan stock market, based on two deep learning model: Long Short Term Memory LSTM and Gated Recurrent Unit GRU to predict respectively close price for short and mid term horizon. Decision rules for buying and selling stocks are implemented based on the forecasting given by the two models, then over four three-years periods, we simulate transactions using these decision rules with different parameters for each stock. We only hold stocks that ensure a return greater than a benchmark return over the four periods. Random search is then used to choose one of the available parameters and the performance of the portfolio built from the selected stocks will be tested over a further period. The repetition of this process with a variation of benchmark return makes it possible to select the best possible combination of stock each with the parameters optimized for the decision rules. The proposed strategy produces very promising results and outperform the performance of indices used as benchmarks in the local market.

2021 ◽  
Vol 7 (2) ◽  
pp. 133
Author(s):  
Widi Hastomo ◽  
Adhitio Satyo Bayangkari Karno ◽  
Nawang Kalbuana ◽  
Ervina Nisfiani ◽  
Lussiana ETP

Penelitian ini bertujuan untuk meningkatkan akurasi dengan menurunkan tingkat kesalahan prediksi dari 5 data saham blue chip di Indonesia. Dengan cara mengkombinasikan desain 4 hidden layer neural nework menggunakan Long Short Term Memory (LSTM) dan Gated Recurrent Unit (GRU). Dari tiap data saham akan dihasilkan grafik rmse-epoch yang dapat menunjukan kombinasi layer dengan akurasi terbaik, sebagai berikut; (a) BBCA dengan layer LSTM-GRU-LSTM-GRU (RMSE=1120,651, e=15), (b) BBRI dengan layer LSTM-GRU-LSTM-GRU (RMSE =110,331, e=25), (c) INDF dengan layer GRU-GRU-GRU-GRU (RMSE =156,297, e=35 ), (d) ASII dengan layer GRU-GRU-GRU-GRU (RMSE =134,551, e=20 ), (e) TLKM dengan layer GRU-LSTM-GRU-LSTM (RMSE =71,658, e=35 ). Tantangan dalam mengolah data Deep Learning (DL) adalah menentukan nilai parameter epoch untuk menghasilkan prediksi akurasi yang tinggi.


Atmosphere ◽  
2020 ◽  
Vol 11 (4) ◽  
pp. 348 ◽  
Author(s):  
Guang Yang ◽  
HwaMin Lee ◽  
Giyeol Lee

Both long- and short-term exposure to high concentrations of airborne particulate matter (PM) severely affect human health. Many countries now regulate PM concentrations. Early-warning systems based on PM concentration levels are urgently required to allow countermeasures to reduce harm and loss. Previous studies sought to establish accurate, efficient predictive models. Many machine-learning methods are used for air pollution forecasting. The long short-term memory and gated recurrent unit methods, typical deep-learning methods, reliably predict PM levels with some limitations. In this paper, the authors proposed novel hybrid models to combine the strength of two types of deep learning methods. Moreover, the authors compare hybrid deep-learning methods (convolutional neural network (CNN)—long short-term memory (LSTM) and CNN—gated recurrent unit (GRU)) with several stand-alone methods (LSTM, GRU) in terms of predicting PM concentrations in 39 stations in Seoul. Hourly air pollution data and meteorological data from January 2015 to December 2018 was used for these training models. The results of the experiment confirmed that the proposed prediction model could predict the PM concentrations for the next 7 days. Hybrid models outperformed single models in five areas selected randomly with the lowest root mean square error (RMSE) and mean absolute error (MAE) values for both PM10 and PM2.5. The error rate for PM10 prediction in Gangnam with RMSE is 1.688, and MAE is 1.161. For hybrid models, the CNN–GRU better-predicted PM10 for all stations selected, while the CNN–LSTM model performed better on predicting PM2.5.


Author(s):  
В.А. Мочалов ◽  
А.В. Мочалова

В работе с помощью глубокого обучения рассматривается прогнозирование значений следующих геомагнитных индексов (ГИ): Dst, Kp, AE и AP. Для прогнозирования используются архитектуры долгой краткосрочной памяти (LSTM) и управляемых рекуррентных блоков (GRU). Для различных ГИ индексов анализируется функция потерь в за-висимости от периодичности исходных данных. Установлено, что чем меньше периодичность исходных данных ГИ тем точнее осуществляется прогноз следующего значения ГИ. Для анализа использовались следую-щие периоды исходных данных ГИ: час, 3 часа, сутки. In this work, with the help of deep learning, predicting the values of the following geomagnetic indices (GI) is considered: Dst, Kp, AE and Ap. For forecasting we use the architectures are long short-term memory (LSTM) and gated recurrent unit (GRU). For various GI indices, the loss function is analyzed depending on the periodicity of the source data. It has been established that forecasting accuracy increases with decreasing periodicity of the initial data of geomagnetic indices. For the analysis, the following periods of the initial GI data were used: hour, 3 hours, day. For the analysis we used hour, 3 hours and day periods of the initial GI source data.


2021 ◽  
Vol 8 (1) ◽  
Author(s):  
Yassine Touzani ◽  
Khadija Douzi

AbstractForecasting stock prices is an extremely challenging job considering the high volatility and the number of variables that influence it (political, economical, social, etc.). Predicting the closing price provides useful information and helps the investor make the right decision. The use of deep learning and more precisely of recurrent neural networks (RNNs) in stock market forecasting is an increasingly common practice in the literature. Long Short Term Memory (LSTM) and Gated Recurrent Unit (GRU) architectures are among the most widely used types of RNNs, given their suitability for sequential data. In this paper, we propose a trading strategy designed for the Moroccan stock market, based on two deep learning models: LSTM and GRU to predict the closing price in the short and medium term respectively. Decision rules for buying and selling stocks are implemented based on the forecasting given by the two models, then over four 3-year periods, we simulate transactions using these decision rules with different settings for each stock. The returns obtained will be used to estimate an expected return. We only hold stocks that outperform a benchmark index (expected return > threshold). The random search is then used to choose one of the available parameters and the performance of the portfolio built from the selected stocks will be tested over a further period. The repetition of this process with a variation of portfolio size makes it possible to select the best possible combination of stock each with the optimized parameter for the decision rules. The proposed strategy produces very promising results and outperforms the performance of indices used as benchmarks in the local market. Indeed, the annualized return of our strategy proposed during the test period is 27.13%, while it is 0.43% for Moroccan all share Indice (MASI), 15.24% for the distributor sector indices, and 19.94% for the pharmaceutical industry indices. Noted that brokerage fees are estimated and subtracted for each transaction. which makes the performance found even more realistic.


Sensors ◽  
2021 ◽  
Vol 21 (14) ◽  
pp. 4884
Author(s):  
Danish Javeed ◽  
Tianhan Gao ◽  
Muhammad Taimoor Khan ◽  
Ijaz Ahmad

The Internet of Things (IoT) has emerged as a new technological world connecting billions of devices. Despite providing several benefits, the heterogeneous nature and the extensive connectivity of the devices make it a target of different cyberattacks that result in data breach and financial loss. There is a severe need to secure the IoT environment from such attacks. In this paper, an SDN-enabled deep-learning-driven framework is proposed for threats detection in an IoT environment. The state-of-the-art Cuda-deep neural network, gated recurrent unit (Cu- DNNGRU), and Cuda-bidirectional long short-term memory (Cu-BLSTM) classifiers are adopted for effective threat detection. We have performed 10 folds cross-validation to show the unbiasedness of results. The up-to-date publicly available CICIDS2018 data set is introduced to train our hybrid model. The achieved accuracy of the proposed scheme is 99.87%, with a recall of 99.96%. Furthermore, we compare the proposed hybrid model with Cuda-Gated Recurrent Unit, Long short term memory (Cu-GRULSTM) and Cuda-Deep Neural Network, Long short term memory (Cu- DNNLSTM), as well as with existing benchmark classifiers. Our proposed mechanism achieves impressive results in terms of accuracy, F1-score, precision, speed efficiency, and other evaluation metrics.


Author(s):  
Claire Brenner ◽  
Jonathan Frame ◽  
Grey Nearing ◽  
Karsten Schulz

ZusammenfassungDie Verdunstung ist ein entscheidender Prozess im globalen Wasser‑, Energie- sowie Kohlenstoffkreislauf. Daten zur räumlich-zeitlichen Dynamik der Verdunstung sind daher von großer Bedeutung für Klimamodellierungen, zur Abschätzung der Auswirkungen der Klimakrise sowie nicht zuletzt für die Landwirtschaft.In dieser Arbeit wenden wir zwei Machine- und Deep Learning-Methoden für die Vorhersage der Verdunstung mit täglicher und halbstündlicher Auflösung für Standorte des FLUXNET-Datensatzes an. Das Long Short-Term Memory Netzwerk ist ein rekurrentes neuronales Netzwerk, welchen explizit Speichereffekte berücksichtigt und Zeitreihen der Eingangsgrößen analysiert (entsprechend physikalisch-basierten Wasserbilanzmodellen). Dem gegenüber gestellt werden Modellierungen mit XGBoost, einer Entscheidungsbaum-Methode, die in diesem Fall nur Informationen für den zu bestimmenden Zeitschritt erhält (entsprechend physikalisch-basierten Energiebilanzmodellen). Durch diesen Vergleich der beiden Modellansätze soll untersucht werden, inwieweit sich durch die Berücksichtigung von Speichereffekten Vorteile für die Modellierung ergeben.Die Analysen zeigen, dass beide Modellansätze gute Ergebnisse erzielen und im Vergleich zu einem ausgewerteten Referenzdatensatz eine höhere Modellgüte aufweisen. Vergleicht man beide Modelle, weist das LSTM im Mittel über alle 153 untersuchten Standorte eine bessere Übereinstimmung mit den Beobachtungen auf. Allerdings zeigt sich eine Abhängigkeit der Güte der Verdunstungsvorhersage von der Vegetationsklasse des Standorts; vor allem wärmere, trockene Standorte mit kurzer Vegetation werden durch das LSTM besser repräsentiert, wohingegen beispielsweise in Feuchtgebieten XGBoost eine bessere Übereinstimmung mit den Beobachtung liefert. Die Relevanz von Speichereffekten scheint daher zwischen Ökosystemen und Standorten zu variieren.Die präsentierten Ergebnisse unterstreichen das Potenzial von Methoden der künstlichen Intelligenz für die Beschreibung der Verdunstung.


Sign in / Sign up

Export Citation Format

Share Document