mergelabels: Merge Labels Based on Probability Adjacency Matrix

mergelabels-methodsR Documentation

Merge Labels Based on Probability Adjacency Matrix

Description

Returns the list with the normalised adjacency matrix L of size c \times c. The normalised adjacency matrix L = D^{-1/2} P D^{-1/2} depends on the probability adjacency matrix P(i,j) = \sum_{l = 1}^{n} p_{l} A_{l}(i,j), where p_{l} = w_{l} / \sum_{i = 1}^{c}\sum_{j = i + 1}^{c} A_{l}(i,j) and the degree matrix D(i,i) = \sum_{j = 1}^{c} P(i,j). The A_{l} matrices may contain some NA rows and columns, which are eliminated by the method. The list also contains the vector of integers cluster of length k, which indicates the cluster to which each label is assigned.

Usage

## S4 method for signature 'list'
mergelabels(A = list(), w = numeric(), k = 2, ...)
## ... and for other signatures

Arguments

A

a list of length n of adjacency matrices A_{l} of size c_{\mathrm{max}} \times c_{\mathrm{max}}, where c_{\mathrm{max}} \geq c.

w

vector of length n containing weights w_{l} summing to 1.

k

number of clusters k for kmeans. The default value is 2.

...

further arguments to kmeans.

Methods

signature(A = "list")

a list.

Author(s)

Marko Nagode, Branislav Panic

References

A. Ng, M. Jordan and Y. Weiss. On spectral clustering: Analysis and an algorithm. Advances in Neural Information Processing Systems 14 (NIPS 2001).

Examples

Zp <- array(0, dim = c(10, 10, 2))

Zp[ , ,1][10, 1:4] <- 1
Zp[ , ,1][1:4, 10] <- 2

Zp[ , ,2][9, 1:5] <- 3
Zp[ , ,2][1:6, 9] <- 4

labelmoments <- labelmoments(Zp, cmax = 4, Sigma = 1.0)

labelmoments

set.seed(3)

mergelabels <- mergelabels(list(labelmoments$A), w = 1.0, k = 2, nstart = 5)

Zp

mergelabels

rebmix documentation built on Feb. 9, 2024, 3:01 p.m.