Documentation
Cryptocurrencies tend to be highly correlated, which makes their correlations particularly relevant to visualize in a correlation matrix.
The correlation matrix visualizes the correlation between crypto markets (specifically their close price time series data) of a given quote over a given time horizon. Time series data in the following always refers to close price time series data.
The Pearson correlation coefficient is used to determine the correlation. It ranges from -1 to +1. A value of -1 indicates a perfect negative correlation, i.e. the two correlated markets move against each other. A value of +1 indicates a perfect positive correlation, i.e. the two correlated markets move together.
A value of +0.00 indicates that a positive value less than 0.005 has been rounded to two decimal places. A value of -0.00 indicates that a negative value greater than -0.005 has been rounded to two decimal places.
Only markets with at least 100 data points and non-zero variance are included in the analysis.
Correlation Matrix
Hovering over a matrix cell displays the rolling correlation in the chart below. Clicking on a matrix cell permanently selects it and allows interaction with its rolling correlation chart. To deselect a cell, click the selected cell again, double-click anywhere in the matrix, or use the Esc key.
When BTC is selected as the quote, the correlations are anchored relative to Bitcoin, allowing for a Bitcoin-centric group analysis.
The time horizon setting allows for multi-timeframe analysis (daily, weekly, monthly, yearly) to capture short- and long-term dynamics. Selecting longer time horizons will exclude more markets from the analysis, as recently listed markets don't have enough data points yet.
The detrend setting removes trends from the time series data.
Most crypto correlation matrices use USD markets by default and don't detrend the time series data. Note how the average correlation in the bottom status bar (visible on laptop screens and larger) is lower when BTC is selected as the quote and detrend is checked.
The market correlations can be sorted in ascending or descending order using hierarchical clustering, the average correlation of each market with all other markets, or the asset name.
While cryptocurrencies tend to be highly correlated, those pegged to currencies (stablecoins like USDT) or gold (PAXG) are largely independent, making these exceptions ideal for demonstrating the usefulness of hierarchical clustering for identifying groups.
To quickly navigate the matrix, keys 1, 2, 3, 4 can be used to move to the edges of the corresponding quadrants.
Rolling Correlation Chart
The chart visualizes the time series data of two markets in the selected quote and how the correlation between them changes over time. The rolling correlation is a channel consisting of three lines: The correlation coefficient in the middle and the upper bound of the confidence interval above and the lower bound of the confidence interval below. The correlation channel is always plotted on the y-axis from -1 to +1, even if its minimum and maximum values don't reach these values, to make it easier to compare market correlations. The time series data and correlation channels for all markets are plotted on the same time axis, even if both time series have missing leading data.
If a matrix cell is selected by click or touch, the rolling correlation chart can be interacted with.
When the chart is hovered, a legend appears in the upper left corner and a blue overlay rectangle appears where the cursor has horizontally intersected the chart — indicated by the vertical blue line to the right of the rectangle.
The legend provides information about the time of the intersection point, the close prices of the two correlated markets in the selected quote, and the rolling correlation over the selected window width and its upper and lower confidence interval (CI) bounds given by the selected CI level.
The blue overlay rectangle visualizes the window width of the rolling window that slides along the two time series to compute the rolling correlation. The available window width options depend on the selected time horizon. Higher window width values result in a wider overlay rectangle, a smoother correlation channel, and narrower confidence bands. Higher values are better for detecting long-term changes, while lower values are better for detecting short-term changes in the correlation.
The CI level controls the vertical expansion of the confidence interval band. Higher values result in a wider band. If the upper and lower bounds of the confidence interval are either both positive or negative, the rolling correlation is statistically significant at the CI level over the time range given by the window width. If one is positive and one is negative, the rolling correlation is not statistically significant at the CI level over the time range given by the window width. The confidence interval band is narrower for correlation coefficients closer to -1 and +1.
The chart always displays the non-detrended time series data, but the correlation channel is computed on the detrended time series data, if detrend is checked.
Leading gaps in the time series data can be caused by the market having being listed within the selected time horizon, instead of before.
Leading gaps in the correlation channel are caused by the width of the rolling window and detrending (one additional missing leading data point if detrend is checked). Intermediate gaps are caused by missing time series data or time series data with insufficient variance to compute the rolling correlation within the window width.
Close prices in the chart legend are given in the selected quote. For example, ETH in the chart legend will be ETH/USD if USD is selected. If BTC is selected, the values will have many leading zeros after the decimal point, because the price of Bitcoin is so high compared to other cryptocurrencies.
The time in the chart legend and on the x-axis is UTC or the local time of the device being used.
Status Bar
The status bar at the bottom (visible on laptop screens and larger) displays various information, including the average correlation (avg. corr) of all markets. The average correlation helps to contextualize the correlation coefficients in the matrix. Note how the correlated data points decrease slightly when detrend is checked, as detrending produces one missing leading data point per time series. It also decreases when BTC is selected as the quote versus USD, because BTC is excluded when it is used as the quote, as BTC/BTC is always 1.
The term pair-wise complete refers to pair-wise complete observations, which simply means that the two correlated time series both have an existing data point at a given point in time. If one or both would not have a data point at a given point in time, the observation would not be pair-wise complete. Trivially, only pair-wise complete observations can be correlated.
If you have any questions, feel free to reach out.