Hi all,

I am trying to get covariance matrix for kriging predictions. I used krige0
function in the gstat library with options fullCovariance=TRUE and
computeVar=TRUE. I got a covariance matrix but the values seem to be too
large. I converted the covariance matrix to correlation matrix and got
values larger than 1. Following are the codes to derive the matrices:

library(gstat)
data(meuse)
coordinates(meuse) = ~x+y
data(meuse.grid)
gridded(meuse.grid) = ~x+y

m <- vgm(.59, "Sph", 874, .04)
x <- krige0(log(zinc)~1, meuse, meuse.grid, model =
m,fullCovariance=TRUE,computeVar=TRUE)

x$var[1:5,1:5]

       [,1]      [,2]      [,3]      [,4]      [,5]
1 0.3108421 0.2794621 0.2883862 0.3019975 0.2528104
2 0.2794621 0.2414045 0.2546174 0.2727450 0.2074984
3 0.2883862 0.2546174 0.2631935 0.2769452 0.2263174
4 0.3019975 0.2727450 0.2769452 0.2863739 0.2499542
5 0.2528104 0.2074984 0.2263174 0.2499542 0.1648699

cov2cor(x$var[1:5,1:5])

      [,1]     [,2]     [,3]     [,4]     [,5]
1 1.000000 1.020188 1.008247 1.012201 1.116746
2 1.020188 1.000000 1.010131 1.037331 1.040091
3 1.008247 1.010131 1.000000 1.008764 1.086450
4 1.012201 1.037331 1.008764 1.000000 1.150331
5 1.116746 1.040091 1.086450 1.150331 1.000000

I am not sure what I am getting here now. Is this covariance matrix for
kriging predictions? If not does anyone know how to get a covariance
matrix? Any help will be appreciated.

Thanks,
Han

	[[alternative HTML version deleted]]

