laplacian: Laplacian matrix

Description Usage Arguments Value Author(s) References Examples

View source: R/laplacian.R

Description

Get the Laplacian matrix of an observed graph. Both unnormalised and symmetric normalised Laplacian matrices are included.

Usage

1
laplacian(A, normalised = F)

Arguments

A

input matrix – adjacency matrix of an observed graph, of dimension n-nodes x n-nodes.

normalised

whether the Laplacian matrix is normalised or not.

Value

if normalised = F, an unnormalised Laplacian matrix is returned, i.e. L = D - A; if normalised = T, a symmetric normalised Laplacian matrix is returned, i.e. L = D^{-1/2}(D - A)D^{-1/2}. D is the degree diagonal matrix, with diagonal entries d_i = ∑_{j = 1}^nA_{ij}.

Author(s)

Yang Feng, Richard J. Samworth and Yi Yu

References

Yang Feng, Richard J. Samworth and Yi Yu, Community Detection via Fused Principal Component Analysis, manuscript.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## to generate an adjacency matrix
A = matrix(c(0,1,1,1,0,0,1,0,0), byrow = TRUE, ncol = 3)

## have a look at A
A

## unnormalised Laplacian matrix
laplacian(A)

## normalised Laplacian matrix
laplacian(A, normalised = TRUE)

FusedPCA documentation built on May 29, 2017, 9:19 p.m.

Related to laplacian in FusedPCA...