I hope my question is not vague.

Suppose you are looking at the hourly sales of say Walmart/Dillons, with data given over a few months. It is clear that the data is a time series with frequency 24. Now, will it not be wise to add a different feature to the data describing the hour of the day and then treat the problem as a multivariate time series. Also, will it not be better to explain sales for morning hours with one model and the sale of the evening hours/rush hours with another model. After all the situation at those two instances changes quite drastically and feels like they should follow different rules.

I am relatively new to the time series analysis with knowledge about just the ARIMA models. Is there any model that includes the description of the 'seasons' into the modeling?


It is not uncommon to see several approaches to this sort of data.

Firstly, you can add fixed effects for each hour, but this can cause many problems in nonlinear estimations. As it turns out these asymptotic problems are not awful in zero inflated estimations, and my intuition suggests they should not be problematic in ARIMA, since there are only 24, not a "large" number. See my paper: "Can Safe Rides Reduce Urban Crime?", Regional Science And Urban Economics, Weber 2014, for information about hourly dummy indicators in application to data, as well as citations to other relevant work. http://www.sciencedirect.com/science/article/pii/S0166046214000416&ved=0CBwQFjAA&usg=AFQjCNHOEFA7fA5-XD4bkeyrO4oncwow4A&sig2=EJRqlBJiECzWpTkmu5tphQ

Alternatively, you can use a Fourier series to compensate for the daily, weekly, and monthly cycles, since you know the size of each. This is a nonparametric method and can be a good way to deseasonalize.

There are other approaches but these are the two I prefer.

  • 1
    $\begingroup$ I just briefly looked at your paper, and especially your model. I like the model you are using and really I wanted to do a similar thing as you did with your model. But slightly different too. I want to give different models for different hours of the day given the information already given at that time. So, when looking at Auto-correlation function I would also plot the function a bit differently. There would be 24 plots for each hour of the day. There are a lot of things that sales depends on and a few of those are heavily correlated with the hour of the day. $\endgroup$ – Nitin Aggarwal May 7 '15 at 4:08
  • $\begingroup$ I will finish reading the paper to see if I missed anything else you were trying to tell me. Also, can you please refer me to some case study which uses Fourier series for time series analysis? $\endgroup$ – Nitin Aggarwal May 7 '15 at 4:17
  • $\begingroup$ Why not try adding interaction terms as relevant? Showing 24 plots strikes me as difficult to interpret for a reader, it's a lot to hold in your head at once. I might run it as a robustness check though, but wouldn't want to include it in the primary paper. $\endgroup$ – RegressForward May 7 '15 at 4:21
  • $\begingroup$ What about adding interactions between a feature representing hour of the day and the sales from last few hours? I will give it some thought. Thanks for the suggestion! $\endgroup$ – Nitin Aggarwal May 7 '15 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.