I have a time series (quarterly data) that I will use to predict the upcoming 4 quarters.The total number of observations is 20 quarters, thus, I need to predict quarter 21 -> 24. First I took the diff(data) to have a stationary data and I want to fit AR(1). I am using the following in R:
arima(diff(data), order=c(1,0,0)) and I obtained: ar1 (- 0.2441) and Intercept (1.2004)
Is the following correct?
∆y(t+1) = 1.2004 - 0.2441*∆y(t) ∆y(t+2) = 1.2004 - 0.2441*∆y(t+1)
If I want to predict y(t+1), do I find ∆y(t+1) and then
y(t+1) = y(t) + ∆y(t+1) y(t+2) = y(t) + ∆y(t+1)+ ∆y(t+2)
and so on... until y(t+4)
Is this analogy correct? Do you know how can I get the predicted value in R without doing it manually? How can I tell R that first I need to predict the delta and then the original value.