[R-sig-Geo] All st-gamma values are 0

Saman Monfared samanmonfared1 at gmail.com
Thu Apr 11 18:45:33 CEST 2013


Hi,
I try to fit a st variogram for my data.The values of variogram$gamma
in all st lags are 0. I don't no why this occurs!

Data is attached.

my program is:
rm(list=ls())
library(gstat)
library(spacetime)
library(maptools)
library(RColorBrewer)
library(maps)
library(lattice)
data<-read.table("cancer.rate.txt",header=TRUE)
cancer.loc<-read.table("bladder.loc.txt",header=TRUE)
pts<-cbind(cancer.loc$x,cancer.loc$y)
pts = SpatialPoints(pts)
data$time = ISOdate(data$year, data$mounth, data$day)
ind<-as.matrix(cbind(data$indexs,data$indext))
xx = STSDF(pts,data$time,data,ind)
vv<-variogram(Rate~1,xx,width=200000,cutoff=3000000,tlags=1:8)
plot(vv,map=T)
wireframe(gamma~spacelag+timelag,vv,col="red",drape=T,outer =T,
scales=list(arrows=FALSE))
separableModel<-vgmST("separable",space=vgm(.05,"Gau",10000, 0.1),
time =vgm(.02,"Gau", 100, 0),sill=.2,nugget=0)
v.f<-fit.StVariogram(vv,separableModel,method="L-BFGS-B")
v.f
wireframe(model~spacelag+timelag,variogramSurface(v.f,vv),drape=T,
aspect = c(1,1),panel.aspect =1,scales=list(arrows=F))
plot(vv,v.f)
grd<-read.table("farsgrid.txt",header=T)
grd = SpatialPixels(SpatialPoints(cbind(grd$x,grd$y)))
plot(grd)
n =3
library(xts)
tgrd = seq(max(index(xx)+31622400*2),max(index(xx)+3*31622400),length=2)
pred.grd = STF(grd, tgrd)
plot(pred.grd )
cancer.ST = krigeST(Rate~1,xx,pred.grd ,separableModel)
stplot(cancer.ST)





-- 
Saman Monfared
Msc, Department of Statistics, Shiraz University,
Shiraz 71454, Iran
Email: Samanmonfared1 at gmail.com

Tel: +98 917 5305167
-------------- next part --------------
A non-text attachment was scrubbed...
Name: New folder.rar
Type: application/rar
Size: 3133 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130411/9c26b059/attachment.bin>


More information about the R-sig-Geo mailing list