CSarc.dens.test1D | R Documentation |
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.
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
)
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 |
support.int |
Support interval |
end.int.cor |
A logical argument for end interval correction, default is |
alternative |
Type of the alternative hypothesis in the test, one of |
conf.level |
Level of the confidence interval, default is |
A list
with the elements
statistic |
Test statistic |
p.value |
The |
conf.int |
Confidence interval for the arc density at the given confidence level |
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 |
method |
Description of the hypothesis test |
data.name |
Name of the data set |
Elvan Ceyhan
CSarc.dens.test
and CSarc.dens.test.int
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.