motif_diffusion: Motifs of diffusion

motif_diffusionR Documentation

Motifs of diffusion

Description

  • net_by_hazard() measures the hazard rate or instantaneous probability that nodes will adopt/become infected at that time.

  • node_by_exposure() produces a motif matrix of nodes' exposure to infection/adoption by time step.

Usage

node_by_exposure(.data)

net_by_hazard(.data)

Arguments

.data

An object of a manynet-consistent class:

  • matrix (adjacency or incidence) from {base} R

  • edgelist, a data frame from {base} R or tibble from {tibble}

  • igraph, from the {igraph} package

  • network, from the {network} package

  • tbl_graph, from the {tidygraph} package

Hazard rate

The hazard rate is the instantaneous probability of adoption/infection at each time point (Allison 1984). In survival analysis, hazard rate is formally defined as:

% \lambda(t)=\lim_{h\to +0}\frac{F(t+h)-F(t)}{h}\frac{1}{1-F(t)} %

By approximating h=1, we can rewrite the equation as

% \lambda(t)=\frac{F(t+1)-F(t)}{1-F(t)} %

If we estimate F(t), the probability of not having adopted the innovation in time t, from the proportion of adopters in that time, such that F(t) \sim q_t/n, we now have (ultimately for t>1):

% \lambda(t)=\frac{q_{t+1}/n-q_t/n}{1-q_t/n} = \frac{q_{t+1} - q_t}{n - q_t} = \frac{q_t - q_{t-1}}{n - q_{t-1}} %

where q_i is the number of adopters in time t, and n is the number of vertices in the graph.

The shape of the hazard rate indicates the pattern of new adopters over time. Rapid diffusion with convex cumulative adoption curves will have hazard functions that peak early and decay over time. Slow concave cumulative adoption curves will have hazard functions that are low early and rise over time. Smooth hazard curves indicate constant adoption whereas those that oscillate indicate variability in adoption behavior over time.

Source

{netdiffuseR}

References

On hazard rates

Allison, Paul D. 1984. Event history analysis: Regression for longitudinal event data. London: Sage Publications. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.4135/9781412984195")}

Wooldridge, Jeffrey M. 2010. Econometric Analysis of Cross Section and Panel Data (2nd ed.). Cambridge: MIT Press.

See Also

Other motifs: motif_brokerage, motif_net, motif_node

Examples

node_by_exposure(play_diffusion(create_tree(12)))
# To calculate the hazard rates at each time point
  smeg <- generate_smallworld(15, 0.025)
net_by_hazard(play_diffusion(smeg, transmissibility = 0.3))

manynet documentation built on June 23, 2025, 9:07 a.m.