HYBRID MODELING TRANSFER FUNCTION–GRU WITH NEWS SENTIMENT AS INPUT SERIES FOR STOCK PRICE PREDICTION
(Case Study on JCI Stock Price Data for 2019-2021 Period)
ABSTRACT
Time series data is a collection of observations made consecutively or sequentially over time. Time series data often consist of observations containing several variables. Time series analysis involving more than one variable is called multivariate time series analysis. Time series modeling that has a one-way relationship between variables can be done using a transfer function model. The purpose of transfer function modeling is to establish a simple model, which relates the output series to the input and noise series. The transfer function model can map linear relationships well but cannot be used practically in stock prediction, so the GRU model is needed. Gated Recurrent Unit (GRU) is a nonlinear model based on artificial neural networks. Shares are a sign of capital participation of a person or party (business entity) in a company or Limited Liability Company (PT) commonly called issuer. Currently, the Indonesia Stock Exchange has 37 stock indices, one of which is the Jakarta Stock Exchange Composite Index (JCI) which is an index that measures the price performance of all stocks listed on the Main Board and Development Board of Indonesia Stock Exchange (IDX). The existence of nonlinearity in stock price data requires a combination model between linear and nonlinear models. Hybrid transfer function-GRU model is the combination of the transfer function model with the results of sentiment analysis on financial news as input and the GRU is used for modeling the residuals from the transfer function model. The model formed from the closing price of the stock with a compound score resulting from sentiment analysis as an input series is a hybrid transfer function(0,0,1)([3],1,0)-GRU model with 50 units and 1 hidden layer. MAPE values obtained in the training and testing data are 0.11% and 1.44% respectively. Thus, the hybrid transfer function-GRU model can predict the closing price of JCI shares very accurately on training and testing data.
Keywords: News Sentiment, Transfer Function, GRU, Hybrid, Stock price
- news_scrapping.py: code for scrapping stock news using Selenium from id.investing.com website
- main_code.Rmd: code for analysis using Vader Sentiment Analyzer and hybrid model Transfer function - GRU
*Rmd not only uses R programming language but also Python for machine learning modeling