Title: Stock price forecasting using hidden Markov model

Authors: Ernest Oseghale Amiens; Ifuero Osad Osamwonyi

Addresses: Department of Business Administration, Benson Idahosa University, P. M. B. 1100, Benin City, Nigeria ' Department of Banking and Finance, Faculty of Management Sciences, University of Benin, P. M. B. 1154, Benin City, Nigeria

Abstract: We used hidden Markov model (HMM) with single observation to estimate stock prices of selected manufacturing companies from the Nigerian Stock Exchange. Data from 22 November 2013 to 6 July 2018 were partitioned into two datasets for training and testing. Subsequently, the data were differenced, trained, tested and used to forecast closing prices for 60 days for each equity. The HMM was implemented with Matlab. The research revealed closing price prediction accuracy ranging from 3.33% to 96.67% and trade signal precision ranging from 31.67% to 97.67%. Also, the MAE values range from 0.0013 to 34.2867 while the MAPE values are between 0.1498% and 6.0034%. The hypothesis tested revealed that the model is efficient. Similarly, the comparison test conducted revealed the performance of HMM is better than ARIMA and neural network (NN). The research proposes that hidden Markov model be adopted in the exercise of stock price forecasting.

Keywords: stock forecasting; hidden Markov model; HMM; stock price; manufacturing firms; neural network; auto-regressive integrated moving average; ARIMA; mean absolute percentage error; MAPE; Nigerian Stock Exchange; NSE; forecast accuracy.

DOI: 10.1504/IJIDS.2022.122721

International Journal of Information and Decision Sciences, 2022 Vol.14 No.1, pp.39 - 59

Received: 02 Oct 2019
Accepted: 06 Apr 2020

Published online: 09 May 2022 *

Full-text access for editors Full-text access for subscribers Purchase this article Comment on this article