Learn R Programming

surveillance (version 1.8-0)

twinstim_iaf: Temporal and Spatial Interaction Functions for twinstim

Description

A twinstim model as described in Meyer et al. (2012) requires the specification of the spatial and temporal interaction functions ($f$ and $g$, respectively), i.e. how infectivity decays with increasing spatial and temporal distance from the source of infection. It is of course possible to define own functions (see siaf and tiaf, respectively), but the package already predefines some useful dispersal kernels returned by the constructor functions documented here.

Usage

# predefined spatial interaction functions
siaf.constant()
siaf.step(knots, maxRange = Inf, nTypes = 1, validpars = NULL)
siaf.gaussian(nTypes = 1, logsd = TRUE, density = FALSE,
              F.adaptive = TRUE, effRangeMult = 6, validpars = NULL)
siaf.powerlaw(nTypes = 1, validpars = NULL)
siaf.powerlawL(nTypes = 1, validpars = NULL)
siaf.student(nTypes = 1, validpars = NULL)

# predefined temporal interaction functions tiaf.constant() tiaf.step(knots, maxRange = Inf, nTypes = 1, validpars = NULL) tiaf.exponential(nTypes = 1, validpars = NULL)

Arguments

knots
numeric vector of distances at which the step function switches to a new height. The length of this vector determines the number of parameters to estimate. For identifiability, the step function has height 1 in the first interval $[0,knots_1)$
maxRange
a scalar larger than any of knots. Per default (maxRange=Inf), the step function never drops to 0 but keeps the last height for any distance larger than the last knot. However, this might not work in some cases, w
nTypes
determines the number of parameters ((log-)scales or (log-)shapes) of the kernels. In a multitype epidemic, the different types may share the same spatial interaction function, in which case nTypes=1. Otherwise nTypes
logsd
logical indicating if the kernel should be parametrized with the log-standard deviation as the parameter in question to enforce positivity. This is the recommended default and avoids constrained optimisation (L-BFGS-B) or the use of
density
logical indicating if the density or just its kernel should be used. If density=TRUE, siaf.gaussian uses the density of the bivariate, isotropic normal distribution as the spatial interaction function. Otherwise (defa
F.adaptive
If F.adaptive = TRUE, then an adaptive bandwidth of adapt*sd will be used in the midpoint-cubature (polyCub.midpoint in package polyCub) of t
effRangeMult
determines the effective range for numerical integration in terms of multiples of the standard deviation $\sigma$ of the Gaussian kernel, i.e. with effRangeMult=6 numerical integration only considers the $6 \sigma$ area around the
validpars
function taking one argument, the parameter vector, indicating if it is valid (see also siaf). If logsd=FALSE and one prefers not to use method="L-BFGS-B" for fitting the

Value

  • The specification of an interaction function, which is a list. See siaf and tiaf, respectively, for a description of its components.

encoding

latin1

Details

The readily available spatial interaction functions are defined as follows: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object] The predefined temporal interaction functions are defined as follows: [object Object],[object Object],[object Object]

References

Meyer, S. and Held, L. (2014): Power-law models for infectious disease spread. Annals of Applied Statistics. In press. arXiv:1308.5115 arXiv-Link: http://arxiv.org/abs/1308.5115

Meyer, S., Elias, J. and H{oe}hle, M. (2012): A space-time conditional intensity model for invasive meningococcal disease occurrence. Biometrics, 68, 607-616. DOI-Link: http://dx.doi.org/10.1111/j.1541-0420.2011.01684.x

Meyer, S. (2010): Spatio-Temporal Infectious Disease Epidemiology based on Point Processes. Master's Thesis, Ludwig-Maximilians-Universit{ae}t M{ue}nchen. Available as http://epub.ub.uni-muenchen.de/11703/

See Also

twinstim, siaf, tiaf

Examples

Run this code
# constant temporal dispersal
tiaf.constant()
# step function kernel
tiaf.step(c(3,7), maxRange=14, nTypes=2)
# exponential decay specification
tiaf.exponential()

# Type-dependent Gaussian spatial interaction function using an adaptive
# two-dimensional midpoint-rule to integrate it over polygonal domains
siaf.gaussian(2, F.adaptive=TRUE)

# Type-independent power-law kernel
siaf.powerlaw()

# "lagged" power-law
siaf.powerlawL()

# (reparametrized) t-kernel
siaf.student()

# step function kernel
siaf.step(c(10,20,50), maxRange=100)

Run the code above in your browser using DataLab