contactnet: Generate binary adjacency matrix contact networks

Description Usage Arguments Details Value References Examples

View source: R/netdis.r

Description

This function allows the user to generate contact network with binary adjacency matrices from spatial (power-law or Cauchy) and random network models.

Usage

1
contactnet(type, num.id = NULL, location = NULL, beta, nu = NULL)

Arguments

type

type of contact network model, with the choice of “powerlaw” for the power-law model, “Cauchy” for the Cauchy model, and “random” for randomly generated contact network from a Bernoulli distribution with parameter beta.

num.id

the number of individuals (nodes). It has to be specified when type is set to “random”.

location

a matrix of the XY coordinates of individuals. Required when type is set to “powerlaw” or “Cauchy”. Default is NULL.

beta

spatial parameter of the spatial contact network model or probability parameter of the random network model (>0).

nu

scale parameter of the power-law contact network model (>0). Default value is 1.

Details

The contact networks considered here are undirected, “unweighted” and have binary adjacency matrix, so that c_{ij}=c_{ji} for i \ne j; i,j = 1,..,N, and each element of the contact network is defined as c_{ij} = 1 if a connection exist between individuals i and j, and 0 otherwise. We can either generate spatial networks which have connections more likely to be present between two individuals closed together than far apart, or random contact networks.

For spatial contact networks, there are two options of specifying the model for the probability of connections between individuals. We use a generalized version of the power-law contact network model of Bifolchi et al. (2013) for the first option, in which the probability of a connection between individuals i and j is given by:

p(c_{ij}=1) = 1- exp(-ν(d_{ij}^{-β})) , ν, β > 0,

where d_{ij} is the Euclidean distance between individuals i and j; β is the spatial parameter; and ν is the scale parameter.

The second option is a Cauchy model as used in Jewell et al., (2009). The probability of a connection between individuals i and j is given by:

p(c_{ij}=1) = 1- exp(-β/(d_{ij}^{2} + β^{2})), β > 0,

where d_{ij} is the Euclidean distance between individual i and j; and β is the spatial parameter.

The final option is a random contact network in which the probability of a connection is generated from a Bernoulli distribution with probability equal to β.

Value

An object of class “contactnet” that has a list of:

location:

A matrix of the XY coordinates of individuals.

contact.network:

Binary contact network adjacency matrix.

type:

The type of contact network model.

References

Jewell, C. P., Kypraios, T., Neal, P., and Roberts, G. O. (2009). Bayesian analysis for emerging infectious diseases. Bayesian Analysis, 4(3):465-496.

Bifolchi, N., Deardon, R., and Feng, Z. (2013). Spatial approximations of network-based individual level infectious disease models. Spatial and Spatio-temporal Epidemiology, 6:59-70.

Examples

1
2
3
4
5
set.seed(12345)
loc<- matrix(cbind(runif(50, 0, 10),runif(50, 0, 10)), ncol = 2, nrow = 50)
net1<- contactnet(type = "powerlaw", location = loc, beta = 1.5, nu = 0.5)
net2<- contactnet(type = "Cauchy", location = loc, beta = 0.5)
net3<- contactnet(type = "random", num.id = 50, beta = 0.08)

EpiILMCT documentation built on June 29, 2021, 9:08 a.m.