Comparative Study of Box-Jenkins ARIMA and KNN Algorithm for Stock Price Prediction in Pakistan
Keywords:
Pakistan Stock Exchange, ARIMA, Forecasting, KNN algorithmAbstract
Stock market is considered a vital part of modern economic systems in the world. The fluctuation in the stock prices is of complex nature because multiple causative factors control these movements. This study was carried out to forecast the stock prices by applying two different techniques of knearest neighbors algorithm and Box-Jenkins ARIMA to compare their effectiveness. Three major contributing companies in Pakistan Stock Exchange were selected and the daily stock price data during the period 2014-2018 were used. In the first phase, Box-Jenkins methodology was adopted to build parsimonious ARIMA model for each series separately. The
k-nearest neighbors algorithm was also performed and forecasts were calculated. Lastly, Root Mean Square Error, Mean Absolute Error and Mean Absolute Percentage Error were used for comparison purpose of both techniques. It was observed that machine learning technique of k-nearest neighbors algorithm provided more accurate results as compared to ARIMA.