logLik.ergm {ergm} | R Documentation |
A function to return the log-likelihood associated with an
ergm
fit, evaluating it if necessary.
## S3 method for class 'ergm' logLik(object, nsteps = 20, add = FALSE, force.reeval = FALSE, eval.loglik = add || force.reeval, ...)
object |
|
nsteps |
Number of bridges for bridge sampling estimation. |
add |
Instead of returning the log-likelihood, return |
eval.loglik |
Evaluate the log-likelihood if not set on |
force.reeval |
Whether to reestimate the log-likelihood even if |
... |
Other arguments to the bridge sampling functions. |
If the log-likelihood was not computed for object
,
produces an error unless eval.loglik=TRUE
If add=FALSE
(the default), a logLik
object. If
add=TRUE
(the default), an ergm
object with the log-likelihood set.
Hunter, D. R. and Handcock, M. S. (2006) Inference in curved exponential family models for networks, Journal of Computational and Graphical Statistics.
logLik
, ergm.bridge.llr
, ergm.bridge.dindstart.llk
# See help(ergm) for a description of this model: data(florentine) gest <- ergm(flomarriage ~ kstar(1:2) + absdiff("wealth") + triangle) # Log-likelihood is not evaluated, so no deviance, AIC, or BIC: summary(gest) # Evaluate the log-likelihood and attach it to the object. gest <- logLik(gest, add=TRUE) # Deviances, AIC, and BIC now shown: summary(gest)