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

  • net_by_transmissibility() measures the average transmissibility observed in a diffusion simulation, or the number of new infections over the number of susceptible nodes.

  • net_by_recovery() measures the average number of time steps nodes remain infected once they become infected.

  • net_by_reproduction() estimates the basic reproduction number from the chances of infection and recovery in a diffusion, and from the structure of the network.

  • net_by_immunity() measures the proportion of nodes that would need to be protected through vaccination, isolation, or recovery for herd immunity to be reached.

  • net_by_tipping() measures the smallest share of the nodes that, as seeds, make a threshold contagion reach every node.

net_by_transmissibility(.data, attribute = "diffusion")

net_by_recovery(.data, censor = TRUE, attribute = "diffusion")

net_by_reproduction(.data, attribute = "diffusion")

net_by_immunity(.data, normalized = TRUE, attribute = "diffusion")

net_by_tipping(
  .data,
  threshold = 2,
  normalized = TRUE,
  rule = c("degree", "order", "random")
)

Arguments

.data

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

attribute

Name of the nodal attribute that holds the diffusion, as its start state on the nodes and as its changes. By default "diffusion", as in play_diffusion().

censor

Where some nodes have not yet recovered by the end of the simulation, right censored values can be replaced by the number of steps. By default TRUE. Note that this will likely still underestimate recovery.

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.

threshold

For net_by_tipping(), the number of contacts that must adopt before a node adopts, or, below 1, the share of its contacts. It can be one number, a number for each node, or the name of a numeric node attribute, as in play_diffusion(). By default 2.

rule

For net_by_tipping(), the order in which nodes become seeds: "degree" (the default) takes the nodes with the most contacts first, "order" takes them in the order of the nodes, and "random" takes them in a random order. Nodes with the same degree are taken in the order of the nodes.

Value

A network_measure numeric score.

The object also carries the measure it computed, the range its values can fall within, and whether and how those values were normalized. These are shown as a one-line header when the object is printed. Where a measure offers a choice between several ways of counting the same thing, it also carries the variant it used. All can be retrieved with attr().

Transmissibility

net_transmissibility() measures how many directly susceptible nodes each infected node will infect in each time period, on average. That is: $$T = \frac{1}{n}\sum_{j=1}^n \frac{i_{j}}{s_{j}}$$ where \(i\) is the number of new infections in each time period, \(j \in n\), and \(s\) is the number of nodes that could have been infected in that time period (note that \(s \neq S\), or the number of nodes that are susceptible in the population). \(T\) can be interpreted as the proportion of susceptible nodes that are infected at each time period.

Recovery time

net_recovery() measures the average number of time steps that nodes in a network remain infected. Note that in a diffusion model without recovery, average infection length will be infinite. This will also be the case where there is right censoring. The longer nodes remain infected, the longer they can infect others.

Reproduction number

net_by_reproduction() estimates the basic reproduction number \(R_0\) of a diffusion: the number of nodes that one typical case infects when all other nodes are susceptible. On a network this is $$R_0 = T \kappa$$ where \(T\) is the chance that an infectious node infects a susceptible neighbour before it recovers, and \(\kappa\) is the mean number of other neighbours of a node that a tie reaches. So the estimate separates the contagion, \(T\), from the network, \(\kappa\).

\(T\) comes from two chances per step, which are estimated from the states of the nodes in each step: \(\hat\tau\), the share of the exposed susceptible nodes that are infected, and \(\hat\gamma\), the share of the infectious nodes that recover or die. A node is exposed when it has a tie from a node that is infectious at the start and the end of the step. As in manynet::play_diffusion(), a node recovers before it can infect in a step, so $$T = \frac{(1 - \gamma) \tau}{\gamma + \tau - \gamma \tau}$$ With no recovery, \(T = 1\). Where no susceptible node was exposed, for example where the seeds recover in the first step, \(\tau\) cannot be estimated, and the result is NA with a warning. A small outbreak gives a noisy estimate, so where possible pool several diffusions or use more seeds.

\(\kappa\) is the mean excess degree of the network of the nodes that are not recovered or dead at the start, \(\sum_i k_i (k_i - 1) / \sum_i k_i\), or \(\sum_i k^{in}_i k^{out}_i / \sum_i k^{in}_i\) on a directed network. It is larger than the mean degree where the degrees are unequal, because a tie is more likely to reach a node with many ties.

The estimate assumes a simple contagion: a threshold of 1, with ties that expose the node they go to (direction = "in"), and a chance of infection that does not grow with the number of infectious neighbours. It also assumes that the degrees are not correlated, as in a random network; in a clustered network, such as a lattice, it is too high, because the neighbours of a case share neighbours. A two-mode network is not yet available.

