| rel.vert.end.int {pcds} | R Documentation |
The index of the vertex region in an end-interval that contains a given point
Description
Returns the index of the vertex in the interval, int,
whose end interval contains the 1D point p,
that is, it finds the index of the vertex for the point, p, outside
the interval int=(a,b)=(vertex 1,vertex 2);
vertices of interval are labeled as 1 and 2
according to their order in the interval.
If the point, p, is inside int,
then the function yields NA as output.
The corresponding vertex region is an interval
as (-\infty,a) or (b,\infty) for the interval (a,b).
Then if p<a, then rv=1 and if p>b,
then rv=2.
Unlike rel.vert.mid.int, centrality parameter (i.e., center
of the interval is not relevant for rel.vert.end.int.)
See also (Ceyhan (2012, 2016)).
Usage
rel.vert.end.int(p, int)
Arguments
p |
A 1D point whose end interval region is provided by the function. |
int |
A |
Value
A list with two elements
rv |
Index of the end vertex whose region contains point, |
int |
The vertices of the interval as a |
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.
Ceyhan E (2016).
“Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.”
REVSTAT, 14(4), 349-394.
See Also
Examples
a<-0; b<-10; int<-c(a,b)
rel.vert.end.int(-6,int)
rel.vert.end.int(16,int)
n<-10
xf<-(int[2]-int[1])*.5
XpL<-runif(n,a-xf,a)
XpR<-runif(n,b,b+xf)
Xp<-c(XpL,XpR)
rel.vert.end.int(Xp[1],int)
Rv<-vector()
for (i in 1:length(Xp))
Rv<-c(Rv,rel.vert.end.int(Xp[i],int)$rv)
Rv
Xlim<-range(a,b,Xp)
xd<-Xlim[2]-Xlim[1]
plot(cbind(a,0),xlab="",pch=".",xlim=Xlim+xd*c(-.05,.05))
abline(h=0)
abline(v=c(a,b),col=1,lty = 2)
points(cbind(Xp,0))
text(cbind(Xp,0.1),labels=factor(Rv))
text(cbind(c(a,b),-0.1),c("rv=1","rv=2"))
jit<-.1
yjit<-runif(length(Xp),-jit,jit)
Xlim<-range(a,b,Xp)
xd<-Xlim[2]-Xlim[1]
plot(cbind(a,0),
main="vertex region indices for the points\n in the end intervals",
xlab=" ", ylab=" ",pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=3*range(yjit))
points(Xp, yjit,xlim=Xlim+xd*c(-.05,.05),pch=".",cex=3)
abline(h=0)
abline(v=c(a,b),lty = 2)
text(Xp,yjit,labels=factor(Rv))
text(cbind(c(a,b),-.01),c("rv=1","rv=2"))