Description Usage Arguments Value Author(s) See Also Examples
Generate one (or several) realisation(s) of the infection process in a region S x T.
1 2 3 4 |
npoints |
number of points to simulate. |
s.region |
two-column matrix specifying polygonal region containing
all data locations. If |
t.region |
vector containing the minimum and maximum values of
the time interval. If |
nsim |
number of simulations to generate. Default is 1. |
alpha |
numerical value for the latent period. |
beta |
numerical value for the maximum infection rate. |
gamma |
numerical value for the infection period. |
h |
infection rate function which depends on alpha, beta and delta. Must be choosen among "step" and "gaussian". |
s.distr |
spatial distribution. Must be choosen among "uniform", "gaussian", "exponential" and "poisson". |
t.distr |
temporal distribution. Must be choosen among "uniform" and "exponential". |
maxrad |
single value or 2-vector of spatial and temporal maximum radiation respectively. If single value, the same value is used for space and time. |
delta |
spatial distance of inhibition/contagion. If missing, the spatial radiation is used |
g |
Compute the probability of acceptance of a new point from |
recent |
If “ |
lambda |
function or matrix defining the intensity of a Poisson process if s.distr is Poisson. |
lmax |
upper bound for the value of lambda. |
nx, ny |
define the 2-D grid on which the intensity is evaluated if
|
nt |
used to discretize time to compute the infection rate function. |
t0 |
minimum time used to compute the infection rate function.
Default is the minimum of |
inhibition |
Logical. If TRUE, an inhibition process is generated. Otherwise, it is a contagious process. |
... |
additional parameters if |
A list containing:
xyt |
matrix (or list of matrices if |
s.region, t.region |
parameters passed in argument. |
Edith Gabriel <edith.gabriel@univ-avignon.fr>, Peter J Diggle.
plot.stpp
, animation
and stan
for plotting space-time point patterns.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# inhibition; spatial distribution: uniform
inf1 = rinfec(npoints=100, alpha=0.2, beta=0.6, gamma=0.5, maxrad=c(0.075,0.5),
t.region=c(0,50), s.distr="uniform", t.distr="uniform", h="step", p="min",
recent="all", inhibition=TRUE)
\dontrun{animation(inf1$xyt, cex=0.8, runtime=10)}
# contagion; spatial distribution: Poisson with intensity a given matrix
data(fmd)
data(northcumbria)
h = mse2d(as.points(fmd[,1:2]), northcumbria, nsmse=30, range=3000)
h = h$h[which.min(h$mse)]
Ls = kernel2d(as.points(fmd[,1:2]), northcumbria, h, nx=50, ny=50)
inf2 = rinfec(npoints=100, alpha=4, beta=0.6, gamma=20, maxrad=c(12000,20),
s.region=northcumbria, t.region=c(1,2000), s.distr="poisson",
t.distr="uniform", h="step", p="min", recent=1,
lambda=Ls$z, inhibition=FALSE)
image(Ls$x, Ls$y, Ls$z, col=grey((1000:1)/1000)); polygon(northcumbria,lwd=2)
animation(inf2$xyt, add=TRUE, cex=0.7, runtime=15)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.