motif_hazard: Motifs of network hazard

motif_hazardR Documentation

Motifs of network hazard

Description

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

Usage

net_x_hazard(.data)

Arguments

.data

A network object of class mnet, igraph, tbl_graph, network, or similar. For more information on the standard coercion possible, see manynet::as_tidygraph().

Value

A network_motif named numeric vector or sometimes a data frame with one row and a column for each motif type, giving the count of each motif in the network. This is printed as a tibble to avoid greedy printing of long vectors.

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 diffusion: mark_diff, measure_diffusion_infection, measure_diffusion_net, measure_diffusion_node, member_diffusion, motif_exposure

Other motifs: motif_brokerage_net, motif_brokerage_node, motif_exposure, motif_hierarchy, motif_net, motif_node, motif_path, motif_periods

Examples

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

netrics documentation built on July 24, 2026, 5:07 p.m.