Interpretation of the reproduction number is oriented around R = 1. Where \(R > 1\), the 'disease' will 'infect' more and more nodes in the network. Where \(R < 1\), the 'disease' will not sustain itself and eventually die out. Where \(R = 1\), the 'disease' will continue as endemic, if conditions allow.

Herd immunity

net_immunity() estimates the proportion of a network that need to be protected from infection for herd immunity to be achieved. This is known as the Herd Immunity Threshold or HIT: $$1 - \frac{1}{R}$$ where \(R\) is the reproduction number from net_by_reproduction(). The HIT indicates the threshold at which the reduction of susceptible members of the network means that infections will no longer keep increasing. Note that there may still be more infections after this threshold has been reached, but there should be fewer and fewer. These excess infections are called the overshoot. With \(R\) from net_by_reproduction(), which uses the structure of the network, this is the share of nodes to protect at random. Protecting the nodes with the most ties needs fewer.

Interpretation is quite straightforward. A HIT or immunity score of 0.75 would mean that 75% of the nodes in the network would need to be vaccinated or otherwise protected to achieve herd immunity. To identify how many nodes this would be, multiply this proportion with the number of nodes in the network.

Where \(R < 1\) the diffusion is already sub-critical and dies out of its own accord, so no one needs protecting and the threshold is reported as 0. The formula would otherwise return a negative proportion, which has no interpretation.

Tipping point

net_by_tipping() measures the tipping point of a threshold contagion on the network: the smallest share of the nodes that, as seeds, make every node adopt. It needs only a network, not a played diffusion.

The seeds are added one at a time in the order that rule gives, and a node adopts once at least threshold of its contacts have adopted. This is the threshold contagion of play_diffusion() with transmissibility = 1: it is deterministic, and a node never changes back. As in play_diffusion(), a threshold of 1 or more is a number of contacts, and a threshold of less than 1 is a share of them. More seeds never make fewer nodes adopt, so the tipping point is found by bisection.

The result depends on which nodes are the seeds. In a complete network where each node has the same threshold, all orders give the same result. In other networks, they need not. Direction and tie weights are ignored, and a two-mode network is not yet available.

References

On epidemiological models

Kermack, William O., and Anderson Gray McKendrick. 1927. "A contribution to the mathematical theory of epidemics". Proc. R. Soc. London A 115: 700-721. doi:10.1098/rspa.1927.0118

On the basic reproduction number

Diekmann, Odo, Hans J.A.P. Heesterbeek, and Hans J.A.J. Metz. 1990. "On the definition and the computation of the basic reproduction ratio R0 in models for infectious diseases in heterogeneous populations". Journal of Mathematical Biology, 28(4): 365–82. doi:10.1007/BF00178324

Kenah, Eben, and James M. Robins. 2007. "Second look at the spread of epidemics on networks". Physical Review E, 76(3 Pt 2): 036113. doi:10.1103/PhysRevE.76.036113

Newman, Mark E.J. 2002. "Spread of epidemic disease on networks". Physical Review E, 66(1): 016128. doi:10.1103/PhysRevE.66.016128

On herd immunity

Garnett, G.P. 2005. "Role of herd immunity in determining the effect of vaccines against sexually transmitted disease". The Journal of Infectious Diseases, 191(1): S97-106. doi:10.1086/425271

Examples

  smeg <- generate_smallworld(15, 0.025)
  smeg_diff <- play_diffusion(smeg, recovery = 0.2)
  if (requireNamespace("autograph", quietly = TRUE)) plot(smeg_diff)

  # To calculate the average transmissibility for a given diffusion model
  net_by_transmissibility(smeg_diff)
#> # Transmissibility [0, Inf)
#> [1] 0.952
  # To calculate the average infection length for a given diffusion model
  net_by_recovery(smeg_diff)
#> # Recovery time [0, Inf)
#> [1] 2.79
  # To calculate the reproduction number for a given diffusion model
  net_by_reproduction(smeg_diff)
#> # Reproduction number [0, Inf)
#> [1] 1.97
  # Calculating the proportion required to achieve herd immunity
  net_by_immunity(smeg_diff)
#> # Herd immunity threshold, normalized [0, 1]
#> [1] 0.491
  # To find the number of nodes to be vaccinated
  net_by_immunity(smeg_diff, normalized = FALSE)
#> # Herd immunity threshold [0, Inf)
#> [1] 8
  # The share of the nodes that must start a complex contagion
  net_by_tipping(ison_adolescents, threshold = 2)
#> # Tipping point, normalized [0, 1]
#> [1] 1