Learn R Programming

netdiffuseR (version 1.16.2)

threshold: Retrive threshold levels from the exposure matrix

Description

Thresholds are each vertexes exposure at the time of adoption. Substantively it is the proportion of adopters required for each ego to adopt. (see exposure).

Usage

threshold(obj, times, t0 = min(times, na.rm = TRUE), ...)

Arguments

obj
Either a $n\times T$ matrix (eposure to the innovation obtained from exposure) or a diffnet object.
times
Integer vector. Indicating the time of adoption of the innovation.
t0
Integer scalar. See toa_mat.
...
Further arguments to be passed to exposure.

Value

  • A vector of size $n$ indicating the threshold for each node.

See Also

Threshold can be visualized using plot_threshold

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

Examples

Run this code
# Generating a random graph with random Times of Adoption
set.seed(783)
toa <- sample.int(4, 5, TRUE)
graph <- rgraph_er(n=5, t=max(toa) - min(toa) + 1)

# Computing exposure using Structural Equivalnece
adopt <- toa_mat(toa)
se <- struct_equiv(graph)
se <- lapply(se, function(x) methods::as((x$SE)^(-1), "dgCMatrix"))
expo <- exposure(graph, adopt$cumadopt, alt.graph=se)

# Retrieving threshold
threshold(expo, toa)

# We can do the same by creating a diffnet object
diffnet <- as_diffnet(graph, toa)
threshold(diffnet, alt.graph=se)

Run the code above in your browser using DataLab