Skip to main content
100%

timeline - trend & seasonality

✓ Published0🌍 Public
KKcnarf
Last edited Dec 3, 2018
Created on Jan 12, 2016

An interactive D3.v3 timeline visualizes the impact of seasonality on a global trend. Users can drag individual data points, invert, or permute the seasonality to explore how internal seasonal trends affect the overall slope. The chart displays raw values, deseasonalized season means (large dots), and a least-squares trend line, all within an SVG with animation. Dragging points updates the trend in real time, demonstrating how a windowed-mean approach mitigates seasonal effects.

AI-generated description

An example of how seasonality impacts the trend.

Seasonality means that the time serie has a periodic component, repeating the same pattern on each period. For example, sales of a store may have a week-based seasonality: sales increase on saturday, while there is no sale at all on sunday.

In this example, the season has a length of 4: the first value is high, and the last one is low. Hence, each season has an internal negative trend, which lowers the global trend. A positive internal trend would increase the global trend.

The impact of the season's internal trend on the global trend is higher when :

  • the order of magnitude of the seasonilaty is high (ie. lowest and highest values are far from season's mean)
  • the season's length and the time serie's length are of the same order

In this example, we mitigate seasonality with a windowed approach: for each season, we retain the mean of the season (big dots). This produces a deseasonalized time serie. The deseasonalized global trend (light blue line) is then computed based on this deseasonalized time serie.

Seasonality can be mitigated by various approaches, such as simple linear regression, windowed mean (used in this example), moving mean, smoothing, ...

Usages :

  • Drag & Drop each point to see the impact on the trend line
  • inverse seasonality (in each season, the higher value becomes the lower, and vice versa) to inverse the season's internal trend, and hence inverse the impact on the global trend
  • permute seasonality (in each season, the n-th value becomes the (n-1)-th value and the first one becomes the last one) to lower/increase the season's internal trend (because extremum values are no longer at the begining and end of each season), and hence lower/increase the impact on the global trend

Notes:

  • trend line computed using least square method

Acknowledgments:

  • done with D3 v3.5.5
  • <a href='http://blockbuilder.org'>blockbuilder.org</a>
mit Licensed

Similar vizzes