[R-sig-Geo] geoR: krigeing, predict on other coordinates with a parametric trend
Sara Kleyer
sara.kleyer at uni-bamberg.de
Wed Sep 14 15:03:51 CEST 2011
Dear list,
there are two datasets: the data "geo" is a geodata-set including,
"data", covariates and coordinates. The second dataset "fehlcord" is a
dataset including 2 columns for the coordinates and additional columns
for covariates.
I want to use kriging.conv to estimate on the "geo"-dataset and predict
on the locations of the "fehlcord" dataset. Additionally, I want to use
the covariates for a parametric trend.
This is the syntax I use:
#definition of the trend, I am interested in:
trend1<-trend.spatial("1st", geo,
add=~covariate$bauland+covariate$baulandsq+covariate$ostw+covariate$tour+covariate$alq)
#estimate the model
neu<-likfit(geo, coords=geo$coords, data=geo$data,
ini.cov.pars=c(50,9),trend=trend )
kri.set<-krige.control(type.krige="ok", trend.d=~trend1,
trend.l=~trend1, obj.model=neu)
#predict on the other dataset
schatz<-krige.conv(geo, locations=fehlcord, krige=kri.set)
R returns, that there is a mistake because:
"in krige.conv(geo, locations = fehlcord, krige = kri.set) :
locations and trend.l have incompatible sizes"
and in addition:
"In .check.locations(locations) :
locations provided with a matrix or data-frame with more than 2
columns. Only the first two columns used as coordinates"
I also tried to define "trend.l" by the dataset "fehlcord" but it did
not work, too.
How can I predict on new coordinates and use a parametric trend on the
covariates?
Thanks a lot for your help!
Sara
More information about the R-sig-Geo
mailing list