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
).
threshold( obj, toa, t0 = min(toa, na.rm = TRUE), include_censored = FALSE, lags = 0L, ... )
obj | Either a \(n\times T\) matrix (eposure to the innovation obtained from
|
---|---|
toa | Integer vector. Indicating the time of adoption of the innovation. |
t0 | Integer scalar. See |
include_censored | Logical scalar. When |
lags | Integer scalar. Number of lags to consider when computing thresholds. |
... | Further arguments to be passed to |
A vector of size \(n\) indicating the threshold for each node.
By default exposure is not computed for vertices adopting at the
first time period, include_censored=FALSE
, as estimating threshold for
left censored data may yield biased outcomes.
Threshold can be visualized using plot_threshold
Other statistics:
bass
,
classify_adopters()
,
cumulative_adopt_count()
,
dgr()
,
ego_variance()
,
exposure()
,
hazard_rate()
,
infection()
,
moran()
,
struct_equiv()
,
vertex_covariate_dist()
# 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)#> Warning: no non-missing arguments to max; returning -Inf#> Warning: no non-missing arguments to max; returning -Inf#> Warning: no non-missing arguments to max; returning -Infse <- lapply(se, function(x) methods::as((x$SE)^(-1), "dgCMatrix")) expo <- exposure(graph, adopt$cumadopt, alt.graph=se)#> Warning: The -alt.graph- will be treated as 0/1 graph (value=FALSE).# Retrieving threshold threshold(expo, toa)#> threshold #> 1 1.0 #> 2 0.4 #> 3 0.8 #> 4 0.2 #> 5 0.8# We can do the same by creating a diffnet object diffnet <- as_diffnet(graph, toa) threshold(diffnet, alt.graph=se)#> Warning: The -alt.graph- will be treated as 0/1 graph (value=FALSE).#> threshold #> 1 1.0 #> 2 0.4 #> 3 0.8 #> 4 0.2 #> 5 0.8