aij.theta: Closeness or Proximity Matrix for Tango's Spatial Clustering...

aij.thetaR Documentation

Closeness or Proximity Matrix for Tango's Spatial Clustering Tests

Description

This function computes the A=a_{ij}(θ) matrix useful in calculations for Tango's test T(θ) for spatial (disease) clustering (see Eqn (2) of \insertCitetango:2007;textualnnspat. Here, A=a_{ij}(θ) is any matrix of a measure of the closeness between two points i and j with aii = 0 for all i = 1, …,n, and θ = (θ_1,…,θ_p)^t denotes the unknown parameter vector related to cluster size and δ = (δ_1,…,δ_n)^t, where δ_i=1 if z_i is a case and 0 otherwise. The test is then

T(θ)=∑_{i=1}^n∑_{j=1}^nδ_i δ_j a_{ij}(θ)=δ^t A(θ) δ

where A=a_{ij}(θ).

T(θ) becomes Cuzick and Edwards T_k tests statistic (\insertCitecuzick:1990;textualnnspat), if a_{ij}=1 if z_j is among the kNNs of z_i and 0 otherwise. In this case θ=k and aij.theta becomes aij.mat (more specifically, aij.mat(dat,k) and aij.theta(dat,k,model="NN").

In Tango's exponential clinal model (\insertCitetango:2000;textualnnspat), a_{ij}=\exp≤ft(-4 ≤ft(\frac{d_{ij}}{θ}\right)^2\right) if i \ne j and 0 otherwise, where θ is a predetermined scale of cluster such that any pair of cases far apart beyond the distance θ cannot be considered as a cluster and d_{ij} denote the Euclidean distance between two points i and j.

In the exponential model (\insertCitetango:2007;textualnnspat), a_{ij}=\exp≤ft(-\frac{d_{ij}}{θ}\right) if i \ne j and 0 otherwise, where θ and d_{ij} are as above.

In the hot-spot model (\insertCitetango:2007;textualnnspat), a_{ij}=1 if d_{ij} ≤ θ and i \ne j and 0 otherwise, where θ and d_{ij} are as above.

The argument model has four options, NN, exp.clinal, exponential, and hot.spot, with exp.clinal being the default. And the theta argument specifies the scale of clustering or the clustering parameter in the particular spatial disease clustering model.

See also (\insertCitetango:2007;textualnnspat) and the references therein.

Usage

aij.theta(dat, theta, model = "exp.clinal", ...)

Arguments

dat

The data set in one or higher dimensions, each row corresponds to a data point.

theta

A predetermined cluster scale so that any pair of cases farther apart then the distance θ is unlikely to be cluster.

model

Type of Tango's spatial clustering model with four options: NN, exp.clinal (default), exponential, and hot.spot.

...

are for further arguments, such as method and p, passed to the dist function.

Value

The A=a_{ij}(θ) matrix useful in calculations for Tango's test T(θ).

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

aij.mat, aij.nonzero and ceTk

Examples

n<-20  #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
k<-3#1 #try also 2,3

#aij for CE's Tk
Aij<-aij.theta(Y,k,model = "NN")
Aij2<-aij.mat(Y,k)
sum(abs(Aij-Aij2)) #check equivalence of aij.theta and aij.mat with model="NN"

Aij<-aij.theta(Y,k,method="max")
Aij2<-aij.mat(Y,k)
range(Aij-Aij2)

theta=.2
aij.theta(Y,theta,model = "exp.clinal")
aij.theta(Y,theta,model = "exponential")
aij.theta(Y,theta,model = "hot.spot")


nnspat documentation built on Aug. 30, 2022, 9:06 a.m.