Re: [R-sig-Geo] 'LDLfactor' error in 'krige' function

2009-11-17 Thread Paul Hiemstra
Edzer Pebesma wrote: My guess is that from constant data, the (co)variance is constant and zero, so the covariance matrix cannot be decomposed (hence: LDLfactor errors). Is this a case that autokrige should catch? I added a check in autoKrige. The output for the example below is now:

[R-sig-Geo] Unconditional simulation

2009-11-17 Thread Nick Hamm
Dear all I want to simulate a spatially-correlated random field which follows a uniform rather than than Gaussian distribution. Does anybody know a straight-forward way to do this? Nick ___ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch

Re: [R-sig-Geo] 'LDLfactor' error in 'krige' function

2009-11-17 Thread Mauricio Zambrano
Thank you Edzer for giving a hint about the meaning of the 'LDLfactor' error, and thank you Paul for adding a check to the 'autoKrige' function. Kind regards, Mauricio --  Ph.D. Candidate, University of Trento Dept. of Civil and Env. Engineering

Re: [R-sig-Geo] Unconditional simulation

2009-11-17 Thread Tomislav Hengl
Hi Nick, Very interesting problem. At first thought, I imagined that you just want to simulate noise ;) In the geoR package (http://leg.ufpr.br/geoR/) there is a function to simulate Gaussian Random Fields (uses actually RandomFields package) using various models e.g.: library(geoR)

Re: [R-sig-Geo] 'LDLfactor' error in 'krige' function

2009-11-17 Thread Tomislav Hengl
Hi Paul, Edzer, I understand why the singular matrix problem happens and I know that there is not really a mathematical solution around it: x - matrix(runif(100), nrow=10) x.i - solve(x) str(x.i) num [1:10, 1:10] 0.8191 -1.0293 0.0826 1.068 -0.2106 ... # add a 'singular' column x[,1:10] -

Re: [R-sig-Geo] AI-GEOSTATS: Unconditional simulation

2009-11-17 Thread seba
Hi Nick One way is to use simulated annealing (see gslib) putting as objective function your desired variogram and histogram. (but I guess that by means of some data transformation you can do that with a simple sequential gaussian simulation approach) Bye Sebas At 10.06 17/11/2009, Nick Hamm

Re: [R-sig-Geo] Spatial interpolation of river network observations

2009-11-17 Thread Tomislav Hengl
Hi Ultrich, Facundo Muñoz apparently made a GRASS function to derive distances along streams: https://stat.ethz.ch/pipermail/r-sig-geo/2009-November/006851.html 17 observations only? That is really tight for any geostatistical analysis (on top, you want to do 3 dimensions!). I would instead

Re: [R-sig-Geo] 'LDLfactor' error in 'krige' function

2009-11-17 Thread Mauricio Zambrano
Dear Paul and Edzer, 2009/11/17 Tomislav Hengl he...@spatial-analyst.net: Hi Paul, Edzer, I understand why the singular matrix problem happens and I know that there is not really a mathematical solution around it: x - matrix(runif(100), nrow=10) x.i - solve(x) str(x.i)  num [1:10,

Re: [R-sig-Geo] 'LDLfactor' error in 'krige' function

2009-11-17 Thread Edzer Pebesma
Tom, you can already do this: library(gstat) data(meuse) coordinates(meuse)=~x+y data(meuse.grid) gridded(meuse.grid)=~x+y meuse=meuse[c(1,1:155),] # replicate first observation pr1 = predict(zinc~1,meuse,meuse.grid,vgm(1, Exp, 300)) # will break # the following will generate NA's for cells where

[R-sig-Geo] Random number seed and unconditional simulation

2009-11-17 Thread Nick Hamm
Dear all I have a question about the random number seeding in R. I want to simulate several random fields. Each RF should have zero nugget, the same sill but a different range (e.g., 100x100, range: 1 - 30). Let's stick with the Gaussian case for now. I use the following code

Re: [R-sig-Geo] 'LDLfactor' error in 'krige' function

2009-11-17 Thread Edzer Pebesma
I just want to point out that krige has no problem with constant observations, as long as it is provided with a valid (i.e. semi negative definite, or something like that) variogram model. The problem is to automatically fit such a function from data that are constant, as they have zero

Re: [R-sig-Geo] 'LDLfactor' error in 'krige' function

2009-11-17 Thread Tomislav Hengl
Hi Edzer, Thanks for the info. I was not aware that I can simply set cn_max and the predictions will not break (and I still do read the gstat manual). I guess that this is then the solution to our problem. For me it enough to generate a map with NA's, then zoom into map to see where the

Re: [R-sig-Geo] limiting the number of variogram models in intamap

2009-11-17 Thread Jon Olav Skoien
Hi, This is not possible in the version on CRAN now, but has been changed in the development version that you can find on one of the links below (depending on platform), should be on CRAN soon. http://www.intamap.org/downloads/intamap_1.3-1.zip

[R-sig-Geo] Kriging with NA values

2009-11-17 Thread Tobin Cara
Hello, I am taking the log of precipitation values and therefore many are now NA values. I want to continue to krig my precipitation matrix. Is there a way to ignore these values with kriging. My attempt with is.nan still gives: Erreur : dimensions do not match: locations 105 and data 12

[R-sig-Geo] neighborhood analysis on patch systems

2009-11-17 Thread Horacio Samaniego
I am wondering if anyone has gone through the trouble of establishing a neighborhood analysis on a set of polygon using the tools provided by spdep to analyse a set of points. In fact i'm still not sure that it makes sense. (¡I want to believe it does!) So far, I have been using the spdep

Re: [R-sig-Geo] Kriging with NA values

2009-11-17 Thread Robert J. Hijmans
If you are interpolating precipitation you probably should not ignore the zeros. If you want to log transform your values, perhaps you can use log(x+1) instead of log(x). Robert On Tue, Nov 17, 2009 at 10:43 AM, Tobin Cara cara.to...@epfl.ch wrote: Hello, I am taking the log of precipitation