# NOT RUN {
library(plot3D)
## specify grid of spatial and temporal lags
d <- 31
st <- expand.grid(0:(d-1),
0:(d-1))
## get the STCS
wc <- stcs("clayton",
t = st[, 1],
s = st[, 2],
scfid = 'weibull',
tcfid = 'weibull',
copulaarg = 2,
scfarg = list(scale = 20,
shape = 0.7),
tcfarg = list(scale = 1.1,
shape = 0.8))
g14 <- stcs("gneiting14",
t = st[, 1],
s = st[, 2],
a = 1/50,
c = 1/10,
alpha = 1,
beta = 1,
gamma = 0.5,
tau = 1)
g16 <- stcs("gneiting16",
t = st[, 1],
s = st[, 2],
a = 1/50,
c = 1/10,
alpha = 1,
beta = 1,
nu = 0.5,
tau = 1)
## note: for nu = 0.5 stcfgneiting16 is equivalent to
## stcfgneiting14 with gamma = 0.5
## visualize the STCS
wc.m <- matrix(wc,
nrow = d)
persp3D(z = wc.m, x = 1: nrow(wc.m), y = 1:ncol(wc.m),
expand = 1, main = "", scale = TRUE, facets = TRUE,
xlab="Time lag", ylab = "Distance", zlab = "STCF",
colkey = list(side = 4, length = 0.5), phi = 20, theta = 120,
resfac = 5, col= gg2.col(100))
g14.m <- matrix(g14,
nrow = d)
persp3D(z = g14.m, x = 1: nrow(wc.m), y = 1:ncol(wc.m),
expand = 1, main = "", scale = TRUE, facets = TRUE,
xlab="Time lag", ylab = "Distance", zlab = "STCF",
colkey = list(side = 4, length = 0.5), phi = 20, theta = 120,
resfac = 5, col= gg2.col(100))
# }
Run the code above in your browser using DataLab