Проблема определения порядка ARIMA


16

Это длинный пост, поэтому я надеюсь, что вы можете терпеть меня, и, пожалуйста, поправьте меня, где я неправ.

Моя цель - составить ежедневный прогноз на основе исторических данных за 3 или 4 недели.

Данные представляют собой 15-минутные данные локальной нагрузки одной из трансформаторных линий. У меня проблемы с поиском модельного порядка сезонного процесса ARIMA. Рассмотрим временные ряды спроса на электроэнергию:

Оригинальный временной ряд http://i.share.pho.to/80d86574_l.png

Когда первые 3 недели берут за подмножество и дифференцируют, вычисляются следующие графики ACF / PACF:

Подмножество http://i.share.pho.to/5c165aef_l.png

Первое отличие http://i.share.pho.to/b7300cc2_l.png

Сезонное и первое различие http://i.share.pho.to/570c5397_l.png

Это похоже на то, что сериал довольно стационарный. Но сезонность также может быть еженедельной (см. Разницу между сезонной разницей в неделю и вторым порядком [здесь] http://share.pho.to/3owoq , что вы думаете?)

AряMA(п,1,Q)(п,1,Q)96

AряMA(0,1,4)(0,1,1)96
с

Series: x 
ARIMA(0,1,4)(0,1,1)[96] 

    Coefficients:
    ma1      ma2      ma3      ma4     sma1
    -0.2187  -0.2233  -0.0996  -0.0983  -0.9796
    s.e.   0.0231   0.0234   0.0257   0.0251   0.0804

    sigma^2 estimated as 364612:  log likelihood=-15138.91
    **AIC=30289.82   AICc=30289.87   BIC=30323.18**

Функция auto.arima вычисляет следующую модель (с пошаговой и аппроксимацией на TRUE, иначе для сходимости требуется много времени):

AряMA(1,1,1)(2,0,2)96
с

Series: x 
ARIMA(1,1,1)(2,0,2)[96] 

    Coefficients:
    ar1      ma1    sar1    sar2     sma1     sma2
    0.7607  -1.0010  0.4834  0.4979  -0.3369  -0.4168
    s.e.  0.0163   0.0001  0.0033  0.0116   0.0216   0.0255

    sigma^2 estimated as 406766:  log likelihood=-15872.02
    **AIC=31744.99   AICc=31745.05   BIC=31784.25**

Это означает, что не применяется сезонное различие. Вот остатки обеих моделей. Статистика Блока Юнга дает очень маленькое значение p, что указывает на наличие автокорреляции (поправьте меня, если я ошибаюсь).

прогнозирование

Таким образом, чтобы определить, что лучше, лучше провести тест на точность выборки. Таким образом, для обеих моделей прогноз составлен на 24 часа вперед и сравнивается между собой. Результаты: auto.arima http://i.share.pho.to/5d1dd934_l.png ручная модель http://i.share.pho.to/7ca69c97_l.png

Авто:

                      ME     RMSE      MAE       MPE      MAPE      MASE        ACF1 Theil's U
Training set   -2.586653 606.3188 439.1367 -1.284165  7.599403 0.4914563 -0.01219792        NA
Test set     -330.144797 896.6998 754.0080 -7.749675 13.268985 0.8438420  0.70219229  1.617834

Руководство

                       ME     RMSE      MAE        MPE      MAPE      MASE         ACF1 Theil's U
Training set 2.456596e-03 589.1267 435.6571 -0.7815229  7.509774 0.4875621 -0.002034122        NA
Test set     2.878919e+02 919.7398 696.0593  3.4756363 10.317420 0.7789892  0.731013599  1.281764

Вопросов

Как вы можете подумать, это анализ первых трех недель набора данных. Я борюсь в своем уме со следующими вопросами:

  1. Как выбрать лучшую модель ARIMA (попробовав все разные заказы и проверив лучшую MASE / MAPE / MSE? Где выбор измерения производительности может быть обсуждением сам по себе ...)
  2. Если я создаю новую модель и прогноз для каждого нового дневного прогноза (как в онлайн-прогнозировании), нужно ли мне учитывать годовой тренд и как? (как и в таком небольшом подмножестве, я думаю, что эта тенденция незначительна)
  3. Ожидаете ли вы, что порядок моделей останется неизменным во всем наборе данных, т. Е. При выборе другого подмножества, что даст мне ту же модель?
  4. Каков хороший способ в рамках этого метода справиться с праздниками? Или для этого нужен ARIMAX с внешними праздничными манекенами?
  5. Нужно ли использовать подход рядов Фурье, чтобы попробовать модели с, seasonality=672как обсуждалось в Длинные сезонные периоды ?
  6. Если так, то это будет как fit<-Arima(timeseries,order=c(0,1,4), xreg=fourier(1:n,4,672) (где функция Фурье такая, как определено в блоге Хиндмана)
  7. Включены ли начальные компоненты P и Q в ряд Фурье?

Большинство теоретических знаний, полученных из FPP , отличные вещи!

Перед тем, как дать совет по использованию экспоненциального сглаживания или (динамической) линейной регрессии, необходимо также сравнить его.

Данные

https://www.dropbox.com/sh/mzx61sskya5ze6x/Zq3A7Q6htH/trafo.txt

Код

data<-read.csv("file", sep=";")
load<-data[,3]

Я удалил несколько нулевых значений за неделю до значений

stepback<-672
load[is.na(load)] <- 0 # Assumed no 0's in first 672 values!
idx <- which(load == 0)
idx <- idx[which(idx>stepback)] 
load[idx] <- load[idx-stepback] 

ED<-ts(load,start=0, end=c(760,96),frequency=96)
x<-window(ED,start=0, end=c(20,96))

It is also possible to post a reproducible example but this will make the post even longer, but possible if needed. So if there is anything I should provide please let me know.

Ответы:


9
  1. How do I select the best ARIMA model (by trying all different orders and checking the best MASE/MAPE/MSE? where the selection of performance measurement can be a discussion in it's own..)

Out of sample risk estimates are the gold standard for performance evaluation, and therefore for model selection. Ideally, you cross-validate so that your risk estimates are averaged over more data. FPP explains one cross-validation method for time series. See Tashman for a review of other methods:

Tashman, L. J. (2000). Out-of-sample tests of forecasting accuracy: an analysis and review. International Journal of Forecasting, 16(4), 437–450. doi:10.1016/S0169-2070(00)00065-0

Of course, cross-validation is time consuming and so people often resort to using in-sample criteria to select a model, such as AIC, which is how auto.arima selects the best model. This approach is perfectly valid, if perhaps not as optimal.

  1. If I generate a new model and forecast for every new day forecast (as in online forecasting), do I need to take the yearly trend into account and how? (as in such a small subset my guess would be that the trend is neglible)

I'm not sure what you mean by yearly trend. Assuming you mean yearly seasonality, there's not really any way to take it into account with less than a year's worth of data.

  1. Would you expect that the model order stays the same throughout the dataset, i.e. when taking another subset will that give me the same model?

I would expect that barring some change to how the data are generated, the most correct underlying model will be the same throughout the dataset. However, that's not the same as saying that the model selected by any procedure (such as the procedure used by auto.arima) will be the same if that procedure is applied to different subsets of the data. This is because the variability due to sampling will result in variability in the results of the model selection procedure.

  1. What is a good way, within this method to cope with holidays? Or is ARIMAX with external holiday dummies needed for this?

External holiday dummies is the best approach.

  1. Do I need to use Fourier series approach to try models with seasonality=672 as discussed in Long seasonal periods?

You need to do something, because as mentioned in that article, the arima function in R does not support seasonal periods greater than 350. I've had reasonable success with the Fourier approach. Other options include forecasting after seasonal decomposition (also covered in FPP), and exponential smoothing models such as bats and tbats.

  1. If so would this be like fit<-Arima(timeseries,order=c(0,1,4), xreg=fourier(1:n,4,672) (where the function fourier is as defined in Hyndman's blog post)

That looks correct. You should experiment with different numbers of terms. Note that there is now a fourier function in the forecast package with a slightly different specification that I assume supersedes the one on Hyndman's blog. See the help file for syntax.

  1. Are initial P and Q components included with the fourier series?

I'm not sure what you're asking here. P and Q usually refer to the degrees of the AR and MA seasonal components. Using the fourier approach, there are no seasonal components and instead there are covariates for fourier terms related to season. It's no longer seasonal ARIMA, it's ARIMAX where the covariates approximate the season.

Используя наш сайт, вы подтверждаете, что прочитали и поняли нашу Политику в отношении файлов cookie и Политику конфиденциальности.
Licensed under cc by-sa 3.0 with attribution required.