summary.ergmm {latentnet}R Documentation

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("pmean", "mkl"),
                        quantiles = c(0.025, 0.975), se = FALSE, ...)

bic.ergmm(object)

Arguments

object

An ergmm object to be summarized.

point.est

Point estimates to compute: a character vector with some subset of the following: "mle", "pmean","mkl","pmode".

quantiles

Posterior quantiles (credible intervals) to compute.

se

Whether to compute standard errors.

...

Additional arguments. Currently unused.

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. Note that BIC computed for the random effects models may not be correct.

bic.ergmm returns the BIC for the model directly.

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.

See Also

ergmm.object, ergmm

Examples

data(sampson)
# Fit the model for cluster sizes 1 through 5:
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)),
           ergmm(samplike~euclidean(d=2,G=5))
           )

## Not run: 
sapply(fits,plot)

## End(Not run)

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


[Package latentnet version 2.4-1 Index]