eval.edgeperturbation | R Documentation |
Evaluates a given function on an input graph with and without a specified edge, returning the difference between the results in each case.
eval.edgeperturbation(dat, i, j, FUN, ...)
dat |
A single adjacency matrix |
i |
The row(s) of the edge(s) to be perturbed |
j |
The column(s) of the edge(s) to be perturbed |
FUN |
The function to be computed |
... |
Additional arguments to |
Although primarily a back-end utility for pstar
, eval.edgeperturbation
may be useful in any circumstance in which one wishes to assess the stability of a given structural index with respect to single edge perturbations. The function to be evaluated is calculated first on the input graph with all marked edges set to present, and then on the same graph with said edges absent. (Obviously, this is sensible only for dichotomous data.) The difference is then returned.
In pstar
, calls to eval.edgeperturbation
are used to construct a perturbation effect matrix for the GLM.
The difference in the values of FUN
as computed on the perturbed graphs.
length(i)
and length(j)
must be equal; where multiple edges are specified, the row and column listings are interpreted as pairs.
Carter T. Butts buttsc@uci.edu
Anderson, C.; Wasserman, S.; and Crouch, B. (1999). “A p* Primer: Logit Models for Social Networks. Social Networks, 21,37-66.
pstar
#Create a random graph
g<-rgraph(5)
#How much does a one-edge change affect reciprocity?
eval.edgeperturbation(g,1,2,grecip)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.