Performing a kriging

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Performing a kriging

Komine
Dear,
I use the data (.csv) shown below for performing a kriging.
       X             Y       Humidity
1 719134.1 1433671       90
2 736867.3 1431585       50
3 751471.1 1422197       32
4 749384.8 1414895       75
5 732694.8 1413851       12
6 719134.1 1412808       65

I use this code retreived from internet and adapted with my data.

> tab<-read.table("C:\\Users\\Kriging.csv",sep=";",dec=",",header=TRUE)
> tab
> library(geoR)
> ml <- likfit(Kriging, ini = c(1,0.5), fix.nugget =T)
> pred.grid <-  expand.grid(seq(0,1, l=51), seq(0,1, l=51))
> kc <- krige.conv(Kriging, loc = pred.grid, krige = krige.control(obj.m = ml))
> image(kc, loc = pred.grid, col=gray(seq(1,0.1,l=30))

When I run the code, I have an error message from the fourth command line.

Thank you in advance for your advice, I am not familiar with in spatial statistics.  

Komine  
Reply | Threaded
Open this post in threaded view
|

Re: Performing a kriging

Paulo Justiniano Ribeiro Jr-2
The iitial values at the ini argumento for likfit seems innapropriate for
your data.
some reasonable guesses for them would be

var(Humidity) and 0.05*max(dist(cbind(X,Y)))

Besides consider divide UTM values by 1000 expressing distance in km
to avoid computations with large numbers




Paulo Justiniano Ribeiro Jr
LEG (Laboratorio de Estatistica e Geoinformacao)
Universidade Federal do Parana
Caixa Postal 19.081
CEP 81.531-990
Curitiba, PR  -  Brasil
Tel: (+55) 41 3361 3573
VOIP: (+55) (41) (3361 3600) 1053 1066
Fax: (+55) 41 3361 3141
e-mail: paulojus AT  ufpr  br
http://www.leg.ufpr.br/~paulojus

On Thu, 13 Jun 2013, Komine wrote:

> Dear,
> I use the data (.csv) shown below for performing a kriging.
>       X             Y       Humidity
> 1 719134.1 1433671       90
> 2 736867.3 1431585       50
> 3 751471.1 1422197       32
> 4 749384.8 1414895       75
> 5 732694.8 1413851       12
> 6 719134.1 1412808       65
>
> I use this code retreived from internet and adapted with my data.
>
>> tab<-read.table("C:\\Users\\Kriging.csv",sep=";",dec=",",header=TRUE)
>> tab
>> library(geoR)
>> ml <- likfit(Kriging, ini = c(1,0.5), fix.nugget =T)
>> pred.grid <-  expand.grid(seq(0,1, l=51), seq(0,1, l=51))
>> kc <- krige.conv(Kriging, loc = pred.grid, krige = krige.control(obj.m =
>> ml))
>> image(kc, loc = pred.grid, col=gray(seq(1,0.1,l=30))
>
> When I run the code, I have an error message from the fourth command line.
>
> Thank you in advance for your advice, I am not familiar with in spatial
> statistics.
>
> Komine
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Performing-a-kriging-tp7583773.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Performing a kriging

Komine
In reply to this post by Komine
Thank you Saman and Paulo,

Certainly , I use Awkwardly the example advised by Paulo.  I don't understand the code :var(Humidity) and 0.05*max(dist(cbind(X,Y))).

However, after the change of my data to geodata, I have not an error message but the result is a black plot (useless).  
The followed code was used:

> library(geoR)
> tab<-as.geodata(tab,coords.col=1:2,data.col=3,data.names=NULL)
> ml <- likfit(tab, ini = c(1,0.5), fix.nugget =T)
> pred.grid <-  expand.grid(seq(0,1, l=51), seq(0,1, l=51))
> kc <- krige.conv(tab, loc = pred.grid, krige = krige.control(obj.m = ml))
> image(kc, loc = pred.grid, col=gray(seq(1,0.1,l=30)))

Thank you in advance for your advice.







 
Komine  
Komine wrote
Dear,
I use the data (.csv) shown below for performing a kriging.
       X             Y       Humidity
1 719134.1 1433671       90
2 736867.3 1431585       50
3 751471.1 1422197       32
4 749384.8 1414895       75
5 732694.8 1413851       12
6 719134.1 1412808       65

I use this code retreived from internet and adapted with my data.

> tab<-read.table("C:\\Users\\Kriging.csv",sep=";",dec=",",header=TRUE)
> tab
> library(geoR)
> ml <- likfit(Kriging, ini = c(1,0.5), fix.nugget =T)
> pred.grid <-  expand.grid(seq(0,1, l=51), seq(0,1, l=51))
> kc <- krige.conv(Kriging, loc = pred.grid, krige = krige.control(obj.m = ml))
> image(kc, loc = pred.grid, col=gray(seq(1,0.1,l=30))

When I run the code, I have an error message from the fourth command line.

Thank you in advance for your advice, I am not familiar with in spatial statistics.  

Komine
Reply | Threaded
Open this post in threaded view
|

Re: Performing a kriging

Komine
Thank you Saman and Paulo,

Certainly , I use Awkwardly the example advised by Paulo.  I don't understand the code :var(Humidity) and 0.05*max(dist(cbind(X,Y))).
 
However, after the change of my data to geodata, I have not an error message but the result is a black plot (useless).  
 The followed code was used:

> library(geoR)
> tab<-as.geodata(tab,coords.col=1:2,data.col=3,data.names=NULL)
> ml <- likfit(tab, ini = c(1,0.5), fix.nugget =T)
> pred.grid <-  expand.grid(seq(0,1, l=51), seq(0,1, l=51))
> kc <- krige.conv(tab, loc = pred.grid, krige = krige.control(obj.m = ml))
> image(kc, loc = pred.grid, col=gray(seq(1,0.1,l=30)))

Thank you in advance for your advice.