VNviaCANsample: Semi-supervised Vertex Nomination using Canonical Sampling

Description Usage Arguments Value Examples

View source: R/VNviaCANsample.R

Description

Semi-supervised Vertex Nomination using Canonical Sampling

Usage

1
VNviaCANsample(n, m, Lam, A, observe, truth, numburn, numsample)

Arguments

n

Vector of number of unsupervised datapoints per block.

m

Vector of number of supervsised datapoints per block.

Lam

Interblock link probability matrix

A

Adjacency matrix (undirected, hollow)

observe

length sum(n+m) vector of known block identities. If -1, unknown. If >=1, that is the block identity.

truth

length sum(n+m) vector of true block identities.

numburn

Integer number of swaps to perform before sampling occurs.

numsample

Integer number of swaps to perform while sampling occurs.

Value

probs = probs,avgprec = avgprec,reveal = reveal

probs

Length sum(n) vector of estimated probability of block 1 membership, sorted in nomination order

avgprec

Average precision (at n(1)). Higher is better. 1 is the best.

reveal

boolean vector of length sum(n) of whether or not the i^th vector in the nomination order is from block 1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(ssClust)
numVert=500 #number of ambiguous vertices

#matching Li's simulation parameters
rho <- c(0.4,0.3,.3)
B1 <- matrix(c(0.5,0.3,.4,
               0.3,0.8,.6,
               .4,0.6, .3),  nrow = 3,ncol=3)
B2 <- matrix(.5 ,nrow = 3,ncol=3)
nu = .3
Lam0 = nu*B1 + (1-nu)*B2

n0 <- numVert*rho
m0<-c(20, 0, 0)
numburn0 = 10^4
numsample0 = 10^4

sbm.out = makeSBM(n0,m0,Lam0)
  A0 = as.matrix(sbm.out$A)
  observe0 = sbm.out$observe
  truth0 = sbm.out$truth


canSamp.out = VNviaCANsample(n=n0, m=m0, Lam=Lam0, A=A0, 
                               observe=observe0, 
                               truth=truth0, 
                               numburn=numburn0, 
                               numsample=numsample0)

Noobivsho/ssClust documentation built on Aug. 10, 2019, 5:47 a.m.