d_nextgenclusterdistn {modelSSE}R Documentation

The next-generation cluster size distribution

Description

Density, cumulative distribution, quantile, and random variable generating functions for the next-generation cluster size distribution with pre-defined epidemiological parameters.

Usage

d_nextgenclusterdistn(
  x = 5,
  seed.size = 1,
  epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
  offspring.type = "D",
  is.log = FALSE
)

p_nextgenclusterdistn(
  q = 10.5,
  seed.size = 1,
  epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
  offspring.type = "D",
  lower.tail = TRUE,
  is.log = FALSE
)

q_nextgenclusterdistn(
  p = 0.8,
  seed.size = 1,
  epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
  offspring.type = "D",
  lower.tail = TRUE
)

r_nextgenclusterdistn(
  n = 10,
  seed.size = 1,
  epi.para = list(mean = 1, disp = 0.5, shift = 0.2),
  offspring.type = "D"
)

Arguments

x

A scalar, or a vector of positive integer, for the next-generation cluster size. The value of x must be not less than seed.size.

seed.size

A scalar, or a vector of positive integer. For vector type of seed.size, it only applies to d_nextgenclusterdistn(), p_nextgenclusterdistn(), and q_nextgenclusterdistn(). If seed.size and x, q or p are vectors, seed.size should be of the same length as x, q or p.

epi.para

A list (list) of pre-defined epidemiological parameters for offspring distribution, in the format of list(mean = ?, disp = ?, shift = ?), where the three parameters accept non-negative values. Each parameter can be either a scalar, or a vector. For the parameters being assigned with values of vectors, the vectors should be of the same length. For Delaporte distribution, the value of mean should be larger than the value of shift.

offspring.type

A character label (character) indicating the type of distribution used to describe the offspring distribution. It only accepts one of the following values:

  • "D" indicates the Delaporte distribution,

  • "NB" indicates the negative binomial distribution,

  • "G" indicates the geometric distribution, or

  • "P" indicates the Poisson distribution.

By default, offspring.type = 'D'.

is.log

A logical variable, under which probability would be taken natural logarithm, if is.log = TRUE. By default, is.log = FALSE.

q

A scalar, or a vector of positive number (not necessarily integer), for the next-generation cluster size. The value of q must be not less than seed.size.

lower.tail

A logical variable, under which the probability is cumulative distribution function (CDF, i.e., P(X <= x)), if lower.tail = TRUE, and otherwise, 1 - CDF (i.e., P(X > x)). By default, lower.tail = TRUE.

p

A scalar, or a vector of probability (i.e., ranging from 0 to 1).

n

A scalar of positive integer.

Details

Function d_nextgenclusterdistn() returns the probability of having a next-generation case cluster with size x generated by seed.size index cases, where (seed.size) is given.

Function p_nextgenclusterdistn() returns the probability of having a next-generation case cluster with size less than or equal to, or larger than q (depending on the value of lower.tail), generated by seed.size index cases, where (seed.size) is given.

Function q_nextgenclusterdistn() returns a value such that there is a probability of p for having a next-generation case cluster with size less than or equal to, or larger than this value (depending on the value of lower.tail) generated by seed.size index cases, where (seed.size) is given.

Function r_nextgenclusterdistn() returns a set of random variables of n next-generation cluster size, given (seed.size).

Value

For the values returned from the four functions,

Note

Depending on the values of parameters, the functions could take hours to complete, given the double-summation nature for the Delaporte distribution.

References

Blumberg S, Lloyd-Smith JO. Inference of R 0 and transmission heterogeneity from the size distribution of stuttering chains. PLoS Computational Biology. 2013 May 2;9(5):e1002993. doi:10.1371/journal.pcbi.1002993

Zhao S, Chong MK, Ryu S, Guo Z, He M, Chen B, Musa SS, Wang J, Wu Y, He D, Wang MH. Characterizing superspreading potential of infectious disease: Decomposition of individual transmissibility. PLoS Computational Biology. 2022;18(6):e1010281. doi:10.1371/journal.pcbi.1010281

See Also

Delaporte for the parameterization of Delaporte distribution.

Examples

## Please see the "Usage" section.


[Package modelSSE version 0.1-3 Index]