stCopPredict: Spatio-Temporal Prediction based on a Spatio-Temporal Vine...

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

View source: R/stVineCopula.R

Description

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

Usage

1
stCopPredict(predNeigh, dataST, predST, stVine, margin, method = "quantile", p = 0.5, ...)

Arguments

predNeigh

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

dataST

the same ST object as used in the generation of predNeigh providing the data for interpolation.

predST

the same ST object as used in the generation of predNeigh providing the prediction locations for interpolation.

stVine

the spatio-temporal vine copula describing the spatio-temporal 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 condStVine through numerical integration/optimisation.

Value

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

Author(s)

Benedikt Graeler

See Also

condStVine and spCopPredict for the spatial version.

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
library("sp")
library("spacetime")

spCopT0 <- spCopula(components=list(claytonCopula(8), claytonCopula(4), 
                                    claytonCopula(2), claytonCopula(1),
                                    claytonCopula(0.5), indepCopula()),
                    distances=c(0,100,200,300,400,500),
                    unit="km")
spCopT1 <- spCopula(components=list(claytonCopula(4), claytonCopula(2), 
                                    claytonCopula(1), claytonCopula(0.5),
                                    indepCopula()),
                    distances=c(0,100,200,300,400),
                    unit="km")

stCop <- stCopula(components=list(spCopT0, spCopT1),
                  tlags=-(0:1))

stVineCop <- stVineCopula(stCop, vineCopula(4L))

sp <- SpatialPoints(matrix(c(181000,181100,333500,333600),2))
time <- as.POSIXct("2014-03-18")+60*60*24*c(0,1,2)
data <- data.frame(var1=runif(6))

stData <- STFDF(sp, time, data)
stQuerry <- STF(SpatialPoints(matrix(c(181000,181200,333600,333600),2)),
                time[2:3])

stNeigh <- getStNeighbours(stData=stData, ST=stQuerry, prediction=TRUE, spSize=3,
                           tlags=-(0:1))

stCopPredict(stNeigh, stData, stQuerry, stVineCop, list(q=qunif), "quantile", 0.5)

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