I am a newbie when it comes to R and I do not have a strong math background. That being said, my goal is to automate forecasting time series. I went to Google and found several good articles about forecasting by hand.
The information in my time series is collected every 15 minutes. Therefore, I made my time series in R look like the following:
library(tseries)
input <- c(59.1,47.3,51.9,61.8, 63.6, 76.7,78.1,80.1)
ts <- ts(input, frequency=15)
From there I performed the Dickey-Fuller test by running the following code:
testResults <- adf.test(ts)
testResults
RESULTS
Dickey-Fuller = -2.3504
Lag order = 1
p-value = 0.4389
alternative hypothesis: stationary
Question1: I have read several other posts and I believe that I need to look at the p-value to determine if my time series is stationary or not. Is that correct? If so, is there a certain value that would apply to all time series or does it vary from one to another? Another words, if the p-value is 0.05 or higher, then we need to remove trending and/or seasonality. What is that value?
Question2: Is it acceptable to run ndiffs
on my time series instead of running the Dickey-Fuller test?
Question3 Once the differencing is completed, is there a need to perform stl()
or decompose()
?
After this part, I believe that it is time to start to fit the model. However, I see some folks running acf
and pacf
.
Question4 I see that these methods are used for checking residuals outside the insignificant zone. Does this mean if I do not have more than 1 plot outside the insignificant zone, that I can not predict future values? Are any of the values calculated here used in future calculations of the model?
Question5 If I use the auto.arima
method for fitting a model to my data, can I just get away with removing trending and seasonality?
Thank you in advance.
frequency=15
means that your data may have a seasonal cycle every 15 data points, i.e., with a period of 15*15 = 225 minutes, or 3 hours and 45 minutes. That is almost certainly not what you want. If you suspect an hourly cycle, usefrequency=4
. If you suspect a daily cycle, usefrequency=96
. If you suspect multiple-seasonalities, look at that tag and consider a tbats model. $\endgroup$frequency
as per my previous comment, thenauto.arima()
should already take care of all trends and seasonalities automagically. Try it. $\endgroup$