data(fmd)
data(northcumbria)
FMD=as.3dpoints(fmd[,1]/1000,fmd[,2]/1000,fmd[,3])
# estimation of the temporal intensity
M=density(FMD[,3],kernel="gaussian",n=200)
mut=M$y[FMD[,3]]*dim(fmd)[1]
# estimation of the spatial intensity
h = mse2d(pts=FMD[,1:2], poly=northcumbria/1000, nsmse=100, range=5)
hs=h$h[h$mse==min(h$mse)]
require(spatialkernel)
mhat <- lambdahat(pts=as.points(FMD[,1:2]), h=hs, gpts=as.points(FMD[,1:2]), poly = northcumbria/1000, edge = TRUE)$lambda
# 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=T)
# plotting the estimation
plotK(stik)
plotK(stik,persp=T,theta=-65,phi=35)
Run the code above in your browser using DataLab