# Daily forecasting

We have three years of data for online visits at a daily level. We want to forecast the daily visits for the next 90 days. What would be the best method to capture weekday seasonality , holiday seasons, and also the drift.

Can this be successfully done in R? We are currently using R. We have considered ARIMA but it does not capture seasonality.

While converting the data to a time series in R, what should be the "frequency"?

Should we use ARIMA with regressors?

• Ana, please post a sample of your data. You can capture seasonality using the S(easonal)ARMA (look at the astsa R package) or P(eriodic)ARMA (as covered in the partsm R package) class of models. Complex (multiresolution) seasonality can be captured using, for example, Hyndman's tsbats() function. Forecasting daily time series is not something that there is a lot of literature on, but I will try to post a short literature survey if time permits. May 9, 2014 at 8:49
• Try forecast library it has a feature to combine Loess decomposition (stl()) with its forecast() function. Try the follwing: install.packages("forecast");library(forecast);fit <- stl(USAccDeaths,s.window="periodic");plot(forecast(fit)) see also ?auto.arima May 9, 2014 at 9:20
• arima captures seasonality, and auto.arima. This question displays no research effort. May 9, 2014 at 9:24
• @fg nu I would love to see that review. May 9, 2014 at 11:47
• What makes you think that ARIMA doesn't capture seasonality? Seasonal ARIMA is explicitly designed to do just that. Jun 13, 2014 at 10:21

In addition to what has been said, you might want to consider structural time series models. They account explicitly for one or more seasonalities and trend, and are very tolerant of missing data. A good starting point might be the R function StructTS(). More complex models can be fit with packages such as dlm, KFAS, and several others.

Yes. You can use the ARIMAX Model.

ARIMAX stands for Auto regressive Moving average with External variable. For incorporating weekday seasonality and holiday seasons, you can create dummy variables with 1 and 0 values to fulfill each variables conditions.

In R, you can use the packages TSA and FORECAST. The model command is

arimax(x, order = c(0, 0, 0), seasonal = list(order = c(0, 0, 0), period = NA)))


Regarding your second question, While converting the data to a time series in R, what should be the "frequency"?Since you have daily data, your command to convert the data into a timeseries is

data.ts=ts(data\$date, start=c(start_year,start_date), frequency=365)