# Decomposition of daily time series (several years) with multiple seasonal patterns

i have a daily time series of several years. Graph & CSV-file

So far i could figure out with an based on an acf graph and this method:

timeSeriesObj = ts(x,start=c(1999,1,1),frequency=7)
fit <- tbats(timeSeriesObj)
seasonal <- !is.null(fit$seasonal) seasonal returns: TRUE timeSeriesObj = ts(x,start=c(1999,1,1),frequency=365.25) fit <- tbats(timeSeriesObj) seasonal <- !is.null(fit$seasonal)
seasonal

returns: TRUE

that i have a weekly as well as an annual seasonality.

How do i look for monthly seasonality? Is it a legit way to sum up all days of a month so i get 12 months a year and then check the acf graph again?

My final goal would be to estimate the different seasonal factors and remove them from the data in order to analyse the effects of different dates as for example easter or 4th of july.

• With daily data it makes a sense to try daily time series. You may apply multiplicative seasonality in ARIMA with lag 20 (business) or 30 (calendar) days. You can also add seasonal dummies. – Aksakal Jul 15 '15 at 13:51

## 1 Answer

As @Aksakal wisely pointed out daily data analysis can reveal a ton of information. Look at http://www.autobox.com/cms/index.php/afs-university/intro-to-forecasting/doc_download/53-capabilities-presentation particularly slides 42-55 for a demonstration of this. One can break out daily-effects, weekly effects , monthly effects , level shifts . local trends in order to reveal pre,contemporary and lag effects of known events. If you wish you can post your data and I can demonstrate this for you. Please use an excel format and indicate the country as holiday effects can be quite different and the start date. If you have any user-suggested causal series like price/promotion etc please add additional columns to your data matrix.

EDIT AFTER RECEIPT OF DATA:

I took the last 5 years of daily data (1/1/2004-12/31/2008) and used AUTOBOX in a totally automatic manner. The Actual/Fit and Forecast graph is here . The close-up / forecast for the next 31 days is and here . The plot of the model's residuals suggests sufficiency further supported by the acf of the model's residuals. . The equation is presented in the next 3 pix and and . In summary Christmas , Halloween , New Year's and Thanksgiving are suggested important holidays along with a long-weekend effect around a holiday. The data is seasonal with respect to monthly effects and there are 4 day's of the week that appear to be statistically significant [saturday (+) ,sunday (-),monday(-) and tuesday (-) ].In addition there is an identifiable level shift upwards at 11/03/06 and a reversal at 10/31/07. There are significant seasonal pulses (read changes in day-of-the-week-effects at specific points in time ) and a large amount of pulses ( one-time irregularities). Since I started with the US calendar of holidays these outliers may reflect omitted variables ( e.g. Ramadan etc. ) and should be possibly matched to other events. I have presented here a an example listing of these exceptional days which might help you match up with possible new variables that you can add to the model.

• Thx for your answer. I linked a .csv file in my original post, start date is 1.1.1999. The country is kind of an issue since the time series data is related to a supply chain that is influenced by more than one country. (E.g. the data could be influenced by holidays from the US as well as from India at the same time.) Since i have to analyse quite a few of those time series i am would like to develop some kind of method. My original idea was: 1. deseasonalize, 2. normalize, 3. search for outlier -> get a list of dates -> search for possible causes (holidays etc). Does that make sence? – RandomDude Jul 15 '15 at 15:26
• No because outliers , holidays , level shifts etc. will distort your attempt to de-seasonalize the data. One has to integrate daily effects , monthly effects and holiday (possibly multiple days) effects while incorporating and level shifts or local time trends OR particular days-of-the-month effects. – IrishStat Jul 15 '15 at 15:59
• So in order to de-seasonalize the data in the right way i need to know holidays that impact the time series in advance? – RandomDude Jul 15 '15 at 16:27
• if there are holiday effects it will effect the arithmetic of determining day-of-the-week effects. If there are monthly effects this will distort day-of-the-week effects. If there are level shifts or trends in the data this will distort day-of-the-week-effects.If there are particular days of the month like month-end effects or first-of-the month effects this will distort day-of-the-week effects. If there are pulses in your data this will distort day-of-the-week effects.If you omit or mis-report feb 29th effects in 2004 and 2008 (as you apparently did) this will distort day-of-the-week effects. – IrishStat Jul 15 '15 at 16:43
• unless you estimate them simultaneously .. – IrishStat Jul 15 '15 at 17:03