Learn R Programming

latentnet (version 0.6-0)

latent: Latent position models for networks

Description

latent is a term to the function ergm which is used to fit a latent position model to a given network, $g$. ergm 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 ergm specifies models via: g ~ latent() where g is a network object For the list of possible , see below.

Usage

latent(k=2, z.delta=0.1, z.prior.mu=0,
        z.prior.sd=10, b.delta=0.5, b.prior.mu=0,
        b.prior.sd=10)

Arguments

k
Dimension of the latent space.
z.delta
Standard deviation of deviance in the proposal for the latent positions. If a constant is passed it is used for each dimension.
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.

Value

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

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.

See Also

latentcluster, plot.ergm, sna, network, terms.ergm

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 <- ergm(samplike ~ latent(k=2), burnin=10000,
                 MCMCsamplesize=2000, interval=30)
#
# See if we have convergence in the MCMC
mcmc.diagnostics(samp.fit)
#
# Plot the fit
#
plot(samp.fit,label=samp.labs, vertex.col="group")

Run the code above in your browser using DataLab