Learn R Programming

netdiffuseR (version 1.16.2)

exposure: Ego exposure

Description

Calculates exposure to adoption over time via multiple different types of weight matrices. The basic model is exposure to adoption by immediate neighbors (outdegree) at the time period prior to ego’s adoption. This exposure can also be based on (1) incoming ties, (2) structural equivalence, (3) indirect ties, (4) attribute weighted (5) network-metric weighted (e.g., central nodes have more influence), and attribute-weighted (e.g., based on homophily or tie strength).

Usage

exposure(graph, cumadopt, attrs = NULL, alt.graph = NULL, outgoing = TRUE,
  valued = getOption("diffnet.valued"), normalized = TRUE)

Arguments

graph
A dynamic graph (see netdiffuseR-graphs).
cumadopt
nxT matrix. Cumulative adoption matrix obtained from toa_mat
attrs
A numeric matrix of size $n\times T$. Weighting for each time, period (see details).
alt.graph
A dynamic graph that should be used instead of graph (see details).
outgoing
Logical scalar. When TRUE, computed using outgoing ties.
valued
Logical scalar. When FALSE, values of graph are set to one.
normalized
Logical scalar. When true, the exposure will be between zero and one (see details).

Value

  • A matrix of size $n\times T$ with exposure for each node.

Details

Exposure is calculated as follows:

$$E_t = \left(S_t \times \left[x_t \circ A_t\right]\right) / (S_t \times x_t)$$

Where $S_t$ is the graph in time $t$, $x_t$ is an attribute vector of size $n$ at time $t$, $A_t$ is the t-th column of the cumulative adopters matrix (a vector of length $n$ with $a_{ti}=1$ if $i$ has adopted at or prior to $t$), $\circ$ is the kronecker product (element-wise), and $\times$ is the matrix product.

By default the graph used for this calculation, $S$, is the social network. Alternatively, in the case of diffnet objects, the user can provide an alaternative graph using alt.graph. An example of this would be using $1/SE$, the element-wise inverse of the structural equivalence matrix (see example below).

If the user does not specifies a particular weighting attribute in attrs, the function sets this as a matrix of ones. Otherwise the function will return an attribute weighted exposure. See the examples section for a demonstration using degree.

When outgoing=FALSE, $S$ is replaced by its transposed, so in the case of a social network exposure will be computed based on the incomming ties.

References

Burt, R. S. (1987). "Social Contagion and Innovation: Cohesion versus Structural Equivalence". American Journal of Sociology, 92(6), 1287. http://doi.org/10.1086/228667

Valente, T. W. (1995). "Network models of the diffusion of innovations" (2nd ed.). Cresskill N.J.: Hampton Press.

See Also

Other statistics: cumulative_adopt_count, dgr, hazard_rate, infection, moran, struct_equiv, threshold

Examples

Run this code
# Calculating the exposure based on Structural Equivalence ------------------
set.seed(113132)
graph <- rdiffnet(100, 10)

SE <- lapply(struct_equiv(graph), "[[", "SE")
SE <- lapply(SE, function(x) 1/(x + 1e-15))
eSE <- exposure(graph, alt.graph=SE)
eNO <- exposure(graph)
any(eSE != eNO) # Different outputs

# Weighted Exposure using degree --------------------------------------------
eDE <- exposure(graph, attrs=dgr(graph))
any(eNO != eDE) # Different outputs

# Comparing using incomming edges -------------------------------------------
eIN <- exposure(graph, outgoing=FALSE)
any(eIN != eNO) # Different outputs

Run the code above in your browser using DataLab