infecSim: Infection simulation

Description Usage Arguments Details Value Examples

View source: R/infec_sim.R

Description

Simulate data from an infectious disease process modelled as a Poisson process

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
infecSim(
  region,
  t.win,
  covariates,
  mean.val,
  p = 1/mean.val,
  delta,
  rho,
  beta = c(1, 1),
  t.off = 0,
  cov.pars = c(1, 0.0075, 0.5),
  grid.size = 64^2
)

Arguments

region

A spatialPolygon defining the area to simulate data for

t.win

A vector indicating the time window to simulate data for, eg. c(1, 30)

covariates

A spatialPolygonsDataFrame containing population density information for the area of interest. The population density variable should be called popdens.

mean.val

Integer, the mean number of cases per time period

p

Probability a case generates a cluster

delta

A vector of two values: the spatial range and temporal range parameters

rho

Multiplicative factor of effect of a cluster

beta

Parameters of latent field covariates

t.off

Temporal offset parameter - number of time periods to displace the peak of the cluster intensity.

cov.pars

Covariance parameters of latent Gaussian field covariates: partial sill, range, and nugget

grid.size

Size of the computational grid to simulate the infectious process

Details

  1. Background incidence is a Poisson process with intensity lambda x (pop density)

  2. A small fraction p of background events trigger a temporary increase in local intensity to lambda x (pop density) x (1+rho) in a disc of radius delta for the next k time-periods.

Value

A list: (1) simulated data for each computational grid cell, (2) simulated case locations and time, (3) plot of Poisson intensity, (4) plot of simulated case locations, (5) stpp object of case locations for use with stpp functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(square,square_pop)
infecSim(region = square,
         t.win = c(1,10),
         covariates = square_pop,
         mean.val= 100,
         p =1/100,
         delta = c(0.01,4),
         rho=3,
         t.off = 4,
         cov.pars = c(0.9,0.03,0.1),
         grid.size = 64^2)

realTimeSurv documentation built on May 18, 2021, 9:07 a.m.