These functions allow measurement of various features of a diffusion process at the network level:

  • net_infection_complete() measures the number of time steps until (the first instance of) complete infection. For diffusions that are not observed to complete, this function returns the value of Inf (infinity). This makes sure that at least ordinality is respected.

  • net_infection_total() measures the proportion or total number of nodes that are infected/activated at some time by the end of the diffusion process. This includes nodes that subsequently recover. Where reinfection is possible, the proportion may be higher than 1.

  • net_infection_peak() measures the number of time steps until the highest infection rate is observed.

net_infection_complete(diff_model)

net_infection_total(diff_model, normalized = TRUE)

net_infection_peak(diff_model)

Arguments

diff_model

A valid network diffusion model, as created by as_diffusion() or play_diffusion().

normalized

Logical scalar, whether the centrality scores are normalized. Different denominators are used depending on whether the object is one-mode or two-mode, the type of centrality, and other arguments.

Examples

  smeg <- generate_smallworld(15, 0.025)
  smeg_diff <- play_diffusion(smeg, recovery = 0.2)
  net_infection_complete(smeg_diff)
#> [1] Inf
  net_infection_total(smeg_diff)
#> [1] 1
  net_infection_peak(smeg_diff)
#> [1] 3