Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mtergm

Estimate a TERGM by MCMC-MLE


Description

Estimate a TERGM by Markov Chain Monte Carlo Maximum Likelihood Estimation

Usage

mtergm(formula, constraints = ~., returndata = FALSE, verbose = TRUE, ...)

Arguments

formula

Formula for the TERGM. Model construction works like in the ergm package with the same model terms etc. (for a list of terms, see help("ergm-terms")). The networks to be modeled on the left-hand side of the equation must be given either as a list of network objects with more recent networks last (i.e., chronological order) or as a list of matrices with more recent matrices at the end. dyadcov and edgecov terms accept time-independent covariates (as network or matrix objects) or time-varying covariates (as a list of networks or matrices with the same length as the list of networks to be modeled).

constraints

Constraints of the ERGM. See ergm for details.

returndata

Return the processed input data instead of estimating and returning the model? In the btergm case, this will return a data frame with the dyads of the dependent variable/network and the change statistics for all covariates. In the mtergm case, this will return a list object with the blockdiagonal network object for the dependent variable and blockdiagonal matrices for all dyadic covariates and the offset matrix for the structural zeros.

verbose

Print details about data preprocessing and estimation settings.

...

Further arguments to be handed over to the ergm function.

Details

The mtergm function computes TERGMs by MCMC MLE (or MPLE with uncorrected standard errors) via blockdiagonal matrices and structural zeros. It acts as a wrapper for the ergm package. The btergm function is faster than the mtergm function but is only asymptotically unbiased the longer the time series. The mtergm function yields unbiased estimates and standard errors but may suffer from degeneracy if the model is not specified in good keeping with the true data-generating process.

Author(s)

Philip Leifeld, Skyler J. Cranmer, Bruce A. Desmarais

References

Leifeld, Philip, Skyler J. Cranmer and Bruce A. Desmarais (2017): Temporal Exponential Random Graph Models with btergm: Estimation and Bootstrap Confidence Intervals. Journal of Statistical Software 83(6): 1-36. doi: 10.18637/jss.v083.i06.

See Also

Examples

library("network")
set.seed(5)

networks <- list()
for (i in 1:10) {          # create 10 random networks with 10 actors
  mat <- matrix(rbinom(100, 1, .25), nrow = 10, ncol = 10)
  diag(mat) <- 0           # loops are excluded
  nw <- network(mat)       # create network object
  networks[[i]] <- nw      # add network to the list
}

covariates <- list()
for (i in 1:10) {          # create 10 matrices as covariate
  mat <- matrix(rnorm(100), nrow = 10, ncol = 10)
  covariates[[i]] <- mat   # add matrix to the list
}

## Not run: 
fit2 <- mtergm(networks ~ edges + istar(2) + edgecov(covariates))
summary(fit2)

## End(Not run)

# For examples with real data, see help("knecht") or help("alliances").

btergm

Temporal Exponential Random Graph Models by Bootstrapped Pseudolikelihood

v1.10.3
GPL (>= 2)
Authors
Philip Leifeld [aut, cre], Skyler J. Cranmer [ctb], Bruce A. Desmarais [ctb]
Initial release
2021-06-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.