Skip to main content
100%

timeline - seasonality detection (III)

✓ Published0🌍 Public
KKcnarf
Last edited Dec 3, 2018
Created on Feb 23, 2016

This interactive D3 v3 visualization demonstrates why detrending a time series before computing a correlogram is essential for detecting seasonality. It shows a synthetic timeline with adjustable season length, seasonality magnitude, and overall trend, alongside a correlation bar chart for each lag. Users can toggle detrending; with the raw series, strong trends mask seasonal patterns, while detrended data reveals even small seasonal cycles clearly. The code uses D3’s linear scales, SVG rendering, drag behavior, and transition animations, with data generated inline and links to adjust parameters.

AI-generated description

<a href='http://bl.ocks.org/Kcnarf/5118ba2eb78edfcf645e'>This block</a> is a continuation of <a href='http://bl.ocks.org/Kcnarf/8c462789ffbb04351a11'>this previous block</a>. Both experiments how to detect if a timeline has a seasonality component, using a correlogram. This block explains why detrending the time serie before computing the correlogram is a must have.

Usages :

  • same usages as in <a href='http://bl.ocks.org/Kcnarf/8c462789ffbb04351a11'>this previous block</a>
  • in the correlogram, detrending the time serie before computing the correlogram allows to detect very small seasonnality order of magnitude; detrending the time serie implies that coefficients of correlation for each lag no longer reflect any trend, and thus only reflect the seasonality component;
  • while using detrended time serie, increasing/decreasing trend has no longer any impact on the correlogram; chery on the cake, seasons are easier to detect.

Notes:

  • the <a href='http://bl.ocks.org/Kcnarf/8c462789ffbb04351a11'>previous block</a> experiments season detection without detrending
  • another <a href='http://bl.ocks.org/Kcnarf/89e1e69c888e8241ed92'>block</a> experiments autocorrelation
  • another <a href='http://bl.ocks.org/Kcnarf/1e6da47724c39156adb3'>block</a> experiments time series correlation
  • another <a href='http://bl.ocks.org/Kcnarf/0a8fe1caa2ac025c8e86'>block</a> deals with the impact of seasonality when computing the trend of a timeline

Acknowledgments:

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

Similar vizzes