6

I'm trying to find some real examples showing someone going through the full process of building a time series model (how they deal with trends and seasonalities, what features they picked, etc). Does anyone know some good ones online? (these could be either in the form of a paper, or just some example online)

I've learned a little about time series analysis a couple years ago, but I want a refresher. I've skimmed through the time series books I have, but all of their examples are limited to the particular technique that the current chapter teaches -- none shows a full analysis, like someone might do in the real world.

Reason I ask: I have something like (say) a dataset of daily ice cream sales. I want to see some examples to refresh my mind on how I would:

  1. Build a predictive model of future ice cream sales.
  2. Measure the effect of temperature on ice cream sales. (let's say I have another dataset of daily temperature)
John
  • 61
  • 2
  • 1
    This might be of interest: [Seeking certain type of ARIMA explanation](http://stats.stackexchange.com/q/6498/7290). – gung - Reinstate Monica Aug 17 '15 at 23:07
  • 1
    Try this: https://a-little-book-of-r-for-time-series.readthedocs.org/en/latest/ . Also, there is a book by Cowpertwait and Metcalfe that does what you want. – Flounderer Aug 18 '15 at 04:38
  • If you think any of the responses below answer your question you might accept one, or let us know what still seems to be missing. – conjugateprior Sep 13 '15 at 14:51

3 Answers3

1

In terms of practical down-to-earth examples , I might suggest reviewing some of my 583 replies to time-series model building questions. It is the only subject that I know and feel competent to comment on and thus is the only area that I do so. @gung nicely pointed to one of them in his response. Most are real data case studies where the data is delivered by the OP and procedural issues are raised.

In terms of theory/overview I can recommend a presentation that I made 8 years ago to the International Society of Forecasters ( http://www.autobox.com/stack/dpr-isf27.ppt ) . In particular on slide 41 I presented an analysis of monthly ice cream sales from Norway. As shown it is a univariate (non-causal) model whereas when temperature is incorporated (not shown) the "seasonality" vanishes as temperature is the driver and then needs to be forecasted in order to forecast ice cream sales.

IrishStat
  • 27,906
  • 5
  • 29
  • 55
1

I'd expect most tutorials to start and end with descriptive time series analysis in an ARIMA framework, but it might also be interesting to look at tutorial treatments of structural time series analysis in a Bayesian framework with a focus on causal inference.

If that's your bag, my current go-to resources are the following, all of which conveniently treat the same policy impact question.

Books and papers

Commandeur and Koopman is a gentle introduction to the model building and checking this class of models. The original paper Durbin and Harvey, 1986 is also worth a read. For a causal inference focus, the paper Brodersen et al. 2015 is good too.

Data and code

Most of the materials above make some use of the Seatbelts data that comes with R. See also the packages CausalImpact (plus vignette), bsts (sadly without vignette), and the structTS function built into R.

conjugateprior
  • 19,431
  • 1
  • 55
  • 83
-1

MATLAB has a ton of end to end examples. Here's where one batch starts, just follow it to the end. It's part I, the last one is part X, but there are other related examples on multiplicative seasonality, de-trending, filters etc.

Aksakal
  • 55,939
  • 5
  • 90
  • 176