Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to force seasonality from auto.arima

With the forecast package, I have a time series that I would like ?auto.arima to automatically pick the orders but I would like to coerce seasonality. The defaults for the function allow for the seasonal argument to be set to TRUE, but that only allows the option for seasonality not a coercion.

auto.arima(x, d=NA, D=NA, max.p=5, max.q=5,
     max.P=2, max.Q=2, max.order=5, max.d=2, max.D=1, 
     start.p=2, start.q=2, start.P=1, start.Q=1, 
     stationary=FALSE, seasonal=TRUE,
     ic=c("aicc", "aic", "bic"), stepwise=TRUE, trace=FALSE,
     approximation=(length(x)>100 | frequency(x)>12), xreg=NULL,
     test=c("kpss","adf","pp"), seasonal.test=c("ocsb","ch"),
     allowdrift=TRUE, allowmean=TRUE, lambda=NULL, biasadj=FALSE,
     parallel=FALSE, num.cores=2)
like image 968
Pierre L Avatar asked May 04 '16 19:05

Pierre L


People also ask

Does auto ARIMA account for seasonality?

r - Seasonality not taken account of in `auto. arima()` - Cross Validated. Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.

Does sarima capture seasonality?

It is better to go for SARIMA. It captures both trend and seasonality better. It captures trend with nonseasonal differencing and seasonality with seasonal differencing.

Can ARIMA handle multiple seasonality?

In order to deal with multiple seasonality, external regressors need to be added to the ARIMA model[1]. To incorporate the multiple seasonality in the gamer login behavior, additional Fourier terms are added to the ARIMA model, where Nt is an ARIMA process.


1 Answers

You can set the D parameter, which governs seasonal differencing, to a value greater than zero. (The default NA allows auto.arima() to use or not use seasonality.) For example:

> set.seed(1)
> foo <- ts(rnorm(60),frequency=12)
> auto.arima(foo)
Series: foo 
ARIMA(0,0,0) with zero mean     

sigma^2 estimated as 0.7307:  log likelihood=-75.72
AIC=153.45   AICc=153.52   BIC=155.54
> auto.arima(foo,D=1)
Series: foo 
ARIMA(0,0,0)(1,1,0)[12]                    

Coefficients:
         sar1
      -0.3902
s.e.   0.1478

sigma^2 estimated as 1.139:  log likelihood=-72.23
AIC=148.46   AICc=148.73   BIC=152.21
like image 165
Stephan Kolassa Avatar answered Nov 16 '22 01:11

Stephan Kolassa