Idom.num1PEtri {pcds} | R Documentation |
The indicator for a point being a dominating point for Proportional Edge Proximity Catch Digraphs (PE-PCDs) - one triangle case
Description
Returns p
is
a dominating point of the PE-PCD
where the vertices of the PE-PCD are the 2D data set
Xp
in the triangle tri
, that is,
returns 1 if p
is a dominating point of PE-PCD,
and returns 0 otherwise.
Point, p
, is in the vertex region of vertex rv
(default is NULL
); vertices are labeled as
in the order they are stacked row-wise in
tri
.
PE proximity region is constructed
with respect to the triangle tri
with expansion parameter
and vertex regions are based on center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the triangle
tri
or based on the circumcenter of tri
;
default is , i.e., the center of mass of
tri
.
ch.data.pnt
is for checking
whether point p
is a data point in Xp
or not (default is FALSE
),
so by default this function checks
whether the point p
would be a dominating point
if it actually were in the data set.
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)).
Usage
Idom.num1PEtri(p, Xp, tri, r, M = c(1, 1, 1), rv = NULL, ch.data.pnt = FALSE)
Arguments
p |
A 2D point that is to be tested for being a dominating point or not of the PE-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the PE-PCD. |
tri |
A |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center in the interior of the triangle |
rv |
Index of the vertex whose region contains point |
ch.data.pnt |
A logical argument for checking
whether point |
Value
p
is a dominating point of the PE-PCD
where the vertices of the PE-PCD are the 2D data set
Xp
,
that is, returns 1 if p
is a dominating point,
and returns 0 otherwise.
Author(s)
Elvan Ceyhan
References
Ceyhan E (2005).
An Investigation of Proximity Catch Digraphs in Delaunay Tessellations, also available as technical monograph titled Proximity Catch Digraphs: Auxiliary Tools, Properties, and Applications.
Ph.D. thesis, The Johns Hopkins University, Baltimore, MD, 21218.
Ceyhan E (2011).
“Spatial Clustering Tests Based on Domination Number of a New Random Digraph Family.”
Communications in Statistics - Theory and Methods, 40(8), 1363-1395.
Ceyhan E (2012).
“An investigation of new graph invariants related to the domination number of random proximity catch digraphs.”
Methodology and Computing in Applied Probability, 14(2), 299-334.
Ceyhan E, Priebe CE (2007).
“On the Distribution of the Domination Number of a New Family of Parametrized Random Digraphs.”
Model Assisted Statistics and Applications, 1(4), 231-255.
See Also
Idom.num1PEbasic.tri
and Idom.num1AStri
Examples
A<-c(1,1); B<-c(2,0); C<-c(1.5,2);
Tr<-rbind(A,B,C);
n<-10 #try also n<-20
set.seed(1)
Xp<-runif.tri(n,Tr)$g
M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0)
r<-1.5 #try also r<-2
Idom.num1PEtri(Xp[1,],Xp,Tr,r,M)
Idom.num1PEtri(c(1,2),c(1,2),Tr,r,M)
Idom.num1PEtri(c(1,2),c(1,2),Tr,r,M,ch.data.pnt = TRUE)
gam.vec<-vector()
for (i in 1:n)
{gam.vec<-c(gam.vec,Idom.num1PEtri(Xp[i,],Xp,Tr,r,M))}
ind.gam1<-which(gam.vec==1)
ind.gam1
#or try
Rv<-rel.vert.tri(Xp[1,],Tr,M)$rv
Idom.num1PEtri(Xp[1,],Xp,Tr,r,M,Rv)
Ds<-prj.cent2edges(Tr,M)
if (dimension(M)==3) {M<-bary2cart(M,Tr)}
#need to run this when M is given in barycentric coordinates
Xlim<-range(Tr[,1],Xp[,1],M[1])
Ylim<-range(Tr[,2],Xp[,2],M[2])
xd<-Xlim[2]-Xlim[1]
yd<-Ylim[2]-Ylim[1]
plot(Tr,pch=".",xlab="",ylab="",axes=TRUE,
xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05))
polygon(Tr)
points(Xp,pch=1,col=1)
L<-rbind(M,M,M); R<-Ds
segments(L[,1], L[,2], R[,1], R[,2], lty=2)
points(rbind(Xp[ind.gam1,]),pch=4,col=2)
#rbind is to insert the points correctly if there is only one dominating point
txt<-rbind(Tr,M,Ds)
xc<-txt[,1]+c(-.02,.03,.02,-.02,.04,-.03,.0)
yc<-txt[,2]+c(.02,.02,.05,-.03,.04,.06,-.07)
txt.str<-c("A","B","C","M","D1","D2","D3")
text(xc,yc,txt.str)
P<-c(1.4,1)
Idom.num1PEtri(P,P,Tr,r,M)
Idom.num1PEtri(Xp[1,],Xp,Tr,r,M)
Idom.num1PEtri(c(1,2),Xp,Tr,r,M,ch.data.pnt = FALSE)
#gives an error message if ch.data.pnt = TRUE since p is not a data point