Description Usage Arguments Examples
All the arguments work as in krige.conv, except the
additional arguments dd.dists.mat and dl.dists.mat, which take
matrices of distances between observation locations and between observations
and prediction locations respectively
1 2 | krige.conv(geodata, coords = geodata$coords, data = geodata$data, locations,
borders, krige, output, dd.dists.mat, dl.dists.mat)
|
geodata |
a list containing elements |
coords |
an n x 2 matrix or data-frame with the 2-D
coordinates of the n data locations.
By default it takes the
component |
data |
a vector with n data values. By default it takes the
component |
locations |
an N x 2 matrix or data-frame with the 2-D
coordinates of the N prediction locations, or a list for which
the first two components are used. Input is internally checked by the
function |
borders |
optional. By default reads the element |
krige |
a list defining the model components and the type of
kriging. It can take an output to a call to |
output |
a list specifying output options.
It can take an output to a call to |
dd.dists.mat |
n x n symmetric matrix with cost-based distances between observations |
dl.dists.mat |
m x n matrix with cost-based distances from each observation to each one of the m prediction locations |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## geodata structure with transformed covariates
data(noise)
if (require(sp)) {
covarnames=sapply(1:3, function(x) paste("d2TV", x, sep=""))
obs.df <- data.frame(Leq=obs$Leq,
1/(1+(as.data.frame(obs)[covarnames]/20)^2))
obs.gd <- as.geodata(cbind(coordinates(obs), obs.df),
data.col="Leq",
covar.col=c('d2TV1','d2TV2','d2TV3'))
trend=~d2TV1*(d2TV2+d2TV3)
loc1.df <- as.data.frame(1/(1+(as.data.frame(loc)[covarnames]/20)^2))
## fitting variogram models
vgmdl.std <- likfit(geodata = obs.gd, trend=trend,
ini = c(8,300), cov.model = "matern")
vgmdl.dmat <- likfit(geodata = obs.gd, trend=trend,
ini = c(8,300), cov.model = "matern",
dists.mat=dd.distmat)
# With trend, Euclidean distances
# NOTE: The Euclidean prediction is done with cost-based covariates
KC.std = krige.control(trend.d=trend,
trend.l=~loc1.df$d2TV1*(loc1.df$d2TV2+loc1.df$d2TV3),
obj.model=vgmdl.std)
kc1.std<-krige.conv(obs.gd,locations=coordinates(loc), krige=KC.std)
# With trend, Cost-based distances
KC = krige.control(trend.d=trend,
trend.l=~loc1.df$d2TV1*(loc1.df$d2TV2+loc1.df$d2TV3),
obj.model=vgmdl.dmat)
kc1<-krige.conv(obs.gd,locations=coordinates(loc), krige=KC,
dd.dists.mat=dd.distmat, dl.dists.mat=dl.distmat)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.