timeline - correlation
This example demonstrates how to assess the correlation between two time series. It shows a line chart for each series and a scatter plot of one series against the other, where the alignment of points indicates the strength of correlation. A dynamic coefficient of correlation is displayed, computed using the least squares method. Users can interactively drag data points, adjust trends, and modify dispersion to see their impact, with d3.svg transitions animating the changes.
AI-generated descriptionAn example of how to decide if 2 time series are correlated or not.
Graphically speaking, one can estimate the correlation of 2 time series by using a scatter plot of those 2 time series (right top graph): the more the points are aligned in a straight line, the more the time series are correlated.
Computationnaly speaking, the coefficient of correlation gives an insight of the dispersion of those points: the more the coefficient of correlation is near 1 (or -1), the more the scatter points are aligned, and the more the 2 time series are correlated.
Usages :
- in the left graph, Drag & Drop a point to see the impact on the coefficient of correlation
- in the left graph, Drag & Drop a timeline (to change each values of the related time serie), and see that it has no impact on the coefficient of correlation;
- in the left graph, correlate or decorrelate time serie 2 and time serie 1 by introducing some random values; then see the impact on the coefficient of correlation;
- in the left graph, increase or decrease the trend of the second time serie, and see that it has no impact on the coefficient of correlation;
- in the left graph, inverse a trend, and see that it inverses the coefficient of correlation; when the 2 trends increases/decreases in the same way, the coefficient of correlation is positive; at the opposite, when one trend is increasing and the other is decreasing, the coefficient of correlation is negative;
- in the left graph, disperse/concentrate the second time serie, and see that the more disperse is the second timeserie, the less it correlates with the first time serie;
Notes:
- trend line computed using least square method
Acknowledgments:
- done with D3 v3.5.5
- <a href='http://blockbuilder.org'>blockbuilder.org</a>