gstat-info  

Re: singularity problem

Miha STAUT
Thu, 25 Sep 2003 04:36:04 -0700

Miha STAUT wrote:

Time ago I posted a problem about a singularity problem which I suspected was due to duplicate data. Well mr. Pebsma gave me a hint on the new functionality of gstat-R (zerodist) which would eliminate the redundant points. But as usually there was a problem. The new function did not find any duplicate points. I was doing an ordinary krigging with around 3500 points on a 900 by 600 grid. Any idea?



Did you use a Gaussian variogram model? -- Edzer


No I used the matern model, but I can try to fit a gaussian model or some other model nested into a gaussian model, if you think this could be the solution.

Miha, the Matern model is a family rather than a model, as it includes the Gaussian and exponential variograms as special cases. The smoothness parameters determines this -- which value did you use?

Does it help if you add a (small) nugget to the variogram?
--
Edzer


Hi,


I tried with a combination of "Gau" and "Exp", what really seams to fit quite
good. Thanks for the hint Edzer :) . But it still reports the same
error (singular matrix). I must correct myself about my data. The size of
the image I want to interpolate is 612 by 948 and I have 31837 observations and
not 3500 as I erroneously mentioned in the yesterday mail.


str(g.gau2) #my gstat object
List of 2
$ data :List of 1
..$ var1:List of 11
.. ..$ formula :Class 'formula' length 3 wz ~ 1
.. .. .. ..- attr(*, ".Environment")=length 12 <environment>
.. ..$ locations :Class 'formula' length 2 ~x + y
.. .. .. ..- attr(*, ".Environment")=length 12 <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 Inf
.. ..$ nmin : num 0
.. ..$ maxdist : num 800
.. ..$ dummy : logi FALSE
.. ..$ vfn : int 1
.. ..$ weights : NULL
$ model:List of 1
..$ var1:Classes variogram.model and `data.frame': 2 obs. of 9 variables:
.. ..$ model: Factor w/ 16 levels "Nug","Exp","Sph",..: 4 2
.. ..$ psill: num [1:2] 1141 318485
.. ..$ range: num [1:2] 242 478136
.. ..$ kappa: num [1:2] 0.5 0.5
.. ..$ ang1 : num [1:2] 0 0
.. ..$ ang2 : num [1:2] 0 0
.. ..$ ang3 : num [1:2] 0 0
.. ..$ anis1: num [1:2] 1 1
.. ..$ anis2: num [1:2] 1 1
.. ..- attr(*, "singular")= logi TRUE
- attr(*, "class")= chr [1:2] "gstat" "list"


str(new) #the new predictions data frame with NAs outside and 5 inside the prediction region.
`data.frame':   580176 obs. of  3 variables:
$ x : num  402292 402302 402312 402322 402332 ...
$ y : num  43212 43212 43212 43212 43212 ...
$ wz: num  NA NA NA NA NA NA NA NA NA NA ...

kri.ge<-predict.gstat(obj=g.gau2,new=new)
[using ordinary kriging]
"chfactor.c", line 130: singular matrix in function LDLfactor()
...

Thanks for the patience, Miha Staut

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail