setzero {covatest}R Documentation

setzero

Description

Through the function couples, m spatial couples and n temporal lags are provided, hence a set of m x n spatio-temporal lags are defined. If some of these lags are not required for the specific test, they can be set equal to zero by using the setzero method for object of class couples

Usage

setzero(x, zero = TRUE, index = NULL, value)

## S4 method for signature 'couples'
setzero(x, zero = TRUE, index = NULL, value)

Arguments

x

object of class couples

zero

logical, if TRUE (the default) all negative temporal lags are replaced with zero. If x@typetest is equal to "sym" (symmetry test) the argument setzero is ignored because both positive and negative temporal lags are required for computing the test

index

two column matrix. Each row of the matrix index contains the specific row and column, of the slot @couples.st, for which the spatio-temporal covariance is not required

value

numeric, the value to be replaced. Note that this method is reasonable to be used only to replace a value equal to zero

See Also

couples

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

zero.index <- matrix(data=c(1,3,1,4,2,5,2,6), ncol=2, byrow = TRUE)

setzero(couples.sym, zero = FALSE, index = zero.index, value = 0)


[Package covatest version 1.2.3 Index]