CASpecClust: Covariate-assisted Spectral Clustering

Description Usage Arguments Details Value Examples

Description

CASpecClust returns the covariate-assisted spectral clustering assignments. This is a function that implements the methods described in Binkiewicz et.al. (2016). CASpecClust takes the adjacency matrix A, covariate matrix X, calculates a similarity matrix and peforms spectral clustering.

Usage

1
2
CASpecClust(A, X = NULL, K = 2, n.alpha = 100, center = FALSE,
  method = 3, randStarts = 20)

Arguments

A

an adjacency matrix of the nodes, n by n

X

covariate matrix, n by p. Categorical variables should be re-expressed with dummy variables using one-hot encoding, see vignettes for example.

K

number of clusters

n.alpha

number of alpha values in the valid range to search. Defaults to 100

center

whether to center the covariates X. Defaults to FALSE

method

clustering method. See details

randStarts

number of random starts in K-means. Defaults to 20

Details

The adjacency matrix and covariate matrices are first converted into sparse format to calculate the graph laplacian:

L_τ = D^{−1/2}_τ A D^{−1/2}_τ

spectral clusterging is performed on a n-by-n "similarity matrix", which is defined according to method used:

  1. regularized spectral clustering:

    L_τ

  2. assortative covariate-assisted spectral clustering:

    L_τ + α XX^t

  3. covariate-assisted spectral clustering:

    L_τ L_τ + α XX^t

The nodes are clustered into K clusters.

Value

A list of three elememts:

  1. alpha: values of tuning parameter in the valid range

  2. WCSS: within-cluster sum of squares corresponding to the alpha values

  3. cluster: the optimal clustering assignments

Examples

1

Pill-GZ/CASC documentation built on May 8, 2019, 2:48 p.m.