[Stpp-commits] r51 - in pkg: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Apr 25 16:13:59 CEST 2012
Author: gabriele
Date: 2012-04-25 16:13:59 +0200 (Wed, 25 Apr 2012)
New Revision: 51
Modified:
pkg/DESCRIPTION
pkg/R/plotK.R
pkg/man/STIKhat.Rd
pkg/man/animation.Rd
Log:
Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION 2012-04-21 11:17:14 UTC (rev 50)
+++ pkg/DESCRIPTION 2012-04-25 14:13:59 UTC (rev 51)
@@ -3,7 +3,7 @@
Title: Space-Time Point Pattern simulation, visualisation and analysis
Version: 0.1
Date: 2008-10-16
-Author: Edith Gabriel
+Authors: Edith Gabriel, Peter J Diggle, stan function by Barry Rowlingson
Maintainer: Edith Gabriel <edith.gabriel at univ-avignon.fr>
Depends: R (>= 2.10), splancs
Suggests: rpanel, rgl
Modified: pkg/R/plotK.R
===================================================================
--- pkg/R/plotK.R 2012-04-21 11:17:14 UTC (rev 50)
+++ pkg/R/plotK.R 2012-04-25 14:13:59 UTC (rev 51)
@@ -23,7 +23,7 @@
if (isTRUE(persp))
{
mask <- matrix(0,ncol=length(K$times),nrow=length(K$dist))
- for(i in 1:length(K$dist)){ for(j in 1:length(K$times)){mask[i,j] <- COL[iplace(x=k[i,j],X=M,xinc=diff(range(M))/(n-1))]}}
+ for(i in 1:length(K$dist)){ for(j in 1:length(K$times)){mask[i,j] <- COL[.iplace(x=k[i,j],X=M,xinc=diff(range(M))/(n-1))]}}
COL <- mask[1:(length(K$dist)-1),1:(length(K$times)-1)]
if(isTRUE(legend))
@@ -33,8 +33,8 @@
persp(x=K$dist, y=K$times, z=k, xlab="u",ylab="v", zlab="",expand=1, col=COL, ...)
title(titl,cex.main=2)
par(fig=c(0.825,1,0,1))
- mini <- iplace(x=min(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
- maxi <- iplace(x=max(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
+ mini <- .iplace(x=min(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
+ maxi <- .iplace(x=max(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
legend("right",fill=colo(n)[maxi:mini],legend=M[maxi:mini],horiz=F,bty="n")
}
else
@@ -60,8 +60,8 @@
axis(2,at=at[length(at)],labels="v",cex.axis=2)
title(titl,cex.main=2)
par(fig=c(0,1,0.1,1))
- mini <- iplace(x=min(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
- maxi <- iplace(x=max(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
+ mini <- .iplace(x=min(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
+ maxi <- .iplace(x=max(k,na.rm=T),X=M,xinc=diff(range(k))/(n-1))
legend("right",fill=colo(n)[maxi:mini],legend=M[maxi:mini],horiz=F,bty="n")
}
else
Modified: pkg/man/STIKhat.Rd
===================================================================
--- pkg/man/STIKhat.Rd 2012-04-21 11:17:14 UTC (rev 50)
+++ pkg/man/STIKhat.Rd 2012-04-25 14:13:59 UTC (rev 51)
@@ -26,7 +26,7 @@
\item{correction}{logical value. If \code{TRUE}, the Ripley's
edge correction is used.} \item{infectious}{logical value. If
\code{TRUE}, only future events
- are considered. The estimate of the STIK function is thus the one given in Details.}
+ are considered. See Details.}
}
\details{Gabriel and Diggle (2009) propose the following
@@ -61,6 +61,13 @@
\right\rbrace}}{K'(u,v) = |SxT|/(nv(n-1)) sum_{i=1,...,nv} sum_{j=1,...,nv; j>i} 1/wij 1{uij <=
u} 1{tj - ti <= v}}
+If parameter \code{infectious = TRUE}, both future and past
+events are considered and the estimator is: \deqn{
+ \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}}{K^*(u,v) = 1/|SxT| sum_{i=1,...,n}
+ sum_{j=1,...,n; j \neq j} 1/wij 1/(lambda(x_i)lambda(x_j)) 1{uij <=
+ u} 1{|tj - ti| <= v}}
}
\value{ A list containing:
@@ -68,8 +75,8 @@
\item{Khat}{ndist x ntimes matrix containing values of \eqn{\hat
K_{ST}(u,v)}{K(u,v)}.}
\item{Ktheo}{ndist x ntimes matrix containing theoretical
-values for a Poisson process (\eqn{\pi u^2 v}{pi u^2 v} for K
-and \eqn{\pi u^2 v}{pi u^2 v}) for K'.}
+values for a Poisson process; \eqn{\pi u^2 v}{pi u^2 v} for K
+and \eqn{2 \pi u^2 v}{2 pi u^2 v}) for K^*.}
\item{dist, times, infectious}{parameters passed in argument.}
}
@@ -95,7 +102,7 @@
data(northcumbria)
FMD=as.3dpoints(fmd[,1]/1000,fmd[,2]/1000,fmd[,3])
-# estimation of the temporal intensity
+# estimation of the temporal intensity
M=density(FMD[,3],kernel="gaussian",n=200)
mut=M$y[FMD[,3]]*dim(fmd)[1]
Modified: pkg/man/animation.Rd
===================================================================
--- pkg/man/animation.Rd 2012-04-21 11:17:14 UTC (rev 50)
+++ pkg/man/animation.Rd 2012-04-25 14:13:59 UTC (rev 51)
@@ -35,4 +35,4 @@
None
}
-\author{Peter Diggle, Edith Gabriel <edith.gabriel at univ-avignon.fr>.}
+\author{Peter J Diggle, Edith Gabriel <edith.gabriel at univ-avignon.fr>.}
More information about the Stpp-commits
mailing list