Session Ready
Exercise

Compute correlations between time series

The correlation coefficient can be used to determine how multiple variables (or a group of time series) are associated with one another. The result is a correlation matrix that describes the correlation between time series. Note that the diagonal values in a correlation matrix will always be 1, since a time series will always be perfectly correlated with itself.

Correlation coefficients can be computed with the pearson, kendall and spearman methods. A full discussion of these different methods is outside the scope of this course, but the pearson method should be used when relationships between your variables are thought to be linear, while the kendall and spearman methods should be used when relationships between your variables are thought to be non-linear.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Print the correlation matrix between the beef and pork columns in the meat DataFrame using the Spearman method.
  • Based on the above matrix, print the correlation value between beef and pork columns.