covaprop-class: Class "covaprop"

covaprop-classR 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 \loadmathjax

Usage

covaprop(cblock, cstat, nonseptype = NULL, sign.level = 0.05)

## S4 method for signature 'covaprop'
show(object)

Arguments

cblock

object of class covablocks

cstat

object of class covastat or covastatM

nonseptype

integer, this argumet is required only for objects (cblock and cstat) defined to perform the type of non separability test, otherwise it has to be set equal to NULL (default choice). Set nonseptype=0 for testing the null hypothesis that the non separability is non positive; set nonseptype=1 for testing the null hypothesis that the non separability is non negative

sign.level

numeric, level of significance

object

object of class covaprop for method show

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 \mjdeqnH_0: C(\mathbfh,u) - C(\mathbfh,-u)=0H_0: C(h,u) - C(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 \mjdeqnH_0: C(\mathbfh, u)/C(\mathbfh, 0) - C(\mathbf0, u)/C(\mathbf0,0)=0H_0: C(h, u)/C(h, 0) - C(0, u)/C(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 \mjdeqnH_0: C(\mathbfh,u)/C(\mathbfh,0) - C(\mathbf0,u)/C(\mathbf0,0) > 0H_0: C(h,u)/C(h,0) - C(0,u)/C(0,0) > 0 or \mjdeqnH_0: C(\mathbfh,u)/C(\mathbfh,0) - C(\mathbf0,u)/C(\mathbf0,0) < 0H_0: C(h,u)/C(h,0) - C(0,u)/C(0,0) < 0 if the null hypothesis to test is that the non separability is non positive

  • If 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: \mjdeqnH_0: \mathbfAf(G)=0H_0: 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 in cstat.

  • 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 object stpairs (of class couples) 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 specific setzero method, 2) substitute triplets associated with long spatial or temporal distances with others characterized by lower distances. Then, the user has to run again blocks, covablocks, covastatM and covaprop. 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

couples

blocks

covablocks

covastat

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


covatest documentation built on July 9, 2023, 5:29 p.m.