| latentcluster {latentnet} | R Documentation |
latentcluster() is a term to the
function ergmm
to fit a latent position cluster model to a
given network, g.
ergmm returns a Bayesian model fit based on a Monte Carlo scheme.
The default prior specifications are diffuse. An approximate MLE fit is
also returned.
The ergmm specifies models via: y ~ latentcluster(<options>)
where y is a network object
For the list of possible <options>, see below.
For the list of other model terms, see
the manual pages for terms.ergmm.
latentcluster(k=2, ngroups, z.prior.mu=0, z.prior.sd=10, b.delta=0.5,
b.prior.mu=0, b.prior.sd=10,
Sigprior = qchisq(0.05,3),
muSigprior = 2, dirprior=3,
alphaprior=3,
chisqprop = 6, thetaprop=0.1, ...)
k |
Dimension of the latent space. |
ngroups |
Number of clusters in the latent space. |
z.prior.mu |
Prior mean for each dimension of the latent positions. If a constant is passed it is used for each dimension. |
z.prior.sd |
Prior standard deviation for each dimension of the latent positions. If a constant is passed it is used for each dimension. |
b.delta |
Standard deviation of the deviance for covariate parameters. If a constant is passed it is used for each dimension. |
b.prior.mu |
Prior mean for the covariate parameters. If a constant is passed it is used for each dimension. |
b.prior.sd |
Prior standard deviation for the covariate parameters. If a constant is passed it is used for each dimension. |
Sigprior |
Prior standard deviations for the node positions relative to the cluster mean. If a constant is passed it is used for each dimension. |
muSigprior |
Prior standard deviations for the node positions relative to the cluster mean. If a constant is passed it is used for each dimension. |
dirprior |
Prior standard deviations for the node positions relative to the cluster mean. If a constant is passed it is used for each dimension. |
alphaprior |
Prior standard deviations for the node positions relative to the cluster mean. If a constant is passed it is used for each dimension. |
chisqprop |
Prior standard deviations for the node positions relative to the cluster mean. If a constant is passed it is used for each dimension. |
thetaprop |
Prior standard deviations for the node positions relative to the cluster mean. If a constant is passed it is used for each dimension. |
... |
Specific to the model term. |
ergmm returns an object of class ergmm that
is a list.
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. Working Paper Number 46, Center for Statistics and the Social Sciences, University of Washington, April 2005.
latent, plot.ergmm, sna, network, terms.ergmm
## Not run:
#
# 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)
#
# Using Sampson's Monk data, lets fit a latent clustering model
#
samp.fit <- ergmm(samplike ~ latentcluster(k=2, ngroups=3), burnin=10000,
MCMCsamplesize=2000, interval=30)
#
# 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)
ergmm.add.contours(samp.fit,nlevels=8,lwd=2)
points(samp.fit$Z.mkl,pch=19,col=samp.fit$class)
## End(Not run)