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

  • net_by_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_by_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_by_infection_peak() measures the number of time steps until the highest infection rate is observed.

net_by_infection_complete(.data)

net_by_infection_total(.data, normalized = TRUE)

net_by_infection_peak(.data)

Arguments

.data

Network data with nodal changes, as created by play_diffusion(), or a valid network diffusion model, as created by as_diffusion().

normalized

Logical scalar, whether scores are normalized. Different denominators may be used depending on the measure, whether the object is one-mode or two-mode, and other arguments. By default TRUE.

Value

A network_measure numeric score.

Examples

  smeg <- generate_smallworld(15, 0.025)
  smeg_diff <- play_diffusion(smeg)
  net_by_infection_complete(smeg_diff)
#> [1] 4
  net_by_infection_total(smeg_diff)
#> [1] 1
  net_by_infection_peak(smeg_diff)
#> [1] 3