PEarc.dens.test1D {pcds}R Documentation

A test of segregation/association based on arc density of Proportional Edge Proximity Catch Digraph (PE-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 PE-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 PE-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).

PE proximity region is constructed with the expansion parameter r \ge 1 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). If there are duplicates of Yp points, only one point is retained for each duplicate value, and a warning message is printed.

**Caveat:** This test is currently a conditional test, where Xp points are assumed to be random, while Yp points are assumed to be fixed (i.e., the test is conditional on Yp points). Furthermore, the test is a large sample test when Xp points are substantially larger than Yp points, say at least 5 times more. This test is more appropriate when supports of Xp and Yp have a substantial overlap. Currently, the Xp points outside the range of Yp points are handled with a range correction (or end-interval correction) factor (see the description below and the function code.) However, in the special case of no Xp points in the range of Yp points, arc density is taken to be 1, as this is clearly a case of segregation. Removing the conditioning and extending it to the case of non-concurring supports is an ongoing line of research of the author of the package.

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.

See also (Ceyhan (2012)) for more on the uniformity test based on the arc density of PE-PCDs.

Usage

PEarc.dens.test1D(
  Xp,
  Yp,
  r,
  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 PE-PCD.

Yp

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

r

A positive real number which serves as the expansion parameter in PE proximity region; must be \ge 1.

c

A positive real number which serves as the centrality parameter in PE 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 PE-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

Ceyhan E (2012). “The Distribution of the Relative Arc Density of a Family of Interval Catch Digraph Based on Uniform Data.” Metrika, 75(6), 761-793.

See Also

PEarc.dens.test, PEdom.num.binom.test1D, and PEarc.dens.test.int

Examples


r<-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<-100; 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)

PEarc.dens.test1D(Xp,Yp,r,c,int)
#try also PEarc.dens.test1D(Xp,Yp,r,c,int,alt="l") and PEarc.dens.test1D(Xp,Yp,r,c,int,alt="g")

PEarc.dens.test1D(Xp,Yp,r,c,int,end.int.cor = TRUE)



[Package pcds version 0.1.8 Index]