Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

Share

PyData Amsterdam 2018 - time series analysis with seasonal data

Download to read offline

For time series analysis, everyone’s talking about ARIMA or Holt-Winters. But there’s other models which could also break down a seasonal series into trend, seasonality and noise. We will use an open source Python library called Seasonal to analyse B2B worldwide travel data.

PyData Amsterdam 2018 - time series analysis with seasonal data

  1. 1. Time Series Analysis with Seasonal Data Case study by Cheuk Ting Ho @cheukting_ho https://github.com/Cheukting @pydataamsterdam
  2. 2. Cheuk Tink Ho @cheukting_ho Data scientist at Contributor ofMember of Organizer of ● Base in London ● Love Python ● Love Comedy ● Love Beer & Cheese ● Love Travel
  3. 3. Time Series: - Sequential data: order matters - Upsample, Downsample: by day, by week, by month - Pandas Datatime index @pydataamsterdam @cheukting_ho
  4. 4. Seasonal Data: - Repeating pattern - Cycle could be week, month or day - Compare data at the same point in the cycle @pydataamsterdam @cheukting_ho
  5. 5. Example - AirPassenger Dataset The number of passengers shows a pattern of: - Trend - Seasonality - Noise Across time @cheukting_ho @pydataamsterdam
  6. 6. What can we do to combat seasonality in travel data?
  7. 7. Wholesale in Travel - Clients may be closed for business during public holidays - Sales are different weekday / weekend (seasonal) - Business worldwide - Estimate impact from public holiday worldwide @cheukting_ho @pydataamsterdam
  8. 8. Workflow: ➔ Break data in different countries, for each country: ➔ De-seasonal and de-trend the time series ➔ Find the residual that goes beyond the LCL (for holiday CY) / UCL (for holiday LY) ➔ Match holidays in the country form calendar to the residual ➔ Calculate impact (residual - LCL) @cheukting_ho @pydataamsterdam
  9. 9. Python library - seasonal - Linear trend fitting with periodic data can be hazardous - Apply a filter to knock down variations at the maximum expected period - Seasonal offsets (same as Holt-Winters) for a given periodicity are estimated as period-over-period averages using all the provided data - Estimating the period using a time-domain approach that accommodates any periodic signal shape - Drawback: computationally expensive (O(n^2)) https://github.com/welch/seasonal @pydataamsterdam @cheukting_ho
  10. 10. holiday?
  11. 11. Google Calendar API Allows us to scrap all holiday in all countries as a record, LY and CY holidays are compare on the same weekday. @pydataamsterdam @cheukting_ho
  12. 12. Christmas
  13. 13. Chinese New Year
  • IrfanGujjar786

    Jan. 16, 2020

For time series analysis, everyone’s talking about ARIMA or Holt-Winters. But there’s other models which could also break down a seasonal series into trend, seasonality and noise. We will use an open source Python library called Seasonal to analyse B2B worldwide travel data.

Views

Total views

453

On Slideshare

0

From embeds

0

Number of embeds

36

Actions

Downloads

6

Shares

0

Comments

0

Likes

1

×