Hi All,
At many monitoring locations we've taken two air quality samples. Rather than
simply average these values, I want to krige all the observations and
accommodate the different values at coincident locations by including
measurement error in the nugget.
When I run the code based on geoR, though, I get an error that the coincident
locations may "cause crashes in some matrices operations" and I'm wondering if
someone could shed light on the issue -- is this what you'd expect with
coincident locations? Is the code below incorrectly specified?
Thank you, Zev
# ----set up the modelling and validation samples as geodata
model.a<-as.geodata(samples.hull, coords.col=c("x", "y"),
data.col="no2.ppb",
covar.col=c("phase", "traffic) )
validation.a<-as.geodata(samples.val, coords.col=c("x", "y"),
data.col="no2.ppb",
covar.col=c("phase", "traffic) )
#-----use the modeling samples to estimate the variogram
myvario<-variog(model.a, option="bin",
breaks=seq(1,10000, by=300), maxdist=10000,
trend=~phase+traffic)
#----- fit the variogram
myfit<-variofit(myvario, ini.cov.pars=c(15, 1000),
cov.model="spherical")
#----- set kriging to include a trend AND split
#----- the nugget into micro and measurement
KC<-krige.control(type="ok", obj.model=myfit, micro=myfit$nugget/2,
trend.d=trend.spatial(~phase+traffic, model.a),
trend.l=trend.spatial(~phase+traffic, validation.a))
# ----krige
mykrige<-krige.conv(model.a,locations=validation.a$coords,
krige=KC, output=output.control(signal=F)
# here is the warning
krige.conv: model with covariates matrix provided by the user
krige.conv: Kriging performed using global neighbourhood
Warning message:
Two or more pairs of data at coincident (or very close) locations.
This may cause crashes in some matrices operations.
in: varcov.spatial(coords = coords, cov.model = cov.model, kappa = kappa,
geoR nugget and coincident locations
3 messages · Zev Ross, Paulo Justiniano Ribeiro Jr
Dear Zev The warning is really just a warning and not an error... the point is you may need some data manipulation in order to run the analysis you anty. Firts of all the fact you have duplicated information in (some) locations may give you the opportunity to split you negget parameter estimate in measurement error and micro-scale variation. One possibility to compute the former using the duplicated data (locations as "blocks" and subtract this from the nugget. The difference givesyouy the latter. You can them use thei information when kriging with krige.conv() hope this helps, otherwise contact me again for further details best Paulo Justiniano Ribeiro Jr LEG (Laborat?rio de Estat?stica e Geoinforma??o) Universidade Federal do Paran? Caixa Postal 19.081 CEP 81.531-990 Curitiba, PR - Brasil Tel: (+55) 41 3361 3573 Fax: (+55) 41 3361 3141 e-mail: paulojus AT ufpr br http://www.leg.ufpr.br/~paulojus
On Tue, 30 Oct 2007, Zev Ross wrote:
Hi All,
At many monitoring locations we've taken two air quality samples. Rather than
simply average these values, I want to krige all the observations and
accommodate the different values at coincident locations by including
measurement error in the nugget.
When I run the code based on geoR, though, I get an error that the coincident
locations may "cause crashes in some matrices operations" and I'm wondering if
someone could shed light on the issue -- is this what you'd expect with
coincident locations? Is the code below incorrectly specified?
Thank you, Zev
# ----set up the modelling and validation samples as geodata
model.a<-as.geodata(samples.hull, coords.col=c("x", "y"),
data.col="no2.ppb",
covar.col=c("phase", "traffic) )
validation.a<-as.geodata(samples.val, coords.col=c("x", "y"),
data.col="no2.ppb",
covar.col=c("phase", "traffic) )
#-----use the modeling samples to estimate the variogram
myvario<-variog(model.a, option="bin",
breaks=seq(1,10000, by=300), maxdist=10000,
trend=~phase+traffic)
#----- fit the variogram
myfit<-variofit(myvario, ini.cov.pars=c(15, 1000),
cov.model="spherical")
#----- set kriging to include a trend AND split
#----- the nugget into micro and measurement
KC<-krige.control(type="ok", obj.model=myfit, micro=myfit$nugget/2,
trend.d=trend.spatial(~phase+traffic, model.a),
trend.l=trend.spatial(~phase+traffic, validation.a))
# ----krige
mykrige<-krige.conv(model.a,locations=validation.a$coords,
krige=KC, output=output.control(signal=F)
# here is the warning
krige.conv: model with covariates matrix provided by the user
krige.conv: Kriging performed using global neighbourhood
Warning message:
Two or more pairs of data at coincident (or very close) locations.
This may cause crashes in some matrices operations.
in: varcov.spatial(coords = coords, cov.model = cov.model, kappa = kappa,
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
An HTML attachment was scrubbed... URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20071030/366c0462/attachment.html>