Takes an ergmito object and makes prediction at tie level. See details for information regarding its implementation.

# S3 method for ergmito
predict(object, newdata = NULL, ...)

Arguments

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.

Value

A list of adjacency matrix of length nnets(object) or, if specified nnets(newdata).

Details

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.

Examples

data(fivenets) # bernoulli graph fit <- ergmito(fivenets ~ edges)
#> Warning: The observed statistics (target.statistics) are near or at the boundary of its support, i.e. the Maximum Likelihood Estimates maynot exist or be hard to be estimated. In particular, the statistic(s) "edges".
# all ties have the same likelihood # which is roughly equal to: # mean(nedges(fivenets)/(nvertex(fivenets)*(nvertex(fivenets) - 1))) predict(fit)
#> [[1]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.3333333 0.3333333 0.3333333 #> [2,] 0.3333333 0.0000000 0.3333333 0.3333333 #> [3,] 0.3333333 0.3333333 0.0000000 0.3333333 #> [4,] 0.3333333 0.3333333 0.3333333 0.0000000 #> #> [[2]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.3333333 0.3333333 0.3333333 #> [2,] 0.3333333 0.0000000 0.3333333 0.3333333 #> [3,] 0.3333333 0.3333333 0.0000000 0.3333333 #> [4,] 0.3333333 0.3333333 0.3333333 0.0000000 #> #> [[3]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.3333333 0.3333333 0.3333333 #> [2,] 0.3333333 0.0000000 0.3333333 0.3333333 #> [3,] 0.3333333 0.3333333 0.0000000 0.3333333 #> [4,] 0.3333333 0.3333333 0.3333333 0.0000000 #> #> [[4]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.3333333 0.3333333 0.3333333 #> [2,] 0.3333333 0.0000000 0.3333333 0.3333333 #> [3,] 0.3333333 0.3333333 0.0000000 0.3333333 #> [4,] 0.3333333 0.3333333 0.3333333 0.0000000 #> #> [[5]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.3333333 0.3333333 0.3333333 #> [2,] 0.3333333 0.0000000 0.3333333 0.3333333 #> [3,] 0.3333333 0.3333333 0.0000000 0.3333333 #> [4,] 0.3333333 0.3333333 0.3333333 0.0000000 #>
# If we take into account vertex attributes, now the story is different! fit <- ergmito(fivenets ~ edges + nodematch("female"))
#> Warning: The observed statistics (target.statistics) are near or at the boundary of its support, i.e. the Maximum Likelihood Estimates maynot exist or be hard to be estimated. In particular, the statistic(s) "edges", "nodematch.female".
# Not all ties have the same likelihood, since it depends on homophily! predict(fit)
#> [[1]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.4705883 0.1538462 0.4705883 #> [2,] 0.4705883 0.0000000 0.1538462 0.4705883 #> [3,] 0.1538462 0.1538462 0.0000000 0.1538462 #> [4,] 0.4705883 0.4705883 0.1538462 0.0000000 #> #> [[2]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.1538462 0.4705883 0.4705883 #> [2,] 0.1538462 0.0000000 0.1538462 0.1538462 #> [3,] 0.4705883 0.1538462 0.0000000 0.4705883 #> [4,] 0.4705883 0.1538462 0.4705883 0.0000000 #> #> [[3]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.1538462 0.4705883 0.1538462 #> [2,] 0.1538462 0.0000000 0.1538462 0.4705883 #> [3,] 0.4705883 0.1538462 0.0000000 0.1538462 #> [4,] 0.1538462 0.4705883 0.1538462 0.0000000 #> #> [[4]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.4705883 0.4705883 0.4705883 #> [2,] 0.4705883 0.0000000 0.4705883 0.4705883 #> [3,] 0.4705883 0.4705883 0.0000000 0.4705883 #> [4,] 0.4705883 0.4705883 0.4705883 0.0000000 #> #> [[5]] #> [,1] [,2] [,3] [,4] #> [1,] 0.0000000 0.4705883 0.1538462 0.4705883 #> [2,] 0.4705883 0.0000000 0.1538462 0.4705883 #> [3,] 0.1538462 0.1538462 0.0000000 0.1538462 #> [4,] 0.4705883 0.4705883 0.1538462 0.0000000 #>