STOCK MARKET PREDICTION USING ARIMA MODEL Dr A.Haritha 1 Dr PVS Lakshmi 2 G.Lakshmi 3 E.Revathi 4 A.G S S Srinivas Deekshith 5 1,3 Assistant Professor, Department of IT, PVPSIT. 2 Professor, Department of IT, PVPSIT. 4,5 Research Scholar, Department of IT, PVPSIT. ABSTRACT: The Stock market is an important financial subject for a significant number of people. Generally, a stock market exchange consists of investments to improve the effectiveness of national economy. The stock market forecasting is essential to analyze the future stock's returns on investment by using the present stock values. Stock market forecasting is one way to identify whether the stocks are profitable or not. Many of the investors may find it very difficult to invest their money in a particular stock company. So they are trying to find a technique to analyze and forecast the stock trade and minimize the risk of investment. By using the present stock market data, we can predict the values to get the future stock trends. Keywords: Stock Market, Investment, Stock value, Profitable, Stock market. [1] INTRODUCTION Nowadays, the stock market is an important financial subject for a significant number of people. Generally, a stock market exchange consists of investments to improve the effectiveness of national economy. The stock market forecasting is essential to analyze the future stock's returns on investment by using the present stock values. Stock market forecasting is one way to identify whether the stocks are profitable or not. Many of the investors may find it very difficult to invest their money in a particular stock company. So they are trying to find a Dr A. Haritha Dr PVS Lakshmi G. Lakshmi E. Revathi A. G S S Srinivas Deekshith 294
STOCK MARKET PREDICTION USING ARIMA MODEL technique to analyze and forecast the stock trade and minimize the risk of investment. By using the present stock market data, we can predict the values to get the future stock trends. Here, we are introducing a new forecasting model called time series analysis to solve the forecasting problems for investors. Time series forecasting is defined as a statistical method which analyzes the data set and predicts the future values of a stock market. By applying time series analysis with ARIMA model, we can analyze and forecast the stock values. Time series uses a ts() function to convert a numeric vector into an R object. First, we collected a dataset from yahoo finance and by using ARIMA(p,q,d) model, datasets predicted the future stock prices with their corresponding graphical format. ARIMA is a forecasting model to make predictions by utilizing historical data. The graph has two models seasonal and non-seasonal auto-arima. It indicates the future stock return on investments at the time of seasonal and nonseasonal. These values are used to make a decision for the stock market investors. We conclude that this forecasting model helps to analyze and predict the future stock exchange data. [2] LITERATURE SURVEY The weekly stock market data from Google trends and yahoo finance servers. Then applied time series analysis and regression to the data and made an ARIMA model for forecasting the stock values. The result displays changes in weekly stock prices.[1] The basic ARIMA model has significant success in modifications such as clustering time series from ARIMA models with clipped data. The clustering of data derived from ARIMA model using k-means and k-medoids algorithms. This clustering technique is mainly used to assess the effects of discrete data.[2] A hybrid methodology that exploits the ARIMA model and the SVM model in forecasting stock prices problems. Real data sets of stock prices were used to examine the forecasting accuracy of the proposed model.[3] The closing values of the index are predicted by using an artificial neural network. Neural Network is one of the models used to predict the index value of a stock market. The model uses preprocessed dataset up to 4 years of trading days.[4] Prediction of stock prices using sentiment analysis from social media by using data mining. Data mining has different methods, which are used to forecast a stock market data more efficiently along with hybrid approaches.[5] [3] METHODOLOGY Dr A. Haritha Dr PVS Lakshmi G. Lakshmi E. Revathi A. G S S Srinivas Deekshith 295
Figure: 1 Process flow 1. Data Acquisition: Data acquisition means acquiring different types of data such as textual data and numerical data from servers. Here, we are using a quantmod package to get the stock market datasets from yahoo finance and google servers. Quantmod means a quantitative financial modeling framework and that makes modeling easier to avoid duplications in a data. Each dataset has an individual stock symbol. 2. Data classification: Data classification is the process of organizing data into different categories for its more efficient use. The time series function is applied to the data and omit any null values and set the frequency for the time series. It was formulated as ts(vector,start=,end=,frequency=). For time series function, we using Tseries package to convert a numeric vector into R time series object, which can also be used to create an ARIMA model. 3. Data decomposition: Data decomposition means splitting the data into smaller tasks. The data is then decomposed using the STL(Seasonal Trend Decomposition Of Time Series By Loess) function with s.window as periodic for seasonal extraction.the stl() is an algorithm used to divide a time series into three components such as trend, seasonality, and remainder. We can run stl() by specifying a data frame. 4. Arima Model: Dr A. Haritha Dr PVS Lakshmi G. Lakshmi E. Revathi A. G S S Srinivas Deekshith 296
STOCK MARKET PREDICTION USING ARIMA MODEL The data is filtered seasonally by applying the seasadj function, after which the auto.arima function is applied, an automated arima model which should be able to predict the future data approximately. A seasadj() means seasonal adjustment, it returns seasonally adjusted data. The forecast package provides functions for the automatic selection of exponential and ARIMA models. The auto.arima() function can handle both seasonal and non-seasonal ARIMA models. Models are chosen to maximize one of several fit criteria. 5. Forecasting the data: Forecasting data means predicting the future values. The data is predicted by using the forecast function based on the daily wise data with the time intervals. A forecast() is used to invoke methods, that depends on the first argument in the class. The predicted data is displayed in the form of graph and tables. The ggplot2 package is a plotting system in R language. It is used to plot a graph that makes it easy to find multi-layered graphics. The graph represents the profit and loss stock values that uses to the investors for making a decision on investment. [4] RESULTS Figure: 2 The front end for choosing Non-seasonal and seasonal data: The above dashboard represents an option for selecting different models of data such as seasonal and Non-seasonal models. Seasonal data means, at which time the stock prices are fixed. Non-seasonal model means the stocks have fluctuations. There is a stock code text box, to enter the stock symbol of any company. Dr A. Haritha Dr PVS Lakshmi G. Lakshmi E. Revathi A. G S S Srinivas Deekshith 297
Figure: 3 Select any company and predict a graph for Non-seasonal data: Select APPLE company dataset from yahoo finance server. There is a particular stock symbol for APPLE stock dataset as AAPL. Type the stock code and select a Non-seasonal option, then click on predict button. It plots an auto-arima Non-seasonal graph with their corresponding predicted stock values, i.e. the daily close prices of APPLE(AAPL) stock over the time intervals. Figure: 4 Forecasting stock values of APPLE (APPL) seasonal data: The above graph represents an Auto Arima seasonal model for APPLE stock data. The graph predicts point forecasting stock values with the time intervals. The seasonal data always a fixed data without fluctuations in predicted values. Dr A. Haritha Dr PVS Lakshmi G. Lakshmi E. Revathi A. G S S Srinivas Deekshith 298
STOCK MARKET PREDICTION USING ARIMA MODEL Figure: 5 The time series forecasting for GOOG non-seasonal stock data: Select another company stock prices to predict the future the values. Here, GOOGLE company stock dataset is selected and it contains a symbol as GOOG. Select a Non-seasonal option and click on the predict button. A Non-seasonal data shows the rise and falls of stock values. We plotted a graph for predicting stock prices with their corresponding low and high values of a Google company, i.e. the daily stock close prices. Figure: 6 Basic ARIMA model for GOOG seasonal stock data: Dr A. Haritha Dr PVS Lakshmi G. Lakshmi E. Revathi A. G S S Srinivas Deekshith 299
In this graph, time series analysis is applied to Google company dataset. The graph represents an auto-arima seasonal model. A seasonal data represents fixed values, we can call it as periodic time series. The graph plots between predicted stock values and their time intervals. I. II. [5] CONCLUSION: The Stock market analysis is a major issue in financial studies. Time series analysis is the fundamental method to perform a task for forecasting stock values. Here, we apply ARIMA model in the time series forecasting for future stock values. We collect datasets from yahoo finance source, it provides multiple numbers of stock datasets to any company. First, we choose a dataset with their symbols and select appropriate model to plot a graph. There are two categories of data models seasonal and non-seasonal. Type the symbol of a particular company to predict the historical stock prices with their forecasting stock values. In the graph, it shows predicted close prices within the time intervals. We conclude that this paper analysis and forecasts the historical stock prices to get the future stock values and it helps to the investors in decision-making. REFERENCES [1] Selene Yue Xu (UC Berkeley), Stock Price Forecasting Using Information from Yahoo Finance and Google Trend. [2] A. J. Bagnall and G. J. Janacek, Clustering Time Series from ARIMA Models with Clipped Data in KDD, W.Kim, R.Kohavi, J.Gehrke, and W. DuMouchel, Eds.ACM, 2004. [3] A Hybrid ARIMA Model and Support Vector Machines Model of Stock Price Forecasting in Omega, the International Journal of Management Science. Vol.33, no.3,2005. [4] Manna Majumder and MD Anwar Hussain, Forecasting of Indian Stock Market Index using Artificial Neural Network. [5] Vivek Rajput, Sarika Bodbe, Stock Market Forecasting Techniques:Literature Survey. Dr A. Haritha Dr PVS Lakshmi G. Lakshmi E. Revathi A. G S S Srinivas Deekshith 300