Function to obtain block diagonal structure through thresholding
block_diag.Rd
Given a correlation matrix \(R\), this function discovers the block-diagonal structure by thresholding the absolute values of the entries of the correlation matrix at \(c\). We create an adjacency matrix with the elements being 1 if and only if the corresponding member of the correlation matrix has an absolute value \(\ge c\). This is equivalent to performing a single linkage hierarchical clustering on the variables, with the distance matrix given by \(1 - |R|\) and cutting the tree at height \(1-c\).
Arguments
- R
a \(p \times p\) correlation matrix
- c
a threshold
- fig
a logical input; if
TRUE
, plotsR
, the adjacency matrix obtained by thresholdingR
, and the undirected graph corresponding to the adjacency matrix; default value isFALSE