CSarc.dens.test1D: A test of segregation/association based on arc density of...

View source: R/CentSim1D.R

CSarc.dens.test1DR Documentation

A test of segregation/association based on arc density of Central Similarity Proximity Catch Digraph (CS-PCD) for 1D data

Description

An object of class "htest" (i.e., hypothesis test) function which performs a hypothesis test of complete spatial randomness (CSR) or uniformity of Xp points in the range (i.e., range) of Yp points against the alternatives of segregation (where Xp points cluster away from Yp points) and association (where Xp points cluster around Yp points) based on the normal approximation of the arc density of the CS-PCD for uniform 1D data.

The function yields the test statistic, p-value for the corresponding alternative, the confidence interval, estimate and null value for the parameter of interest (which is the arc density), and method and name of the data set used.

Under the null hypothesis of uniformity of Xp points in the range of Yp points, arc density of CS-PCD whose vertices are Xp points equals to its expected value under the uniform distribution and alternative could be two-sided, or left-sided (i.e., data is accumulated around the Yp points, or association) or right-sided (i.e., data is accumulated around the centers of the intervals, or segregation).

CS proximity region is constructed with the expansion parameter t > 0 and centrality parameter c which yields M-vertex regions. More precisely, for a middle interval (y_{(i)},y_{(i+1)}), the center is M=y_{(i)}+c(y_{(i+1)}-y_{(i)}) for the centrality parameter c \in (0,1). This test is more appropriate when supports of Xp and Yp has a substantial overlap.

end.int.cor is for end interval correction, (default is "no end interval correction", i.e., end.int.cor=FALSE), recommended when both Xp and Yp have the same interval support.

Usage

CSarc.dens.test1D(
  Xp,
  Yp,
  t,
  c = 0.5,
  support.int = NULL,
  end.int.cor = FALSE,
  alternative = c("two.sided", "less", "greater"),
  conf.level = 0.95
)

Arguments

Xp

A set of 1D points which constitute the vertices of the CS-PCD.

Yp

A set of 1D points which constitute the end points of the partition intervals.

t

A positive real number which serves as the expansion parameter in CS proximity region.

c

A positive real number which serves as the centrality parameter in CS proximity region; must be in (0,1) (default c=.5).

support.int

Support interval (a,b) with a<b. Uniformity of Xp points in this interval is tested. Default is NULL.

end.int.cor

A logical argument for end interval correction, default is FALSE, recommended when both Xp and Yp have the same interval support.

alternative

Type of the alternative hypothesis in the test, one of "two.sided", "less", "greater".

conf.level

Level of the confidence interval, default is 0.95, for the arc density CS-PCD whose vertices are the 1D data set Xp.

Value

A list with the elements

statistic

Test statistic

p.value

The p-value for the hypothesis test for the corresponding alternative.

conf.int

Confidence interval for the arc density at the given confidence level conf.level and depends on the type of alternative.

estimate

Estimate of the parameter, i.e., arc density

null.value

Hypothesized value for the parameter, i.e., the null arc density, which is usually the mean arc density under uniform distribution.

alternative

Type of the alternative hypothesis in the test, one of "two.sided", "less", "greater"

method

Description of the hypothesis test

data.name

Name of the data set

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

CSarc.dens.test and CSarc.dens.test.int

Examples

tau<-2
c<-.4
a<-0; b<-10; int=c(a,b)

#nx is number of X points (target) and ny is number of Y points (nontarget)
nx<-20; ny<-4;  #try also nx<-40; ny<-10 or nx<-1000; ny<-10;

set.seed(1)
xf<-(int[2]-int[1])*.1

Xp<-runif(nx,a-xf,b+xf)
Yp<-runif(ny,a,b)

CSarc.dens.test1D(Xp,Yp,tau,c,int)
CSarc.dens.test1D(Xp,Yp,tau,c,int,alt="l")
CSarc.dens.test1D(Xp,Yp,tau,c,int,alt="g")

CSarc.dens.test1D(Xp,Yp,tau,c,int,end.int.cor = TRUE)

Yp2<-runif(ny,a,b)+11
CSarc.dens.test1D(Xp,Yp2,tau,c,int)

n<-10  #try also n<-20
Xp<-runif(n,a,b)
CSarc.dens.test1D(Xp,Yp,tau,c,int)


elvanceyhan/pcds documentation built on June 29, 2023, 8:12 a.m.