Learn R Programming

latentnet (version 2.0)

latentnet: Latent position and cluster models for networks

Description

The package latentnet is used to fit latent cluster models, where the probability of a network $g$, on a set of nodes is a product of dyad probabilities, each of which is a GLM with linear component $\eta_{i,j}=\sum_{k=1}^p \beta_k X_{i,j,k}+||Z_i-Z_j||$, where $X$ is an array of dyad covariates, $\beta$ is a vector of covariate coefficients, and $Z_i$ is the latent space position of node $i$.

The ergmm specifies models via: g ~ where g is a network object For the list of possible , see terms.ergmm.

Arguments

Value

  • ergmm returns an object of class 'ergmm' that is a list.

Details

The arguments in the ergmm function specific to latent variable models are ergmm.control. See the help page for ergmm for the details.

The result of a latent variable model fit is an ergmm object. Hence the summary, print, and plot functions apply to the fits. The plot.ergmm function has many options specific to latent variable models. See the help page for plot.ergmm for the details.

References

Peter D. Hoff, Adrian E. Raftery and Mark S. Handcock. Latent space approaches to social network analysis. Journal of the American Statistical Association, Dec 2002, Vol. 97, Iss. 460; pg. 1090-1098.

Mark S. Handcock, Adrian E. Raftery and Jeremy Tantrum. Model-Based Clustering for Social Networks. Journal of the Royal Statistical Society: Series A (Statistics in Society), 2007, Vol. 170, Iss. 2; pg. 301-354.

Susan M. Shortreed, Mark S. Handcock, and Peter D. Hoff. Positional Estimation within the Latent Space Model for Networks. Methodology, 2006, Vol. 2, Iss. 1; pg. 24-33.

See Also

latent, latentcluster, sna, network, terms.ergmm

Examples

Run this code
#
# Using Sampson's Monk data, lets fit a 
# simple latent position model
#
data(sampson)
#
# Get the group labels
samp.labs <- substr(get.vertex.attribute(samplike,"group"),1,1)
#
samp.fit <- ergmm(samplike ~ latent(d=2), control=ergmm.control(burnin=10000,
                 samplesize=2000, interval=10))
#
# See if we have convergence in the MCMC
mcmc.diagnostics(samp.fit)
#
# Plot the fit
#
plot(samp.fit,label=samp.labs, vertex.col="group")
#
# Using Sampson's Monk data, lets fit a latent clustering model
samp.fit <- ergmm(samplike ~ latent(d=2, G=3), control=ergmm.control(burnin=10000, samplesize=2000, interval=10))
# See if we have convergence in the MCMC
mcmc.diagnostics(samp.fit)
#
# Lets look at the goodness of fit:
#
plot(samp.fit,label=samp.labs, vertex.col="group")
plot(samp.fit,pie=TRUE,label=samp.labs)
plot(samp.fit,density=c(2,2))
plot(samp.fit,contours=5,contour.color="red")
plot(samp.fit,density=TRUE,drawarrows=TRUE)
plot(samp.fit,density=TRUE,drawarrows=TRUE,only.subdens=TRUE)

Run the code above in your browser using DataLab