NCV.select: selecting block models by NCV

View source: R/RCode.R

NCV.selectR Documentation

selecting block models by NCV

Description

selecting block models by NCV of Chen and Lei (2016)

Usage

NCV.select(A, max.K, cv = 3)

Arguments

A

adjacency matrix

max.K

largest number of communities to check

cv

fold of cross-validation

Details

Spectral clustering is used for fitting the block models

Value

a list of

dev

the binomial deviance loss under SBM for each K

l2

the L_2 loss under SBM for each K

dc.dev

the binomial deviance loss under DCSBM for each K

dc.l2

the L_2 loss under DCSBM for each K

dev.model

the selected model by deviance loss

l2.model

the selected model by L_2 loss

sbm.l2.mat, sbm.dev.mat,....

the corresponding matrices of loss for each fold (row) and each K value (column)

Author(s)

Tianxi Li, Elizaveta Levina, Ji Zhu
Maintainer: Tianxi Li tianxili@virginia.edu

References

Chen, K. & Lei, J. Network cross-validation for determining the number of communities in network data Journal of the American Statistical Association, Taylor & Francis, 2018, 113, 241-251

See Also

ECV.block

Examples


dt <- BlockModel.Gen(30,300,K=3,beta=0.2,rho=0.9,simple=FALSE,power=TRUE)


A <- dt$A


ncv <- NCV.select(A,6,3)

ncv$l2.model
ncv$dev.model

which.min(ncv$dev)
which.min(ncv$l2)

which.min(ncv$dc.dev)
which.min(ncv$dc.l2)


randnet documentation built on May 31, 2023, 6:44 p.m.