Learn R Programming

latentnet (version 2.7.0)

summary.ergmm: ERGMM Fit Summaries

Description

summary.ergmm prodcues a summary of an ergmm object, including point estimates, standard errors, and BIC calculation.

Usage

## S3 method for class 'ergmm':
summary(object, point.est=c(
                                     if(!is.null(object[["mle"]])) "mle",
                                     if(!is.null(object[["sample"]])) c("pmean","mkl")
                                     ), quantiles=c(.025,.975),se="mle"%in%point.est,
                                     bic.eff.obs=c("ties", "dyads", "actors"),...)

bic.ergmm(object, eff.obs=c("ties", "dyads", "actors"), ...)

Arguments

object
An ergmm object to be summarized.
point.est
Point estimates to compute: a character vector with some subset of "mle", "pmean", "mkl", and "pmode". Defaults to a concatenation of "mle" (if fit), "pmean", and
quantiles
Posterior quantiles (credible intervals) to compute.
se
Whether to compute standard errors. Defaults to TRUE if MLE was fit.
eff.obs, bic.eff.obs
What effective sample size to use for BIC calculation? [object Object],[object Object],[object Object],[object Object],[object Object]
...
Additional arguments.

Value

  • For summary, an object of class summary.ergmm. A print method is available.

    The BICs are available as the element "bic" of the object returned. bic.ergmm returns the BIC for the model directly.

itemize

  • Using the BIC to select the number of clusters.

item

Using the BIC to select the fixed effects to be used.

Details

Note that BIC computed for the random effects models uses the same formualtion as Handcock et al., so it is likely correct, but has not been peer-reviewed.

This BIC can be (reasonably) safely used to select the number of clusters or which fixed effects to include in the model. It is not clear whether it is appropriate to use this BIC to select the dimension of latent space and whether or not to include random actor effects. These considerations are independent of the bug described below.

Prior to version 2.7.0, there was a bug in BIC calculation that used $p + n(d+r+s)$ as the sample size (where $p$ is the number of fixed effects, $n$ the number of actors, $d$, the latent space dimension, and $r$ and $s$ indicators of presence of sender and receiver (or sociality) effects). This value should have been just $p$.

The following applications could have produced different results:

  • Using the BIC to select latent space dimension.
Using the BIC to decide whether or not to include random effects.

References

Chris Fraley and Adrian E. Raftery (2002). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association, 97(458), 611-631.

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

See Also

ergmm.object, ergmm

Examples

Run this code
data(sampson)
# Fit the model for cluster sizes 1 through 4:
fits<-list(
           ergmm(samplike~euclidean(d=2,G=1)),
           ergmm(samplike~euclidean(d=2,G=2)),
           ergmm(samplike~euclidean(d=2,G=3)),
           ergmm(samplike~euclidean(d=2,G=4))
           )

\dontrun{
# Optionally, plot all fits.
lapply(fits,plot)
}

# Compute the BICs for the fits and plot them:
(bics<-reshape(
    as.data.frame(t(sapply(fits,
                           function(x)c(G=x$model$G,unlist(bic.ergmm(x))[c("Y","Z","overall")])))),
    list(c("Y","Z","overall")),idvar="G",v.names="BIC",timevar="Component",
    times=c("likelihood","clustering","overall"),direction="long"
    ))

with(bics,interaction.plot(G,Component,BIC,type="b",xlab="Clusters", ylab="BIC"))

# Summarize and plot whichever fit has the lowest overall BIC:
bestG<-with(bics[bics$Component=="overall",],G[which.min(BIC)])
summary(fits[[bestG]])
plot(fits[[bestG]])

Run the code above in your browser using DataLab