predict.ergmito | R Documentation |
ergmito
objectsTakes an ergmito object and makes prediction at tie level. See details for information regarding its implementation.
## S3 method for class 'ergmito'
predict(object, newdata = NULL, ...)
object |
An object of class ergmito. |
newdata |
New set of networks (or network) on which to make the prediction. |
... |
Passed to new_rergmito, the workhorse of this method. |
After fitting a model with a small network (or a set of them), we can use the parameter estimates to calculate the likelihood of observing any given tie in the network, this is, the marginal probabilites at the tie level.
In particular, the function takes the full set of networks on the support of the model and adds them up weighted by the probability of observing them as predicted by the ERGM, formally:
%
\hat{A} = \sum_i \mathbf{Pr}(A = a_i)\times a_i
Where \hat{A}
is the predicted adjacency matrix, and
a_i
is the i-th network in the support of the model. This calculation
is done for each individual network used in the model.
A list of adjacency matrix of length nnets(object)
or, if
specified nnets(newdata)
.
data(fivenets)
# bernoulli graph
fit <- ergmito(fivenets ~ edges)
# all ties have the same likelihood
# which is roughly equal to:
# mean(nedges(fivenets)/(nvertex(fivenets)*(nvertex(fivenets) - 1)))
predict(fit)
# If we take into account vertex attributes, now the story is different!
fit <- ergmito(fivenets ~ edges + nodematch("female"))
# Not all ties have the same likelihood, since it depends on homophily!
predict(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.