Skip to content

R -HELP REQUEST

2 messages · Mahmoud Coker, Rolf Turner

#
If you just want point forecasts, it's simple:

Let your original series be X_t, t=1, ..., N.
Let Y_t = log(X_t).
Let Z_t = Y_t - Y_{t-1}, t = 2, ..., N.
Fit your model and forecast, obtaining Z-hat__1, ..., Z-hat_10.

Then Y-hat_{N+1} = Y_N + Z-hat_1, Y-hat_{N+2} = Y-hat_{N+1} + Z-hat_2,
....., Y-hat_{N+10} = Y-hat_{N+9} + Z-hat_10.

In R, let your forecast values be the vector "Zhat" (a vector of length 10).
Then do:

     Yhat <- cumsum(c(Y[N],Zhat))[-1]
     Xhat <- exp(Yhat)

Get error bounds on the forecasts is more problematic.

     cheers,

         Rolf Turner
On 02/05/2013 11:49 PM, Mahmoud Coker wrote: