Laporkan Masalah

Stock Price Prediction Using HMM-LSTM Method

Leo Harnadi Marlin, Faizal Makhrus, S.Kom., M.Sc., Ph.D

2024 | Skripsi | ILMU KOMPUTER

Pasar saham merupakan komponen penting dalam perekonomian suatu negara. Pedagang saham perlu memprediksi tren pasar saham agar dapat mengambil keputusan yang tepat untuk sahamnya, seperti menjual atau membelinya. Namun, pasar saham pada dasarnya bergejolak dan sulit untuk diprediksi.

Ada banyak metode yang dapat digunakan untuk memprediksi pasar saham, seperti penggunaan modular neural network, sentiment analysis, dan convolutional neural network. Dari metode-metode tersebut, penelitian ini mengeksplorasi HMM dan LSTM, karena keduanya cocok untuk melakukan prediksi harga saham.

Beberapa model diciptakan untuk memprediksi harga pasar saham, di antaranya adalah model HMM-LSTM dengan jumlah HMM hidden states yang berbeda, model LSTM sebagai pembanding, dan varian BLSTM. Hyperparameter model ini juga dioptimalkan selama pelatihan. Setelah dievaluasi dengan RMSE, MAPE, dan MAE, ditemukan bahwa model HMM-LSTM dengan 4 hidden states lebih baik dibanding dengan model standar dan BLSTM. Secara khusus, untuk RMSE dan MAE, kinerjanya masing-masing 0,08% - 0,74?n 0,08% - 0,25% lebih baik dibandingkan dengan model LSTM standar. Namun, model HMM-LSTM dengan 3 nomor status tersembunyi memiliki kinerja lebih buruk dibandingkan model standar dan BLSTM. Jika dibandingkan dengan model LSTM, kinerjanya masing-masing 0,03% - 0,31%, 1,17% - 5,48%, dan 1,27% - 3,58% lebih buruk untuk MAPE, RMSE, dan MAE.

The stock market is a vital component of a country’s economy. Stock traders need to predict trends in stock market behavior in order to make the correct decisions for their stocks, such as selling or buying it. However, stock markets are volatile by nature and it is challenging to predict them.

There are many methods which can be used to potentially predict the stock market, such as using modular neural network, sentiment analysis, convolutional neural network, etc. Out of these methods, this research explores HMM and LSTM, as they are both promising and suitable for a Time Series prediction problem.

Multiple models were created to predict the stock market closing price, among which are HMM-LSTM models with differing number of HMM hidden states, an LSTM model as comparison, and their BLSTM variants. Hyperparameters of these models are also optimized during training. After evaluating with RMSE, MAPE, and MAE, it is found that the HMM-LSTM model with 4 hidden states performed better than both their standard and BLSTM counterparts. Specifically, in terms of RMSE and MAE, it performed 0.08% - 0.74% and 0.08% - 0.25?tter compared to the standard LSTM model, respectively. However, the HMM-LSTM model with 3 numbers of hidden states performed worse than both their standard and BLSTM counterparts. When compared to the LSTM model, it performed 0.03% - 0.31%, 1.17 % - 5.48%, and 1.27% - 3.58% worse in terms of MAPE, RMSE, and MAE, respectively.

Kata Kunci : Stock Market Predictions, Neural Network, Hidden Markov Model, Long Short-Term Memory, Predictive Model, Error Measurement Tools

  1. S1-2024-444306-abstract.pdf  
  2. S1-2024-444306-bibliography.pdf  
  3. S1-2024-444306-tableofcontent.pdf  
  4. S1-2024-444306-title.pdf