[R-sig-Geo] 'LDLfactor' error in 'krige' function
Edzer Pebesma
edzer.pebesma at uni-muenster.de
Mon Nov 16 17:14:49 CET 2009
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?
--
Edzer
Mauricio Zambrano wrote:
> Dear List,
>
> During some OK interpolations of daily precipitation, with the
> 'automap' library, I got the following error:
>
>
> [using ordinary kriging]
> "chfactor.c", line 130: singular matrix in function LDLfactor()
> Error en predict.gstat(g, newdata = newdata, block = block, nsim = nsim, :
> LDLfactor
>
>
> The code I'm using works fine for other days, so I assume that the
> distance between the measurement points is no the problem. When
> looking at the data that rose the error, I realized that all the
> measured values were equal to zero (I can not skip those days in which
> all the measured points have the same value in advance, because the
> measured value in those points change with time).
>
> According to a traceback that is given below, it seems that the cause
> is in the 'predict.gstat' function of the 'gstat' package.
>
> The same error can be risen with:
>
> # Data preparation
> data(meuse)
> coordinates(meuse) =~ x+y
> data(meuse.grid)
> gridded(meuse.grid) =~ x+y
>
> meuse$zinc <- meuse$zinc*0
> meuse$zinc
>
> # Ordinary kriging, no new_data object
> kriging_result = autoKrige(zinc~1, meuse)
>
>
> traceback()
> 6: .Call("gstat_predict", as.integer(nrow(as.matrix(new.X))),
> as.double(as.vector(raw$locations)),
> as.vector(new.X), as.integer(block.cols), as.vector(block),
> as.vector(bl_weights), as.integer(nsim), as.integer(BLUE))
> 5: predict.gstat(g, newdata = newdata, block = block, nsim = nsim,
> indicators = indicators, na.action = na.action, debug.level =
> debug.level)
> 4: .local(formula, locations, ...)
> 3: krige(formula, input_data, new_data, variogram_object$var_model,
> block = block, ...)
> 2: krige(formula, input_data, new_data, variogram_object$var_model,
> block = block, ...)
> 1: autoKrige(zinc ~ 1, meuse)
>
>
> I would really appreciate any hint about the possible reason of this
> error and if it could be overcome in some way.
>
>
> Thanks in advance for any help.
>
>
> Mauricio
>
--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
http://www.springer.com/978-0-387-78170-9 e.pebesma at wwu.de
More information about the R-sig-Geo
mailing list