# Stock closing price forecasting using ARIMA model in R

I have downloaded the daily stock Adjusted Close price of one stock from sep 2011 to till date. As per my study plan, I have plotted some basic plots to understand the daily stock Adjusted closing price.

Here is the xyplot of the stock closing price by date and the code used to plot(My x axis not visible).

Stock_T=stocks[which(symbol=='Stock_T'),]
xyplot(Adj.Close~Date,type='l',data=Stock_T,main='Adj.Close Price of the Stock_T')


By seeing this plot, the closing price was stable for period but had sudden huge increase in the stock price, it might had some other indicator which caused this much change in the stock price. Now my objective is to learn some ARIMA modeling concepts using this stock prices and try to do some forecasting of the stock price for few weeks.

As I have basic knowledge in ARIMA modeling, and I learned in the books that we should have stationary series before applying the ARIMA Model.

So, now I have plotted the ACF and PACF of the above raw data timeseries.

acf(Stock_T$Adj.Close)  pacf(Stock_T$Adj.Close)


From the above ACF and PACF plot, the series is not stationary and have huge autocorrelation (please correct me if am wrong), by differencing the series we will have stationary series (please correct me if am wrong). Here is the below plot.

Stock_T_d1=diff(Stock_T$Adj.Close)  Here the differencing series and its ACF AND PACF plots. ACF plot shows that there is no auto correlation and the series is stationary (please correct me if I am wrong) but I am unable to interpret the PACF plots, can someone explain it to me? The above difference series shows some unequal variance in the series and so I am taking log transformation before differencing and its ACF and PACF. Stock_T_logd1=diff(log(Stock_T$Adj.Close))


Now I will try to ask my questions.

1. Should we have stationary series before we apply ARIMA?
2. Could you please explain me the ACF and PACF of the original series, and what we should do if we have this kind of series?
3. Could you please explain me the ACF and PACF of the difference series, and what will be the next step?
4. Could you please explain me the ACF and PACF of the difference logged series, and what will be the next step?
5. Should we use difference series or difference logged series?
6. What will be the ARIMA orders of this series?
7. Is there any R code to find the ARIMA order automatically of the original series?
• do you know why there is huge Jump from level 200 to level 600 ? – forecaster Sep 22 '14 at 1:32
• In respect of Q 1. - to apply AR$\text{I}$MA you don't necessarily need stationarity, since the $\text{I}$ implies you have differencing already in your model. Without differencing -- ARMA -- series would normally need to be stationary. – Glen_b Sep 28 '14 at 23:37