У меня есть модель ARIMA (2,0,0) с параметрами ar1=0.999095139
и ar2=-0.003696142
.
Я использую forecast::Arima
в R. В этом случае мне интересно, как 1-е и 2-е значения должны быть вычислены в функции ARIMAfit2$fitted
на тестовом наборе (вне образцапошаговый прогноз)?
# Training data
train = c(0.8393574,0.8313253,0.8232932,0.9959839,0.9879518,0.9799197,0.9558233,0.8273092,0.8313253,0.8232932)
# Test data
test=c(1,1,1,1,1,1,1,1,1,1,1)
# Estimating in training data
ARIMAfit = Arima(train, order = c(2,0,0), method = 'CSS',include.mean = FALSE)
# Re-estimating in test data
ARIMAfit2 = Arima(test, model = ARIMAfit)
# Model parameters
ARIMA(2,0,0) with zero mean
ar1=0.999095139
ar2=-0.003696142
# Fitted values one-step forecast, 1st to 11th. How the 1st and 2nd values are calculated?
ARIMAfit2$fitted
0.9043602 0.9954160 0.995399 0.995399 0.995399 0.995399 0.995399 0.995399 0.995399 0.995399 0.995399
# One step by hand, 3rd to 11th
oneStepByHand = 0.999095139*test[1:9] - 0.003696142*test[2:10]
0.995399 0.995399 0.995399 0.995399 0.995399 0.995399 0.995399 0.995399 0.995399