single.mod: Modularity based on DCBM and SBM assumptions

Description Usage Arguments Value Author(s) References Examples

View source: R/single.mod.R

Description

Get the modularity values based on DCBM and SBM assumptions for a single community detection estimator.

Usage

1
single.mod(A, clusters, K = 2)

Arguments

A

input matrix – adjacency matrix of an observed graph based on the non-isolated nodes, of dimension n.noniso x n.noniso, where n.noniso is the number of the non-isolated nodes.

clusters

input vector – the estimator of the community labels of the non-isolated nodes in the network, of dimension n.noniso, values taken from 1 to K, where K is the number of communities.

K

the number of the communities, with 2 as the default value.

Value

mod.dcbm

the modularity value based on the DCBM assumption.

mod.sbm

the modularity value based on the SBM assumption.

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
## 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

## ratio and normalised cut values 
## given the community labels 1, 1 and 2 to nodes 1, 2 and 3
single.mod(A, c(1,1,2))

Example output

Loading required package: genlasso
Loading required package: MASS
Loading required package: Matrix
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

     [,1] [,2] [,3]
[1,]    0    1    1
[2,]    1    0    0
[3,]    1    0    0
$mod.dcbm
[1] -5.205542

$mod.sbm
[1] -2.772745

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