This package is now available through the CRAN R repository and can be installed using install.packages("VBLPCM") in R
A faster approximate alternative to using latentnet. Interfaces C code to fit a Variational Bayes approximation to the posterior for the Latent Position Cluster Model for networks.
This package is designed to be used as an alternative to the latentnet package when network size computationally prohibits latentnet. It uses a Variational Bayesian Expectation Maximisation algorithm to compute a closed-form approximation to the posterior that the ergmm function in latentnet samples from. It may be thought of as an intermediary approximation that is more accurate than the two-stage MLE fit provided by latentnet but a faster approximation to the MCMC sampler provided by latentnet. In fact, the VB iterations also converge quicker than the two-stage MLE.
Furthermore, VBLPCM takes advantage of the stratified sampler of Adrian Raftery, Xiaoyue Niu, Peter Hoff and Ka Yee Yeung. This approximation to the (log)likelihood allows for even larger networks to be analysed (see tech report).
This model fits facebook networks nicely. To fit the model to your network use these steps:
(You'll need to have libxml2-dev installed before you install igraph for it to handle graphml files.)
1. Download your facebook network using Bernie Hogan's app. Choose the GraphML option.
2. In R:
library(igraph) ### load the network using igraph g<-read.graph("path_to_downloaded_graphml_file",format="graphml") ### Convert to a network: net<-network(get.adjacency(g,sparse=FALSE),directed=FALSE) ### Add in the names network.vertex.names(net)<-igraph::get.vertex.attribute(g,"id") detach("package:igraph") ### Fit the model to the network, choosing G and d v.fit<-vblpcmfit(vblpcmstart(net,G=G,d=d)) ### Plot it plot(v.fit) ### Show the point estimates of the groups vblpcmgroups(v.fit)
VBLPCM_2.4.3.tar.gz (Unix / Linux)
to the paper "Review of Statistical Network Analysis: Models, Algorithms and Software" (Statistical Analysis and Data Mining, 2012).
The entire directory (input files and R scripts) is archived in supplement.zip