Dear all,
I am aiming to conduct glsm kriging using glsm.krige function (geoRglm
package).
I encounter a problem, which I have seen many times on the mailing list,
but nevertheless I can't figure out what goes wrong. Any pointers would be
great. Thanks, Olga
%%%%%%%%%%%%%%%%%%%%
pred<-NULL
krvar<-NULL
for (b in 1:11)){
tb.prdgrd<-subset(as.data.frame(prdgrd), tb==b)
geodata.prdgrd <- as.geodata(
obj = tb.prdgrd,
header=TRUE,
data.col=NULL,
data.name=NULL,
coords.col=c("x","y"),
covar.col= c("depth","mgs")
)
S.krige.simB <- glsm.krige(
mcmc.output=simFB,
locations = tb.prdgrd[,1:2],
trend.l = trend.spatial(trend=trendB, geodata.prdgrd),
output=output.glm.control(sim.predict=TRUE)
)
pred<-rbind(pred, data.frame(as.vector(S.krige.simB$predict)))
krvar<-rbind(krvar, data.frame(as.vector(S.krige.simB$krige.var)))
}
glsm.krige: Prediction for a generalised linear spatial model
Error in trend.spatial(trendB, geodata.prdgrd) :
trend elements not found
> head(geodata.prdgrd$covar)
depth mgs
122144 -27 134.5747
122145 -25 134.5676
122146 -35 134.5607
122404 -408 134.6538
122405 -98 134.6461
122406 -26 134.6386
> trendB
~depth + I(depth^2) + mgs
--
View this message in context:
http://r.789695.n4.nabble.com/geoR-trend-spatial-tp4686694.html
Sent from the R help mailing list archive at Nabble.com.