[Stpp-commits] r59 - pkg/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Aug 20 10:02:56 CEST 2012
Author: gabriele
Date: 2012-08-20 10:02:56 +0200 (Mon, 20 Aug 2012)
New Revision: 59
Modified:
pkg/man/PCFhat.Rd
pkg/man/STIKhat.Rd
pkg/man/animation.Rd
pkg/man/rinfec.Rd
pkg/man/rinter.Rd
pkg/man/rpcp.Rd
Log:
Modified: pkg/man/PCFhat.Rd
===================================================================
--- pkg/man/PCFhat.Rd 2012-08-17 11:17:30 UTC (rev 58)
+++ pkg/man/PCFhat.Rd 2012-08-20 08:02:56 UTC (rev 59)
@@ -48,8 +48,7 @@
spatio-temporal region \eqn{S \times T}{SxT}, where S is an
arbitrary polygon and \eqn{T=[T_0,T_1]}{T=[T0,T1]}: \deqn{
\widehat g(u,v) = \frac{1}{|S \times T|} \sum_{i=1}^{n}
- \sum_{j \neq j}^{n} \frac{1}{w_{ij} v_{ij}} \frac{k_{s}(u - \|s_i-s_j\|)k_{t}(v-|t_i-t_j|)}{\lambda(x_i) \lambda(x_j)}{\bf 1}_{\left\lbrace u_{ij} \leq u
- \right\rbrace}}{g(u,v) = 1/|SxT| sum_{i=1,...,n}
+ \sum_{j \neq j}^{n} \frac{1}{w_{ij} v_{ij}} \frac{k_{s}(u - \|s_i-s_j\|)k_{t}(v-|t_i-t_j|)}{\lambda(x_i) \lambda(x_j)}}{g(u,v) = 1/|SxT| sum_{i=1,...,n}
sum_{j=1,...,n; j \neq j} 1/(wij*vij) ks(u -
||si-sj||)kt(v-|ti-tj|)/(lambda(xi)lambda(xj))}
To deal with spatial edge-effects, we use Ripley's method, in
@@ -111,7 +110,8 @@
for(i in 1:length(atx)) mhat<-c(mhat,Ms$z[atx[i],aty[i]])
# estimation of the pair correlation function
-g <- PCFhat(xyt=FMD, dist=1:20, times=1:20, lambda=lambda=mhat*mut/dim(FMD)[1], s.region=northcumbria/1000,t.region=c(1,200))
+g <- PCFhat(xyt=FMD, dist=1:20, times=1:20, lambda=mhat*mut/dim(FMD)[1],
+ s.region=northcumbria/1000,t.region=c(1,200))
# plotting the estimation plotPCF(g)
plotPCF(g,persp=TRUE,theta=-65,phi=35) }}
Modified: pkg/man/STIKhat.Rd
===================================================================
--- pkg/man/STIKhat.Rd 2012-08-17 11:17:30 UTC (rev 58)
+++ pkg/man/STIKhat.Rd 2012-08-20 08:02:56 UTC (rev 59)
@@ -122,7 +122,8 @@
# 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)
+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)
Modified: pkg/man/animation.Rd
===================================================================
--- pkg/man/animation.Rd 2012-08-17 11:17:30 UTC (rev 58)
+++ pkg/man/animation.Rd 2012-08-20 08:02:56 UTC (rev 59)
@@ -6,7 +6,8 @@
Provide an animation of spatio-temporal point patterns.}
\usage{
-animation(xyt, s.region, t.region, runtime=1, incident="red", prevalent="pink3", pch=19, cex=0.5, plot.s.region=TRUE, scales=TRUE, border.frac=0.05, add=FALSE)
+animation(xyt, s.region, t.region, runtime=1, incident="red", prevalent="pink3",
+pch=19, cex=0.5, plot.s.region=TRUE, scales=TRUE, border.frac=0.05, add=FALSE)
}
\arguments{
Modified: pkg/man/rinfec.Rd
===================================================================
--- pkg/man/rinfec.Rd 2012-08-17 11:17:30 UTC (rev 58)
+++ pkg/man/rinfec.Rd 2012-08-20 08:02:56 UTC (rev 59)
@@ -71,7 +71,9 @@
\examples{
\dontrun{
# 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)
+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
@@ -80,7 +82,10 @@
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)
+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)
Modified: pkg/man/rinter.Rd
===================================================================
--- pkg/man/rinter.Rd 2012-08-17 11:17:30 UTC (rev 58)
+++ pkg/man/rinter.Rd 2012-08-20 08:02:56 UTC (rev 59)
@@ -96,11 +96,14 @@
return(res)
}
d=seq(0,1,length=100)
-plot(d,hs(d,theta=0.2,delta=0.1,mus=0.1),xlab="",ylab="",type="l",ylim=c(0,1),lwd=2,las=1)
+plot(d,hs(d,theta=0.2,delta=0.1,mus=0.1),xlab="",ylab="",type="l",
+ylim=c(0,1),lwd=2,las=1)
lines(d,ht(d,theta=0.1,delta=0.05,mut=0.3),col=2,lwd=2)
-legend("bottomright",col=1:2,lty=1,lwd=2,legend=c(expression(h[s]),expression(h[t])),bty="n",cex=2)
+legend("bottomright",col=1:2,lty=1,lwd=2,legend=c(expression(h[s]),expression(h[t])),
+bty="n",cex=2)
-inh2 = rinter(npoints=100, hs=hs, gs="min", thetas=0.2, deltas=0.1, ht=ht, gt="min", thetat=0.1, deltat=0.05, inhibition=TRUE)
+inh2 = rinter(npoints=100, hs=hs, gs="min", thetas=0.2, deltas=0.1, ht=ht, gt="min",
+thetat=0.1, deltat=0.05, inhibition=TRUE)
\dontrun{animation(inh2$xyt, runtime=15, cex=0.8)}
# simple contagious process for given spatial and temporal regions
Modified: pkg/man/rpcp.Rd
===================================================================
--- pkg/man/rpcp.Rd 2012-08-17 11:17:30 UTC (rev 58)
+++ pkg/man/rpcp.Rd 2012-08-20 08:02:56 UTC (rev 59)
@@ -74,14 +74,16 @@
# homogeneous Poisson distribution of parents
data(northcumbria)
-pcp1 <- rpcp(nparents=50, npoints=500, s.region=northcumbria, t.region=c(1,365),cluster=c("normal","exponential"), maxrad=c(5000,5))
+pcp1 <- rpcp(nparents=50, npoints=500, s.region=northcumbria, t.region=c(1,365),
+cluster=c("normal","exponential"), maxrad=c(5000,5))
\dontrun{
animation(pcp1$xyt, s.region=pcp1$s.region, t.region=pcp1$t.region,runtime=5)
}
# inhomogeneous Poisson distribution of parents
lbda <- function(x,y,t,a){a*exp(-4*y) * exp(-2*t)}
-pcp2 <- rpcp(nparents=50, npoints=500, cluster="normal", lambda=lbda, a=4000/((1-exp(-4))*(1-exp(-2))))
+pcp2 <- rpcp(nparents=50, npoints=500, cluster="normal", lambda=lbda,
+a=4000/((1-exp(-4))*(1-exp(-2))))
\dontrun{
stan(pcp2$xyt)
}
More information about the Stpp-commits
mailing list