If two networks are of the same size, and their vertex attributes are equal in terms of set comparison, then we say those came from the same distribution

same_dist(net0, net1, attrnames = NULL, ...)

Arguments

net0, net1

Networks to be compared.

attrnames

Character vector. (optional) Names of the vertex attributes to be be compared on. This is ignored in the matrix case.

...

Ignored.

Value

A logical with an attribute what. TRUE meaning that the two networks come from the same distribution, and FALSE meaning that they do not. If FALSE the what attribute will be equal to either "size" or the name of the attribute that failed the comparison.

Details

This function is used during the call of ergmito_formulae to check whether the function can recycle previously computed statistics for the likelihood function. In the case of models that only contain structural terms, i.e. attribute less, this can save significant amount of computing time and memory.

Examples

data(fivenets) same_dist(fivenets[[1]], fivenets[[2]]) # Yes, same size
#> [1] TRUE #> attr(,"class") #> [1] "ergmito_same_dist"
same_dist(fivenets[[1]], fivenets[[2]], "female") # No, different attr dist
#> [1] FALSE #> attr(,"what") #> [1] "female" #> attr(,"class") #> [1] "ergmito_same_dist"