covTkTl {nnspat} | R Documentation |
Finite Sample Covariance between
and
Values
Description
This function computes the exact (i.e., finite sample) covariance between and
values
which is used in the computation of the exact variance
of Cuzick and Edwards
test, which is a linear combination of some
tests.
The logical argument nonzero.mat
(default=TRUE
) is for using the matrix if
FALSE
or just the matrix of nonzero
locations in the matrix (if
TRUE
) in the computations.
See page 80 of (Cuzick and Edwards (1990)) for more details.
Usage
covTkTl(dat, n1, k, l, nonzero.mat = TRUE, ...)
Arguments
dat |
The data set in one or higher dimensions, each row corresponds to a data point. |
n1 |
Number of cases |
k , l |
Integers specifying the number of NNs (of subjects |
nonzero.mat |
A logical argument (default is |
... |
are for further arguments, such as |
Value
Returns the exact covariance between and
values.
Author(s)
Elvan Ceyhan
References
Cuzick J, Edwards R (1990). “Spatial clustering for inhomogeneous populations (with discussion).” Journal of the Royal Statistical Society, Series B, 52, 73-104.
See Also
asycovTkTl
, covTcomb
, and Ntkl
Examples
n<-20 #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
cls<-sample(0:1,n,replace = TRUE) #or try cls<-rep(0:1,c(10,10))
n1<-sum(cls==1)
k<-1 #try also 2,3 or sample(1:5,1)
l<-1 #try also 2,3 or sample(1:5,1)
c(k,l)
covTkTl(Y,n1,k,l)
covTkTl(Y,n1,k,l,method="max")
asycovTkTl(Y,n1,k,l)
covTkTl(Y,n1,k,l,nonzero.mat = FALSE)
asycovTkTl(Y,n1,k,l,nonzero.mat = FALSE)