covaprop-class {covatest} | R Documentation |
Class "covaprop"
Description
A function for testing some properties (symmetry, separability, type of non-separability) of spatio-temporal covariance functions and some classes of space-time covariance models
Usage
covaprop(cblock, cstat, nonseptype = NULL, sign.level = 0.05)
## S4 method for signature 'covaprop'
show(object)
Arguments
cblock |
object of class |
cstat |
object of class |
nonseptype |
integer, this argumet is required only for objects
( |
sign.level |
numeric, level of significance |
object |
object of class |
Details
A message helps to decide for either reject the null hypothesis in favor of the alternative or not reject it, at a specific level of significance
The test on full symmetry (when the slot
@typetest
is equal to"sym"
) represents the first step for the selection of a suitable class of spatio-temporal covariance functions. According to the definition of full symmetry, the null hypothesis to be tested is \[H_0: C(\mathbf{h},u) - C(\mathbf{h},-u)=0\]The test of separability (when the slot
@typetest
is equal to"sep"
) represents the second step of the testing procedure. According to the definition of separability, the null hypothesis to be tested is \[H_0: C(\mathbf{h}, u)/C(\mathbf{h}, 0) - C(\mathbf{0}, u)/C(\mathbf{0},0)=0\]The test on the type of non separability (when the slot
@typetest
is equal to"tnSep"
) represents the third step for the selection of a suitable class of space-time covariance functions. According to the definition of type of non separability, the null hypothesis to be tested is that the non separability is non negative \[H_0: C(\mathbf{h},u)/C(\mathbf{h},0) - C(\mathbf{0},u)/C(\mathbf{0},0) > 0\] or \[H_0: C(\mathbf{h},u)/C(\mathbf{h},0) - C(\mathbf{0},u)/C(\mathbf{0},0) < 0\] if the null hypothesis to test is that the non separability is non positiveIf the slot
@typetest
is equal to"productSum"
"intProduct"
or"gneiting"
, the goodness of a specific class of space-time covariance function will be tested. For this testing procedure the generic null hypothesis is: \[H_0: \mathbf{Af(G)}=0\]
For the analytic expression of each test statistic and its probability
distribution see Cappello et al. (2018). In the same contribution the
different f(G)
are given for each test to be computed.
Slots
test.statistics
numeric, the value of the test statistic
p.value
numeric, the lower tail p value of the test statistic
df
numeric, the degrees of freedom, if available
typetest
character, contains the code of the test to be performed
Note
A stop occurs if the type of test set in
cblock
is not consistent with the type of test set incstat
.If the message
Error in solve.default(): system is computationally singular:...
appears, the inverse of the matrix involved in the test statistic in (9) of Cappello et al. (2020) is computationally singular. In order to overcome this numerical problem often related to the tests on the models, the objectstpairs
(of classcouples
) has to be modified. In particular, by considering that for each spatial triplet and each temporal triplet 6 contrasts can be defined, it is advisable to adopt one of the following options: 1) set equal to zero one of the highest temporal lags, for each spatial and each temporal triplet, through the specificsetzero
method, 2) substitute triplets associated with long spatial or temporal distances with others characterized by lower distances. Then, the user has to run againblocks
,covablocks
,covastatM
andcovaprop
. The above error message also occurs if there are at least two spatial triplets, where:two couples are replicated;
one couple is replicated.
In such cases it is enough to set equal to zero one temporal lag for each temporal triplet associated to the couples involved in the replications.
References
Cappello, C., De Iaco, S., Posa, D., 2018, Testing the type of non-separability and some classes of space-time covariance function models. Stochastic Environmental Research and Risk Assessment, 32 17–35
Cappello, C., De Iaco, S., Posa, D., 2020, covatest: An R Package for Selecting a Class of Space-Time Covariance Functions. Journal of Statistical Software, 94(1) 1–42.
De Iaco, S., Palma, M., Posa, D., 2016. A general procedure for selecting a class of fully symmetric space-time covariance functions. Environmentrics, 27(4) 212–224.
Li, B., Genton, M.G., Sherman, M., 2007, A nonparametric assessment of properties of spacetime covariance functions. Journal of the American Statistical Association, 102 736–744.
See Also
Examples
# --start define the STFDF rr_13-- #
library(sp)
library(spacetime)
#library(gstat)
data(air)
ls()
if (!exists("rural")) rural = STFDF(stations, dates, data.frame(PM10 =
as.vector(air)))
rr = rural[,"2005::2010"]
unsel = which(apply(as(rr, "xts"), 2, function(x) all(is.na(x))))
r5to10 = rr[-unsel,]
rr_13 <- r5to10[c("DEHE046","DESN049","DETH026","DENW063","DETH061","DEBY047",
"DENW065","DEUB029","DENW068","DENI019","DEHE051","DERP016","DENI051"),
"2005::2006"]
# --end define the STFDF rr_13-- #
#--Example 1: test on symmetry--#
sel.staz.sym <- c("DERP016", "DENW065", "DEHE051", "DETH026", "DENW063", "DENI019",
"DENW068", "DEHE046", "DEUB029", "DEBY047", "DETH061", "DESN049")
sp.couples.in.sym <- matrix(data = c("DERP016", "DENW065", "DEHE051", "DETH026",
"DENW063", "DENI019", "DENW068", "DEHE046", "DEUB029", "DEBY047", "DETH061", "DESN049"),
ncol = 2, byrow = TRUE)
t.couples.in.sym <- c(1, 2)
couples.sym <- couples(sel.staz = sel.staz.sym, sp.couples.in = sp.couples.in.sym,
t.couples.in = t.couples.in.sym, typetest = "sym", typecode = character())
block.sym <- blocks(lb = 40, ls = 10, matdata = rr_13, pardata1 = 1, pardata2 = 1,
stpairs = couples.sym)
covabl.sym <- covablocks(stblocks = block.sym, stpairs = couples.sym, typetest = "sym")
covast.sym <- covastat(matdata = rr_13, pardata1 = 1, pardata2 = 1,
stpairs = couples.sym, typetest = "sym")
test.sym <- covaprop(cblock = covabl.sym, cstat = covast.sym, nonseptype = NULL,
sign.level = 0.05)
#--Example 2: test on the Gneiting model--#
sel.staz.mod <- c("DETH061", "DEBY047", "DEHE051", "DEUB029", "DENI019",
"DENI051", "DETH026", "DESN049")
sp.couples.in.mod <- matrix(data = c("DETH061", "DEBY047",
"DEHE051", "DEUB029",
"DENI019", "DENI051",
"DEHE051", "DETH026",
"DEBY047", "DESN049",
"DETH026", "DETH061"),
ncol = 2, byrow = TRUE)
t.couples.in.mod <- c(1, 2, 3)
couples.mod <- couples(sel.staz = sel.staz.mod,
sp.couples.in = sp.couples.in.mod, t.couples.in = t.couples.in.mod,
typetest = "gneiting", typecode = character())
zero.index <- matrix(data = c(3, 7, 6, 7), ncol = 2, byrow = TRUE)
couples.mod <- setzero(x = couples.mod, zero = FALSE, index = zero.index, value = 0)
block.mod <- blocks(lb = 60, ls = 10, matdata = rr_13, pardata1 = 1,
pardata2 = 1, stpairs = couples.mod)
covabl.gn <- covablocks(stblocks = block.mod, stpairs = couples.mod,
typetest = "gneiting")
covast.gn <- covastatM(matdata = rr_13, pardata1 = 1, pardata2 = 1,
stpairs = couples.mod, typetest = "gneiting", beta.data = seq(0.5, 1, by=0.1))
test.gn <- covaprop(cblock = covabl.gn, cstat = covast.gn, nonseptype = NULL,
sign.level = 0.05)
### method for covaprop
#1. show
test.sym