I modeled a univariate time series in R using the Arima
command. One can obtain fitted values for the original series using this command by applying the function fitted
to the model. However, I noticed that the fitted data has the same dimension as the original data. Hence, a fitted value for the first value in the time series was computed even though there is no past data. I checked wheter it is the mean of the series or the intercept of the model but that isn't the solution. What are possible approaches to get a fitted value here?
The code below is a reproducible example using the Lynx
data set.
> library(xts)
> library(forecast)
>
> data("lynx")
>
> Y <- as.xts(log10(lynx))
> model <- Arima(Y, order= c(1, 0, 0)) #Fit AR(1) model
> fit <- fitted(model)
> length(fit) == length(Y)
[1] TRUE