Learn R Programming

latentnet (version 2.0)

plot.ergmm: Plotting Method for class ERGMM

Description

plot.ergmm is the plotting method for ergmm objects. For latent models, this plots the minimum Kullback-Leibler positions by default. The maximum likelihood, posterior mean, posterior mode, or a particular iteration's or configuration's positions can be used instead, or pie charts of the posterior probabilities of cluster membership can be shown. See ergmm for more information on how to fit these models.

Usage

## S3 method for class 'ergmm':
plot(x, \dots, vertex.cex=1, vertex.sides=16*ceiling(sqrt(vertex.cex)),
                          what="mkl",
                          main = NULL, xlab=NULL, ylab=NULL, xlim=NULL,ylim=NULL,
                          object.scale=formals(plot.network.default)$object.scale,
                          pad=formals(plot.network.default)$pad,
                          cluster.col=c("red","green","blue","cyan","magenta","orange","yellow","purple"),
                          vertex.col=NULL, print.formula=TRUE,
                          edge.col=8,
                          pie = FALSE,
                          labels=FALSE,
                          plot.means=TRUE,plot.vars=TRUE,suppress.axes=FALSE,
                          jitter1D=1,curve1D=TRUE,suppress.center=FALSE,density.par=list())

Arguments

x
an R object of class ergmm. See documentation for ergmm.
what
Character vector, integer, or an object of class ergmm.par that specifies the point estimates to be used. Can be one of the follwoing: [object Object],[object Object],[object
pie
For latent clustering models, each node is drawn as a pie chart representing the probabilities of cluster membership.
plot.means
Whether cluster means are plotted for latent cluster models. The "+" character is used. Defaults to TRUE.
plot.vars
Whether circles with radius equal to the square root of posterior latent or intracluster variance estimates are plotted. Defaults to TRUE.
suppress.axes
Whether axes should not be drawn. Defaults to FALSE. (Axes are drawn.)
jitter1D
For 1D latent space fits, it often helps to jitter the positions for visualization. This option controls the amount of jitter.
curve1D
Controls whether the edges in 1D latent space fits are plotted as curves. Defaults to TRUE.
suppress.center
Suppresses the plotting of "+" at the origin. Defaults to FALSE.
cluster.col
A vector of colors used to distinguish clusters in a latent cluster model.
main,vertex.cex, vertex.col, xlim,ylim,vertex.sides,object.scale,pad, edge.col,xlab,ylab
Arguments passed to plot.network, whose defaults differ from those of plot.network.
labels
Whether vertex labels should be displayed. Defaults to FALSE.
print.formula
Whether the formula based on which the x was fitted should be printed under the main title. Defaults to TRUE.
density.par
A list of optional parameters for density plots: [object Object],[object Object],[object Object]
...
Other optional arguments passed to the plot.network function.

Value

  • NULL

Details

Plots the results of an ergmm fit. More information can be found by looking at the documentation of ergmm.

See Also

ergmm, network, plot.network, plot, ergmm.add.contours

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))
#
# 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))
#
# 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)

Run the code above in your browser using DataLab