Learn R Programming

latentnet (version 2.11.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 ergmm
summary(
  object,
  point.est = c(if (!is.null(object[["mle"]])) "mle", if (!is.null(object[["sample"]]))
    c("pmean", "mkl")),
  quantiles = c(0.025, 0.975),
  se = "mle" %in% point.est,
  bic.eff.obs = c("ties", "dyads", "actors"),
  ...
)

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.

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 "mkl" (if MCMC was run).

quantiles

Posterior quantiles (credible intervals) to compute.

se

Whether to compute standard errors. Defaults to TRUE if MLE was fit.

...

Additional arguments.

eff.obs, bic.eff.obs

What effective sample size to use for BIC calculation?

"ties"

the number of non-missing ties in the network. This is the approach recommended by Handcock et al. (2007) and the default. Not well-defined for valued networks.

"dyads"

the number of non-missing dyads (potential ties) in the network.

"actors"

the number of actors in the network. The default prior to 2.7.0.

a number

to specify a specific sample size.

NULL

Don't compute the BIC at all. Mostly for internal use.

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 number of parameters in the likelihood (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.

The following applications could not (i.e., would be off by a constant):

  • Using the BIC to select the number of clusters.

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

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

# \donttest{
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))
           )

if (FALSE) {
# 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