spCopPredict: spatial prediction based on a spatial vine copula

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/spVineCopula.R

Description

A spatial vine copula is used to predict values at unobserved locations conditioned on observations of a local neighbourhood.

Usage

1
2
spCopPredict(predNeigh, dataLocs, predLocs, spVine, margin,
             method = "quantile", p = 0.5, ...)

Arguments

predNeigh

the neighbourhood used for prediction, its slot prediction must be TRUE.

dataLocs

some Spatial class providing the data for the prediction.

predLocs

some Spatial class providing the prediction locations.

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 "quantile" or "expectation" denoting the type of predictor.

p

only used for the quantile predictor indicating the desired fraction the quantile should correspond to.

...

Further arguments passed to integrate.

Details

Predictions are done based on condSpVine through numerical integration/optimisation.

Value

A Spatial object of the same type as provided in the slot locations of the argument predNeigh.

Author(s)

Benedikt Graeler

References

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.

See Also

condSpVine

Examples

 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")

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)

BenGraeler/spcopula documentation built on Nov. 20, 2020, 4:07 p.m.