[R-sig-Geo] problems with universal kriging

Tobias Vetter vetter at pik-potsdam.de
Sun Jul 31 14:37:29 CEST 2011


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) 

 

> 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. 
> 
>   
> 
>> summary(DF$Globina)
> 
>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.  
> 
>    1.20   10.00   12.00   12.96   15.00   40.00  
> 
>   
> 
>> summary(z.uk$var1.pred)
> 
>    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 ! 
> 
>   
> 
>> summary(DF$Globina)
> 
>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.  
> 
>    1.20   10.00   12.00   12.96   15.00   40.00  
> 
>   
> 
>> summary(z.uk$var1.pred)
> 
>    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 
> 
>   
>



More information about the R-sig-Geo mailing list