# Seasonally adjusted month-to-month growth with underlying weekly seasonality

As a side hobby, I have been exploring forecasting time series (in particular, using R).

For my data, I have the number of visits per day, for every day going back almost 4 years. In this data there are some distinct patterns:

1. Monday-Fri has a lot of visits (highest on Mon/Tue), but drastically less on Sat-Sun.
2. Certain times of the year drop (i.e. many less visits around U.S. Holidays, summers show less growth)
3. Significant growth year-to-year

It would be nice to be able to forecast an upcoming year with this data, and also use it to have seasonally adjusted month-to-month growth. The main thing that throws me off with a monthly view is:

• Certain months will have more Mon/Tue than other months (and that isn't consistent over years either). Therefore a month that happens to more weekdays needs to be adjusted accordingly.

Exploring weeks also seems difficult since the week numbering systems change from 52-53 depending on the year, and it seems ts doesn't handle that.

I'm pondering taking an average for the weekdays of the month, but the resulting unit is a bit strange (Growth in Avg. Weekday Visits) and that would be dropping data which is valid.

I feel this sort of data would be common in time series, (say for example electricity usage in office building might be something like this), anyone have any advice on how to model it, in particular, in R?

The data I am working with is pretty straight forward, it starts like:

            [,1]
2008-10-05 17607
2008-10-06 36368
2008-10-07 40250
2008-10-08 39631
2008-10-09 40870
2008-10-10 35706
2008-10-11 18245
2008-10-12 23528
2008-10-13 48077
2008-10-14 48500
2008-10-15 49017
2008-10-16 50733
2008-10-17 46909
2008-10-18 22467


and continues like this up to the present, with an overall trend of growth, some dips around US holiday weeks, and growth generally slowing during the summer.

• Another interesting aspect to the data is that there are sudden events that interrupt the overall trend of growth by a period of ~ couple months. Right now though, where I am at the stage of trying to properly set seasonality, I am ignoring that aspect. – Kyle Brandt Feb 21 '12 at 17:38
• Also, correct me if I am not using "seasonality" correctly. I am currently thinking of it a patter within the time unit I say. So "Weekly Seasonality" to me means "A pattern that repeats every week". – Kyle Brandt Feb 21 '12 at 17:40
• Hmm, sounds familiar (-; – user88 Feb 21 '12 at 18:16
• See answers to stats.stackexchange.com/questions/14742/…. Might be a starting point. – Peter Ellis Feb 21 '12 at 20:15
• Maybe at the heart of this is the combination of week + year? It seems ts (and even msts) doesn't fit a sampling period of a week with a "natural" period of a year (Nor do calendars really I guess). Or, I just don't understand how to make that work... – Kyle Brandt Feb 21 '12 at 20:45