Learn R Programming

stpp (version 1.0-3)

STIKhat: Estimation of the Space-Time Inhomogeneous K-function

Description

Compute an estimate of the Space-Time Inhomogeneous K-function.

Usage

STIKhat(xyt, s.region, t.region, dist, times, lambda,
correction=TRUE, infectious=TRUE)

Arguments

xyt
coordinates and times (x,y,t) of the point pattern.
s.region
two-column matrix specifying polygonal region containing all data locations. If s.region is missing, the bounding box of xyt[,1:2] is considered.
t.region
vector containing the minimum and maximum values of the time interval. If t.region is missing, the range of xyt[,3] is considered.
dist
vector of distances u at which $K_{ST}(u,v)$ is computed.
times
vector of times v at which $K_{ST}(u,v)$ is computed.
lambda
vector of values of the space-time intensity function evaluated at the points (x,y,t) in SxT. If lambda is missing, the estimate of the space-time K-function is computed as for the homogeneous case (Diggle et al., 1995), i.e. considering
correction
logical value. If TRUE, spatial (Ripley's) and temporal edge corrections are used.
infectious
logical value. If TRUE, only future events are considered. See Details.

Value

  • A list containing:
  • Khatndist x ntimes matrix containing values of $\hat K_{ST}(u,v)$.
  • Ktheondist x ntimes matrix containing theoretical values for a Poisson process; $\pi u^2 v$ for K and $2 \pi u^2 v$) for K^*.
  • dist, times, infectiousparameters passed in argument.

Details

Gabriel and Diggle (2009) propose the following approximately unbiased estimator for the STIK-function, based on data giving the locations of events $x_i: i=1,...n$ on a spatio-temporal region $S \times T$,where S is an arbitrary polygon and $T=[T_0,T_1]$: $$\widehat K_{ST}(u,v) = \frac{1}{|S \times T|} \frac{n}{n_v} \sum_{i=1}^{n_v} \sum_{j=1; j > i}^{n_v} \frac{1}{w_{ij}} \frac{1}{\lambda(x_i) \lambda(x_j)}{\bf 1}_{\left\lbrace u_{ij} \leq u \right\rbrace} {\bf 1}_{\left\lbrace t_j - t_i \leq v \right\rbrace}$$ In this equation, $\lambda(x_i)$ is the intensity at $x_i = (s_i,t_i)$ and the $x_i$ are ordered so that $t_i < t_{i+1}$, with ties due to round-off error broken by randomly unrounding if necessary. To deal with temporal edge-effects, for each v, $n_v$ denotes the number of events for which $t_i \leq T_1 -v$. To deal with spatial edge-effects, we use Ripley's method, in which $w_{ij}$ is the proportion of the circle centered on $s_i$ and passing through $s_j$, i.e. of radius $u_{ij}= \| s_i - s_j\|$, that lies inside S.

If lambda is missing in argument, STIKhat computes an estimate of the space-time (homogeneous) K-function: $$\widehat{K}'_{ST}(u,v) = \frac{|S \times T|}{n_v(n-1)} \sum_{i=1}^{n_v} \sum_{j=1; j > i}^{n_v} \frac{1}{w_{ij}}{\bf 1}_{\left\lbrace u_{ij} \leq u \right\rbrace} {\bf 1}_{\left\lbrace t_j - t_i \leq v \right\rbrace}$$

If parameter infectious = FALSE, both future and past events are considered and the estimator is: $$\widehat K^*_{ST}(u,v) = \frac{1}{|S \times T|} \sum_{i=1}^{n} \sum_{j \neq j}^{n} \frac{1}{w_{ij}} \frac{1}{\lambda(x_i) \lambda(x_j)}{\bf 1}_{\left\lbrace u_{ij} \leq u \right\rbrace} {\bf 1}_{\left\lbrace |t_j - t_i| \leq v \right\rbrace}$$ where $v_{ij}$ is equal to 1 if both ends of the interval of length $2 |t_i - t_j|$ centred at $t_i$ lie within T and 1/2 otherwise.

References

Gabriel E., Diggle P. (2009) Second-order analysis of inhomogeneous spatio-temporal point process data. Statistica Neerlandica, 63, 43--51.

Gabriel E., Rowlingson B., Diggle P. (2013) stpp: an R package for plotting, simulating and analyzing Spatio-Temporal Point Patterns. Journal of Statistical Software, 53(2), 1--29.

Baddeley A., Moller J. and Waagepetersen R. (2000). Non- and semi-parametric estimation of interaction in inhomogeneous point patterns. Statistica Neerlandica, 54, 329--350.

Diggle P. , Chedwynd A., Haggkvist R. and Morris S. (1995). Second-order analysis of space-time clustering. Statistical Methods in Medical Research, 4, 124--136.

Examples

Run this code
data(fmd)
data(northcumbria)
FMD<-as.3dpoints(fmd[,1]/1000,fmd[,2]/1000,fmd[,3])
Northcumbria=northcumbria/1000

# estimation of the temporal intensity
Mt<-density(FMD[,3],n=1000)
mut<-Mt$y[findInterval(FMD[,3],Mt$x)]*dim(FMD)[1]

# estimation of the spatial intensity
h<-mse2d(as.points(FMD[,1:2]), Northcumbria, nsmse=50, range=4)
h<-h$h[which.min(h$mse)]
Ms<-kernel2d(as.points(FMD[,1:2]), Northcumbria, h, nx=5000, ny=5000)
atx<-findInterval(x=FMD[,1],vec=Ms$x)
aty<-findInterval(x=FMD[,2],vec=Ms$y)
mhat<-NULL
for(i in 1:length(atx)) mhat<-c(mhat,Ms$z[atx[i],aty[i]])

# estimation of the STIK function
u <- seq(0,10,by=1)
v <- seq(0,15,by=1)
stik <- STIKhat(xyt=FMD, s.region=northcumbria/1000,t.region=c(1,200), 
lambda=mhat*mut/dim(FMD)[1], dist=u, times=v, infectious=TRUE)

# plotting the estimation
plotK(stik)
plotK(stik,persp=T,theta=-65,phi=35)

Run the code above in your browser using DataLab