[R] (no subject)

Miha STAUT mihastaut at hotmail.com
Sun Aug 17 14:07:45 CEST 2003


Hi all,

>str(df)
`data.frame':   31837 obs. of  3 variables:
$ x : num  410683 410700 410720 410740 410324 ...
$ y : num  43136 43126 43123 43125 42709 ...
$ wz: num  -101.1  -94.9  -93.3  -94.5   30.8 ...

>library(gstat)

>g<-gstat(id="rv",form=wz~1,loc=~x+y,data=df,model=mat,nmax=500,set=list(average=1))

>str(g)
List of 3
$ data :List of 1
  ..$ rv:List of 10
  .. ..$ formula      :Class 'formula' length 3 wz ~ 1
  .. .. .. ..- attr(*, ".Environment")=length 9 <environment>
  .. ..$ locations    :Class 'formula' length 2 ~x + y
  .. .. .. ..- attr(*, ".Environment")=length 9 <environment>
  .. ..$ data         :`data.frame':    31837 obs. of  3 variables:
  .. .. ..$ x : num [1:31837] 410683 410700 410720 410740 410324 ...
  .. .. ..$ y : num [1:31837] 43136 43126 43123 43125 42709 ...
  .. .. ..$ wz: num [1:31837] -101.1  -94.9  -93.3  -94.5   30.8 ...
  .. ..$ has.intercept: int 1
  .. ..$ beta         : num(0)
  .. ..$ nmax         : num 500
  .. ..$ maxdist      : num Inf
  .. ..$ dummy        : logi FALSE
  .. ..$ vfn          : int 1
  .. ..$ weights      : NULL
$ model:List of 1
  ..$ rv:Classes variogram.model  and `data.frame':     1 obs. of  9 
variables:
  .. ..$ model: Factor w/ 16 levels "Nug","Exp","Sph",..: 5
  .. ..$ psill: num 1652
  .. ..$ range: num 126
  .. ..$ kappa: num 1.75
  .. ..$ ang1 : num 0
  .. ..$ ang2 : num 0
  .. ..$ ang3 : num 0
  .. ..$ anis1: num 1
  .. ..$ anis2: num 1
  .. ..- attr(*, "singular")= logi FALSE
$ set  :List of 1
  ..$ average: num 1
- attr(*, "class")= chr [1:2] "gstat" "list"

>str(new)
str(new)
`data.frame':   580176 obs. of  3 variables:
$ x  : num  402292 402302 402312 402322 402332 ...
$ y  : num  43212 43212 43212 43212 43212 ...
$ rok: num  NA NA NA NA NA NA NA NA NA NA ...

>k<-predict.gstat(g,new=new,mask=new$rok)
Error in gstat.load.set(object$set) : error occured when parsing command: 
set average = 1;


If I do not set average=1 I continue getting the singular matrix error.

I see only one solution for this problem. That is o get rid if duplicate 
data in
some other way. As I am among the beginners in R and I do not speak other
programming languages either, I still did not find a successful way to krige
this data with a matern model varigram (which in my opinion suites best).

I also tried with the independent version of Gstat (2.4.2 if I remember
correctly) in combination with GRASS but seems that matern is not 
implemented in
it. Is that correct?

I am not a master of geostatistics either. Is there some other way to fit an 
S
shaped experimental variogram. Gaussian model would not fit that good, but 
at
least is an approximation.

thanks, Miha Staut




More information about the R-help mailing list