Skip to content

problems with universal kriging

2 messages · Matevz Pavlic, Tobias Vetter

#
Hi all, 

 

i have some problems with universal kriging predictions. 

I would like to create a map using the X and Y as co-predictors. 

Attached is a sample data set  (temp.csv) and code (UK.txt) which is used in the predictions. 

 

The problem is, when i use universal kriging  i get really strange results. 

When I use this line for predicting :

 

z.uk<-krige(Globina~I(Y^2)+I(X^2)+I(X)+I(Y), DF, grd, vrmf.u)

 

the results are really strange: as you can see the Globina variable is reanging from 1.2 to 40 but predictions are from 457.6 to 2594.0.
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 

   1.20   10.00   12.00   12.96   15.00   40.00
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 

  457.6  1206.0  1524.0  1525.0  1843.0  2594.0 

 

 

When i use thisl line for prediction :

z.uk<-krige(Globina~I(Y^2)+I(X^2)+I(X)+I(Y), DF, grd, vrmf.u)

 

the results are still strange, but different. Again Globina is ranging from 1.2 to 40 and the predicted values are ranging from -230.6 to  -207.6 !
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 

   1.20   10.00   12.00   12.96   15.00   40.00
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 

 -230.6  -223.0  -221.6  -221.4  -220.0  -207.2 

 

What am I doing wrong?

 

thanks for the help, m

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110731/a84d6d11/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp1.csv
Type: application/octet-stream
Size: 19472 bytes
Desc: temp1.csv
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110731/a84d6d11/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: UK.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110731/a84d6d11/attachment.txt>
#
Try small letters. Strange, but seems to work: 

GridRes<-0.1
grd<-expand.grid(x=seq(from=x.range[1], to=x.range[2], by=GridRes),
y=seq(from=y.range[1], to=y.range[2], by=GridRes))
names(grd)=c("x","y")
coordinates(grd)<-~x+y
gridded(grd)<-T 


newframe<-cbind(coordinates(DF),DF at data)
names(newframe)[1]="x"
names(newframe)[2]="y"
coordinates(newframe)=~x+y
z.uk<-krige(Globina~x+y,newframe,grd,vrm.u)