couples-class: Class "couples"

couples-classR Documentation

Class "couples"

Description

A class for spatial points and the corresponding temporal lags to be analyzed in order to test some covariance properties and some well known classes of space-time covariance functions models \loadmathjax

Usage

couples(
  sel.staz,
  sp.couples.in,
  t.couples.in,
  typetest = "sym",
  typecode = numeric()
)

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

## S4 method for signature 'couples'
x[i, by.row = FALSE, drop = FALSE]

## S4 method for signature 'couples'
summary(object)

Arguments

sel.staz

vector, the sequence of ID codes which denote the spatial points to be analyzed

sp.couples.in

two-column matrix: rows corresponding to the couples of different spatial points, chosen among the ones fixed in sel.staz argument, to be compared

t.couples.in

vector of only positive (negative) temporal lags to be analyzed. The corresponding negative (positive) temporal lags are included authomatically for typetest = "sym", "sep", "tnSep". If some temporal lags, corresponding to some couples of spatial points, are not required for the specific test, they can be set equal to zero, through the specific setzero method

typetest

character, set typetest = "sym" for symmetry test (default choice), typetest = "sep" for separability test, typetest = "tnSep" for type of non separability test, typetest = "productSum" for the test on the product-sum class of models, typetest = "intProduct" for the test on the integrated product class of models, typetest = "gneiting" for the test on the Gneiting class of models

typecode

type of object, i.e. numeric() or character(), specifies the type of codification of the spatial points in the data frame or in the STFDF/STSDF

object

object of class couples for methods show and summary

x

object of class couples for method extract

i

index specifying rows or columns of the slot @couples.st. Rows or columns depending on the logical parameter by.row to be set

by.row

logical, if TRUE rows of the slot @couples.st are selected (the temporal lags associated to the i-th spatial couple are given). If FALSE (the default) columns of the slot @couples.st are selected. In particular, the spatial couples associated to the i-th temporal lag (i >= 3, temporal lags are stored from the third column) are given

drop

logical, the argument is set, by default, equal to FALSE to preserve the structure of the object. It is advisable not to change this option

Details

It is important to point out that:

  • both positive and negative temporal lags are automatically considered in the slot @couples.st and @tl.couples for symmetry test (typetest = "sym"), separability test (typetest = "sep") and type of non separability tests (typetest = "tnSep"). If the symmetry hyphotesis has not been rejected, only positive temporal lags might be considered for the test on separability and type of non separability (typetest = "sep" and typetest = "tnSep"), hence the specific setzero method must be used to set the negative temporal lags equal to zero

  • for typetest = "tnSep" the temporal lags should be chosen according to the results of the sample non separability ratios, plotted through a boxplot classified for temporal lags (see sepindex for more details)

  • for model tests (typetest equal to "productSum", "intProduct" and "gneiting"), the number of analyzed spatial points must be used to create at least 3 spatial couples or multiple of 3, such that each triplet satisfies the condition \mjdeqn||\mathbfh_1||^2\gamma - ||\mathbfh_2||^2\gamma = ||\mathbfh_2||^2\gamma-||\mathbfh_3||^2\gamma||h_1||^2\gamma - ||h_2||^2\gamma = ||h_2||^2\gamma - ||h_3||^2\gamma where \mjeqn\gamma \in ]0,1]\gamma \in ]0,1] only for typetest = "intProduct" and "gneiting". The number of positive temporal lags must be at least 3, or multiple of 3, too. The condition \mjdeqnu_1^2\alpha-u_2^2\alpha=u_2^2\alpha-u_3^2\alphau_1^2\alpha - u_2^2\alpha = u_2^2\alpha - u_3^2\alpha where \mjeqn\alpha \in ]0,1]\alpha \in ]0,1] must be satisfied for each triplet (only for typetest = "intProduct" and "gneiting"), as clarified in Cappello et al., 2018. The values of \mjeqn\gamma\gamma and \mjeqn\alpha\alpha are usually fixed equal to 0.5 or 1 according that the behavior near the origin of the spatial and temporal marginal covariograms is linear or quadratic, respectively. Note that for each spatial triplet and each temporal triplet, 6 contrasts can be defined. However, for typetest = "intProduct" (test on the integrated model) the user has to set arbitrarily one temporal lag equal to zero for each spatial triplet in order to delete redundant contrasts, through the specific setzero method

Slots

couples.st

matrix, in which the first two columns contain the couples of spatial points (denoted with order numbers) to be analyzed and the other columns the temporal lags associated with each spatial couples

sel.staz

numeric or character, contains the ID codes of the selected spatial points

sp.couples

data.frame, contains the couples of order numbers associated with the spatial points to be analyzed and the couples of the ID codes

tl.couples

numeric, contains the temporal lags associated to the couples of the selected spatial points

typetest

character; contains the code of the test to be performed

Note

Errors occur if

  • some spatial points, given in the sequence at the beginning of the function, have not been used to generate the couples of spatial points

  • there is at least one spatial couple with no specification of temporal lags

  • no temporal lags have been specified

  • the number of spatial points fixed in sel.staz is less than 2

  • the construction of the sp.couples.in is not consistent with the test to be performed

References

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.

See Also

setzero

Examples

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

### methods for couples
#1. show
couples.sym

#2. [ extract
couples.sym[3, by.row = FALSE]
couples.sym[3, by.row = TRUE]

#3. summary
summary(couples.sym)


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