Learn R Programming

dnc (version 1.2)

BIC.dnc: Compute BIC as in Handcock et al. 2007

Description

The following uses a BIC estimate of $\pi(Y,\hat{X}|M)$ to perform model selection. Note that this usage is not the typical BIC encountered in simpler contexts.

Usage

## S3 method for class 'dnc':
BIC(object, ...)

Arguments

object
A dnc object, a result of running dnc(...)
...
optional additional arguments. None are used.

Value

  • A scalar. Lower values are better.

Details

Rather than estimating the integrated likelihood $\pi(Y|G)$, this instead incorporates the MAP estimates of the latent positions and corresponds to $\pi(Y,\hat{X}|M)$. The BIC value returned is the following sum: $$-2 log(\pi(Y|\hat{X},\hat{\theta_1})) + dim(\theta_1)log(\sum y_{ijt}) -2 log(\pi(\hat{X}|\hat{\theta_2})) + dim(\theta_2) \log(nT)$$. See Sewell and Chen (2016) for more details.

References

Handcock, M. S., A.E. Raftery, and J. M. Tantrum (2007). Model-based clustering for social networks. J.R. Statist. Soc. A, 170, p. 301-354.

Examples

Run this code
dncObjs = list()
BICvals = numeric(9)
for(i in 2:10){
  print(i)
  dncObjs[[i]] <- dnc(friendship,M=i,p=3,method="VB",
                      controls=list(nDraws=500,burnin=100,
                                    MaxItStg2=50,epsilonStg2=1e-15))
  BICvals[i-1] <- BIC(dncObjs[[i]])
}
plot(BICvals~c(2:10),type="b",pch=16,
     xlab="Number of communities",ylab="BIC value")
( MBest = which.min(BICvals)+1 )
abline(v=MBest,lty=2,col="blue")

Run the code above in your browser using DataLab