[R-sig-Geo] gstat fails with valid (?) LMC
Tom Gottfried
tom.gottfried at tum.de
Fri Mar 16 20:03:25 CET 2012
Dear list(en)ers,
by the way I discovered the following behaviour: fitting the LMC as in
the example below and then using it for prediction raises an error
telling the coefficient matrix is not positive definite. However,
cauchy-schwartz inequalities are met (which should suffice for the 2 by
2 coefficient matrix [1]). Sorry if this is only due to me having not
done my homework, but isn't positive *semi*-definiteness of the
coefficient matrix a sufficient condition for a valid LMC? Setting
nocheck=1 does not end up with negative prediction variances in this
example, too.
Thanks for any hint that can adjust me on this topic!
Tom
library(gstat)
data(meuse)
coordinates(meuse) <- ~x+y
data(meuse.grid)
coordinates(meuse.grid) <- ~x+y
g <- gstat(NULL, "z", zinc~1, meuse)
g <- gstat(g, "dist", I(dist*1000)~1, meuse)
variog.g <- variogram(g)
g <- fit.lmc(variog.g, g, vgm(100000, "Gau", 500, 1000))
predict(g, newdata=meuse.grid)
# raises error ("coefficient matrix not positive definite") but ...
all(abs(g$model$z.dist$psill)<=sqrt(g$model$z$psill*g$model$dist$psill))
# ... shows that cauchy-schwartz inequalities are met ...
all(abs(g$model$z.dist$psill)<sqrt(g$model$z$psill*g$model$dist$psill))
# though the coefficient matrix seems to be "only" positive
#semi-definite, no negative variances occur:
g <- gstat(NULL, "z", zinc~1, meuse, set=list(nocheck=1))
g <- gstat(g, "dist", I(dist*1000)~1, meuse)
variog.g <- variogram(g)
g <- fit.lmc(variog.g, g, vgm(100000, "Gau", 500, 1000))
pred <- predict(g, newdata=meuse.grid)
any(c(pred$z.var, pred$dist.var)<0)
[1]
@article{goovaerts_controversial_1994,
title = {On a controversial method for modeling a coregionalization},
volume = {26},
doi = {10.1007/BF02082763},
number = {2},
journal = {Mathematical Geology},
author = {Goovaerts, P.},
year = {1994},
pages = {197--204}
}
--
Technische Universität München
Department für Pflanzenwissenschaften
Lehrstuhl für Grünlandlehre
Alte Akademie 12
85350 Freising / Germany
Phone: ++49 (0)8161 715324
Fax: ++49 (0)8161 713243
email: tom.gottfried at wzw.tum.de
http://www.wzw.tum.de/gruenland
More information about the R-sig-Geo
mailing list