Description Usage Arguments Details Value Author(s) References See Also Examples
A spatial vine copula is used to predict values at unobserved locations conditioned on observations of a local neighbourhood.
1 2 | spCopPredict(predNeigh, dataLocs, predLocs, spVine, margin,
method = "quantile", p = 0.5, ...)
|
predNeigh |
the |
dataLocs |
some |
predLocs |
some |
spVine |
the spatial vine copula describing the spatial dependence |
margin |
the marginal distribution as a list with entries named "d" for the density function (PDF), "q" for the quantile function and "p" for cumulative distribution function (CDF). |
method |
one of |
p |
only used for the quantile predictor indicating the desired fraction the quantile should correspond to. |
... |
Further arguments passed to |
Predictions are done based on condSpVine
through numerical integration/optimisation.
A Spatial
object of the same type as provided in the slot locations
of the argument predNeigh
.
Benedikt Graeler
Graeler, B. and E. Pebesma (2011): The pair-copula construction for spatial data: a new approach to model spatial dependency. Procedia Environmental Sciences (Vol. 7, pp. 206 - 211), Elsevier.
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 36 37 38 39 40 41 | library("sp")
library("VineCopula")
data("meuse.grid")
coordinates(meuse.grid) <- ~x+y
gridded(meuse.grid) <- TRUE
data("meuse")
coordinates(meuse) <- ~x+y
data("spCopDemo")
calcKTauPol <- fitCorFun(bins, degree=3)
spCop <- spCopula(components=list(normalCopula(), tCopula(),
frankCopula(), normalCopula(), claytonCopula(),
claytonCopula(), claytonCopula(), claytonCopula(),
claytonCopula(), indepCopula()),
distances=bins$meanDists,
spDepFun=calcKTauPol, unit="m")
spVineCop <- spVineCopula(spCop, vineCopula(4L))
meuse$rtZinc <- rank(meuse$zinc)/(length(meuse)+1)
dataLocs <- meuse[1:4,]
predLocs <- meuse.grid[c(9:12,16:19,25:28),]
predMeuseNeigh <- getNeighbours(dataLocs, predLocs,
5, "rtZinc", prediction=TRUE, min.dist=-1)
qMar <- function(x) {
qlnorm(x,mean(log(meuse$zinc)),sd(log(meuse$zinc)))
}
predMedian <- spCopPredict(predMeuseNeigh, dataLocs, predLocs,
spVineCop, list(q=qMar), "quantile", p=0.5)
## Not run:
spplot(predMedian, "quantile.0.5",
sp.layout=list("sp.points", meuse, pch = 19, col = "red"),
col.regions=bpy.colors())
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.