ONE YEAR STOCK PRICE PREDICTION AND ITS VALIDITY USING LEAST SQUARE METHOD IN MATLAB.

Given time series data of 43 LQ45’s monthly stocks price during the period January 2013 to December 2013; this research interpolates the data into best polynomials as many the stocks, with each RMSE (root mean square error) representing degree of investment risk. The polynomial also is used to extrapolate (i

Given time series data of 43 LQ45's monthly stocks price during the period January 2013 to December 2013; this research interpolates the data into best polynomials as many the stocks, with each RMSE (root mean square error) representing degree of investment risk. The polynomial also is used to extrapolate (i.e. to predict) the next months stock price during the period January 2015 to January 2016; finally the prediction prices is compared with the 13 monthly actual prices and their RMSE (root mean square error) are computed. The computations are run in MATLAB (Matrix Laboratory) programming language implementing the curve fitting procedure based on least square method. The important results of computations are following: (1) degree of polynomials are in the range [28,97] of maximum 100, with average 73.7209, (2) relative RMSE of interpolation (RMSE-i) are in the range [0.2248%, 2.6804%] with average 0.6719%, (3) relative RMSE of extrapolation (RMSE-e) are in the range [2.1838%, 56.9015%] with average 11.5455%. The average of relative RMSE-e is small enough; it means that the risk for 13 months investment during the period January 2015 to January 2016 is small enough. The value of relative RMSE-e also explains why a stock is removed from or still in LQ45 index, and this is valid for 40 of 43 stocks.

Introduction:-
Trend of stock price changing, i.e. the time series of the price, is interesting information for investor in investing his or her money in the stock; the others information that should be considered is performance of the associated company which is shown by its financial report, cash flow, and equity changing (Brigham, 2004;Xiao, 2014;Jianfeng, 2014). The expected (or predicted) stock price at certain future time, which is a continuum of the trend, can be derived from the time series using some prediction technique such as interpolation (curve fitting) one; this predicted price has some uncertainty that represents the risk of investment in the stock.
In this paper, the time series data is monthly stock price one of LQ45 index, released by IDX (Indonesian Stock Exchange). IDX has about twenties indexes such as LQ45 Index, Kompas100 Index, Jakarta Islamic Index, and InfoBank15. Some of the indexes consist of blue chip stocks, i.e. the stocks with stable return, issued by well-known and well-established companies having small liability and high liquidity (Investopedia, 2016). The monthly time series data can be interpolated to get the best polynomial, i.e. the one of certain degree with minimal relative RMSE ISSN: 2320-5407 Int. J. Adv. Res. 5(2), 1641-1648 1642 (root mean square error); this relative RMSE represents the risk of investment in the stock. The polynomial actually is an extrapolator to get the prediction price of the stock, together with its relative RMSE, at certain future months.
The objective of the research is to investigate validity of one year stock price prediction, especially of 43 blue chip stocks which are member of LQ45 index defined in period of February 2015 -July 2015 1) , here validity means degree of accordance of the prediction values and the actual ones, also to investigate why a stock is removed from or still in LQ45 index. The monthly data are the prices during the period January 2013 to December 2014. This historical data is interpolated to get the best polynomial for each stock; the chosen polynomial is the best one, i.e. the polynomial with certain degree over interval [1,100] having minimal relative interpolation-RMSE (RMSE-i). Each chosen polynomial is then used to extrapolate the stock price during the period January 2015 to January 2016; the resulted stock price is then compared with its actual data and the relative extrapolation-RMSE (RMSE-e) is determined; the relative RMSE-e shows the validity of prediction which in turn gives guidance for investor to keep track of his or her investment in the stock. Least Square Method:-Given m pairs data (x i , y i ); least square method constructs polynomial of degree n, i.e. p n (x) = a 0 + a 1 x + a 2 x 2 + ... + a n x n , i.e. to get the coefficients a 0 , a 1 , a 2 , ..., a n , with following "least square procedure": ..,  i x i n y i 3. construct the following linear system: 1643 4. solve the linear system for A = [a 0 , a 1 , a 2 , ..., a n ] T , where X T is transpose matrix of X.
In MATLAB environment the 3-rd and 4-th steps are executed in two following instructions: In this research the input is matrix M of size 24  43 where the cell of i-th row and j-th column holds the prices of ith month of j-th stock; the matrix is shown by Table 1.     1648 Figure 1 until 7 shows seven selected stocks with variation of degree of the best polynomial, value of relative RMSE-i, and value of relative RMSE-i, represent all of 43 stocks. Figure 1, Figure 2, Figure 5, Figure 6, and Figure  7 show the stocks of which their relative RMSE-i determine their membership in LQ45 while Figure 3 and Figure 4 has anomaly in the sense of value of relative RMSE-i.
Conclusion:-1. The average of relative RMSE-e of all 43 stocks is small enough; it indicates that investment in the stocks for 13 months on average is save enough. 2. With the average of relative RMSE-e which is 11.5455%, 40 of 43 stocks can be explained why a stock is removed from LQ45 or still save in it, i.e. because the RMSE-much larger than the average or about the average, respectively.