Hi.
I want fit a cross variogram with two variables. but it is non-possitive
definite.
even if I use fit.range=T, prediction is performed by inverse distance not
cokriging and all of  variance prediction are NA.
my program is like below.

rm(list=ls())
library(gstat)
dd<-read.table("bees.txt",header=TRUE)
x.range <- as.integer(range(dd@coords[,1]))
y.range <- as.integer(range(dd@coords[,2]))
grd <- expand.grid(x=seq(from=x.range[1]-20000, to=x.range[2]+90000,
by=500), y=seq(from=y.range[1]-150000, to=y.range[2]+90000, by=500) )
coordinates(grd) <- ~ x+y
gridded(grd) <- TRUE
plot(grd, cex=0.5)
points(dd, pch=3, col='blue', cex=0.7)
coordinates(dd) <- ~ x+y
m<-vgm(1954,"Gau",80017,225)
g <- gstat(NULL, id = " B", form =  B ~ 1,data=dd)
g <- gstat(g, id = "E", form = E~ 1,data=dd)
g <- gstat(g, id = "T", form =  T~ 1,data=dd)
vm <- variogram(g)
plot(vm)
vm.fit <- fit.lmc(vm, g, model=m,fit.ranges =T)
plot(vm, vm.fit,col="black",type="b",lwd=3,main="Fig1")
 cv.c2 <- gstat.cv(g)
summary(cv.c2$residual)
sqrt(mean(cv.c2$residual^2))
mean(cv.c2$residual)
k.c2 <- predict.gstat(g, dd)
image(k.c2)
summary(k.c2)
contour(k.c2,add=T)

Thanks for your help.

-- 

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

Tel: +98 917 5305167

	[[alternative HTML version deleted]]

