Title: | Proximity Catch Digraphs and Their Applications |
---|---|
Description: | Contains the functions for construction and visualization of various families of the proximity catch digraphs (PCDs) (see (Ceyhan (2005) ISBN:978-3-639-19063-2), for computing the graph invariants for testing the patterns of segregation and association against complete spatial randomness (CSR) or uniformity in one, two and three dimensional cases. The package also has tools for generating points from these spatial patterns. The graph invariants used in testing spatial point data are the domination number (Ceyhan (2011) <doi:10.1080/03610921003597211>) and arc density (Ceyhan et al. (2006) <doi:10.1016/j.csda.2005.03.002>; Ceyhan et al. (2007) <doi:10.1002/cjs.5550350106>). The PCD families considered are Arc-Slice PCDs, Proportional-Edge PCDs, and Central Similarity PCDs. |
Authors: | Elvan Ceyhan |
Maintainer: | Elvan Ceyhan <[email protected]> |
License: | GPL-2 |
Version: | 0.1.7 |
Built: | 2024-11-15 05:23:54 UTC |
Source: | https://github.com/elvanceyhan/pcds |
.onAttach start message
.onAttach(libname, pkgname)
.onAttach(libname, pkgname)
libname |
defunct |
pkgname |
defunct |
invisible()
.onLoad getOption package settings
.onLoad(libname, pkgname)
.onLoad(libname, pkgname)
libname |
defunct |
pkgname |
defunct |
invisible()
getOption("pcds.name")
getOption("pcds.name")
Gives the two pairs of angles in radians or degrees to draw arcs between two vectors or line segments
for the draw.arc
function in the plotrix
package.
The angles are provided with respect to the -axis in the coordinate system.
The line segments are
and
when the argument is given as
a,b,c
in the function.
radian
is a logical argument (default=TRUE
) which yields the angle in radians if TRUE
, and in degrees if FALSE
.
The first pair of angles is for drawing arcs in the smaller angle between and
and the second pair of angles is for drawing arcs in the counter-clockwise order from
to
.
angle.str2end(a, b, c, radian = TRUE)
angle.str2end(a, b, c, radian = TRUE)
a , b , c
|
Three 2D points which represent the intersecting line segments |
radian |
A logical argument (default= |
A list
with two elements
small.arc.angles |
Angles of |
ccw.arc.angles |
Angles of |
Elvan Ceyhan
## Not run: A<-c(.3,.2); B<-c(.6,.3); C<-c(1,1) pts<-rbind(A,B,C) Xp<-c(B[1]+max(abs(C[1]-B[1]),abs(A[1]-B[1])),0) angle.str2end(A,B,C) angle.str2end(A,B,A) angle.str2end(A,B,C,radian=FALSE) #plot of the line segments ang.rad<-angle.str2end(A,B,C,radian=TRUE); ang.rad ang.deg<-angle.str2end(A,B,C,radian=FALSE); ang.deg ang.deg1<-ang.deg$s; ang.deg1 ang.deg2<-ang.deg$c; ang.deg2 rad<-min(Dist(A,B),Dist(B,C)) Xlim<-range(pts[,1],Xp[1],B+Xp,B[1]+c(+rad,-rad)) Ylim<-range(pts[,2],B[2]+c(+rad,-rad)) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot for the smaller arc plot(pts,pch=1,asp=1,xlab="x",ylab="y",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) L<-rbind(B,B,B); R<-rbind(A,C,B+Xp) segments(L[,1], L[,2], R[,1], R[,2], lty=2) plotrix::draw.arc(B[1],B[2],radius=.3*rad,angle1=ang.rad$s[1],angle2=ang.rad$s[2]) plotrix::draw.arc(B[1],B[2],radius=.6*rad,angle1=0, angle2=ang.rad$s[1],lty=2,col=2) plotrix::draw.arc(B[1],B[2],radius=.9*rad,angle1=0,angle2=ang.rad$s[2],col=3) txt<-rbind(A,B,C) text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.02,nrow(txt))),c("A","B","C")) text(rbind(B)+.5*rad*c(cos(mean(ang.rad$s)),sin(mean(ang.rad$s))), paste(abs(round(ang.deg1[2]-ang.deg1[1],2))," degrees",sep="")) text(rbind(B)+.6*rad*c(cos(ang.rad$s[1]/2),sin(ang.rad$s[1]/2)),paste(round(ang.deg1[1],2)),col=2) text(rbind(B)+.9*rad*c(cos(ang.rad$s[2]/2),sin(ang.rad$s[2]/2)),paste(round(ang.deg1[2],2)),col=3) #plot for the counter-clockwise arc plot(pts,pch=1,asp=1,xlab="x",ylab="y",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) L<-rbind(B,B,B); R<-rbind(A,C,B+Xp) segments(L[,1], L[,2], R[,1], R[,2], lty=2) plotrix::draw.arc(B[1],B[2],radius=.3*rad,angle1=ang.rad$c[1],angle2=ang.rad$c[2]) plotrix::draw.arc(B[1],B[2],radius=.6*rad,angle1=0, angle2=ang.rad$s[1],lty=2,col=2) plotrix::draw.arc(B[1],B[2],radius=.9*rad,angle1=0,angle2=ang.rad$s[2],col=3) txt<-pts text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.02,nrow(txt))),c("A","B","C")) text(rbind(B)+.5*rad*c(cos(mean(ang.rad$c)),sin(mean(ang.rad$c))), paste(abs(round(ang.deg2[2]-ang.deg2[1],2))," degrees",sep="")) text(rbind(B)+.6*rad*c(cos(ang.rad$s[1]/2),sin(ang.rad$s[1]/2)),paste(round(ang.deg1[1],2)),col=2) text(rbind(B)+.9*rad*c(cos(ang.rad$s[2]/2),sin(ang.rad$s[2]/2)),paste(round(ang.deg1[2],2)),col=3) ## End(Not run)
## Not run: A<-c(.3,.2); B<-c(.6,.3); C<-c(1,1) pts<-rbind(A,B,C) Xp<-c(B[1]+max(abs(C[1]-B[1]),abs(A[1]-B[1])),0) angle.str2end(A,B,C) angle.str2end(A,B,A) angle.str2end(A,B,C,radian=FALSE) #plot of the line segments ang.rad<-angle.str2end(A,B,C,radian=TRUE); ang.rad ang.deg<-angle.str2end(A,B,C,radian=FALSE); ang.deg ang.deg1<-ang.deg$s; ang.deg1 ang.deg2<-ang.deg$c; ang.deg2 rad<-min(Dist(A,B),Dist(B,C)) Xlim<-range(pts[,1],Xp[1],B+Xp,B[1]+c(+rad,-rad)) Ylim<-range(pts[,2],B[2]+c(+rad,-rad)) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot for the smaller arc plot(pts,pch=1,asp=1,xlab="x",ylab="y",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) L<-rbind(B,B,B); R<-rbind(A,C,B+Xp) segments(L[,1], L[,2], R[,1], R[,2], lty=2) plotrix::draw.arc(B[1],B[2],radius=.3*rad,angle1=ang.rad$s[1],angle2=ang.rad$s[2]) plotrix::draw.arc(B[1],B[2],radius=.6*rad,angle1=0, angle2=ang.rad$s[1],lty=2,col=2) plotrix::draw.arc(B[1],B[2],radius=.9*rad,angle1=0,angle2=ang.rad$s[2],col=3) txt<-rbind(A,B,C) text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.02,nrow(txt))),c("A","B","C")) text(rbind(B)+.5*rad*c(cos(mean(ang.rad$s)),sin(mean(ang.rad$s))), paste(abs(round(ang.deg1[2]-ang.deg1[1],2))," degrees",sep="")) text(rbind(B)+.6*rad*c(cos(ang.rad$s[1]/2),sin(ang.rad$s[1]/2)),paste(round(ang.deg1[1],2)),col=2) text(rbind(B)+.9*rad*c(cos(ang.rad$s[2]/2),sin(ang.rad$s[2]/2)),paste(round(ang.deg1[2],2)),col=3) #plot for the counter-clockwise arc plot(pts,pch=1,asp=1,xlab="x",ylab="y",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) L<-rbind(B,B,B); R<-rbind(A,C,B+Xp) segments(L[,1], L[,2], R[,1], R[,2], lty=2) plotrix::draw.arc(B[1],B[2],radius=.3*rad,angle1=ang.rad$c[1],angle2=ang.rad$c[2]) plotrix::draw.arc(B[1],B[2],radius=.6*rad,angle1=0, angle2=ang.rad$s[1],lty=2,col=2) plotrix::draw.arc(B[1],B[2],radius=.9*rad,angle1=0,angle2=ang.rad$s[2],col=3) txt<-pts text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.02,nrow(txt))),c("A","B","C")) text(rbind(B)+.5*rad*c(cos(mean(ang.rad$c)),sin(mean(ang.rad$c))), paste(abs(round(ang.deg2[2]-ang.deg2[1],2))," degrees",sep="")) text(rbind(B)+.6*rad*c(cos(ang.rad$s[1]/2),sin(ang.rad$s[1]/2)),paste(round(ang.deg1[1],2)),col=2) text(rbind(B)+.9*rad*c(cos(ang.rad$s[2]/2),sin(ang.rad$s[2]/2)),paste(round(ang.deg1[2],2)),col=3) ## End(Not run)
Returns the angle in radians or degrees between two vectors or line segments at the point of
intersection. The line segments are and
when the arguments of the function are given as
a,b,c
.
radian
is a logical argument (default=TRUE
) which yields the angle in radians if TRUE
, and in degrees if FALSE
.
The smaller of the angle between the line segments is provided by the function.
angle3pnts(a, b, c, radian = TRUE)
angle3pnts(a, b, c, radian = TRUE)
a , b , c
|
Three 2D points which represent the intersecting line segments |
radian |
A logical argument (default= |
angle in radians or degrees between the line segments and
Elvan Ceyhan
## Not run: A<-c(.3,.2); B<-c(.6,.3); C<-c(1,1) pts<-rbind(A,B,C) angle3pnts(A,B,C) angle3pnts(A,B,A) round(angle3pnts(A,B,A),7) angle3pnts(A,B,C,radian=FALSE) #plot of the line segments Xlim<-range(pts[,1]) Ylim<-range(pts[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] ang1<-angle3pnts(A,B,C,radian=FALSE) ang2<-angle3pnts(B+c(1,0),B,C,radian=FALSE) sa<-angle.str2end(A,B,C,radian=FALSE)$s #small arc angles ang1<-sa[1] ang2<-sa[2] plot(pts,asp=1,pch=1,xlab="x",ylab="y", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) L<-rbind(B,B); R<-rbind(A,C) segments(L[,1], L[,2], R[,1], R[,2], lty=2) plotrix::draw.arc(B[1],B[2],radius=xd*.1,deg1=ang1,deg2=ang2) txt<-rbind(A,B,C) text(txt+cbind(rep(xd*.05,nrow(txt)),rep(-xd*.02,nrow(txt))),c("A","B","C")) text(rbind(B)+.15*xd*c(cos(pi*(ang2+ang1)/360),sin(pi*(ang2+ang1)/360)), paste(round(abs(ang1-ang2),2)," degrees")) ## End(Not run)
## Not run: A<-c(.3,.2); B<-c(.6,.3); C<-c(1,1) pts<-rbind(A,B,C) angle3pnts(A,B,C) angle3pnts(A,B,A) round(angle3pnts(A,B,A),7) angle3pnts(A,B,C,radian=FALSE) #plot of the line segments Xlim<-range(pts[,1]) Ylim<-range(pts[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] ang1<-angle3pnts(A,B,C,radian=FALSE) ang2<-angle3pnts(B+c(1,0),B,C,radian=FALSE) sa<-angle.str2end(A,B,C,radian=FALSE)$s #small arc angles ang1<-sa[1] ang2<-sa[2] plot(pts,asp=1,pch=1,xlab="x",ylab="y", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) L<-rbind(B,B); R<-rbind(A,C) segments(L[,1], L[,2], R[,1], R[,2], lty=2) plotrix::draw.arc(B[1],B[2],radius=xd*.1,deg1=ang1,deg2=ang2) txt<-rbind(A,B,C) text(txt+cbind(rep(xd*.05,nrow(txt)),rep(-xd*.02,nrow(txt))),c("A","B","C")) text(rbind(B)+.15*xd*c(cos(pi*(ang2+ang1)/360),sin(pi*(ang2+ang1)/360)), paste(round(abs(ang1-ang2),2)," degrees")) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) of AS-PCD whose vertices are the data set Xp
and related parameters and the quantities of the digraph.
AS proximity regions are defined with respect to the Delaunay triangles based on
Yp
points, i.e., AS proximity regions are defined only for Xp
points
inside the convex hull of Yp
points.
That is, arcs may exist for points only inside the convex hull of Yp
points.
It also provides various descriptions and quantities about the arcs of the AS-PCD
such as number of arcs, arc density, etc.
Vertex regions are based on the center M="CC"
for circumcenter of each Delaunay triangle or in barycentric coordinates in the
interior of each Delaunay triangle; default is
M="CC"
i.e., circumcenter of each triangle.
M
must be entered in barycentric coordinates unless it is the circumcenter.
See (Ceyhan (2005, 2010)) for more on AS PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
arcsAS(Xp, Yp, M = "CC")
arcsAS(Xp, Yp, M = "CC")
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangulation. The Delaunay
triangles partition the convex hull of |
M |
The center of the triangle. |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, it is the center used to construct the vertex regions,
default is circumcenter, denoted as |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the Delaunay triangulation based on |
tess.name |
Name of data set used in tessellation, i.e., |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of AS-PCD for 2D data set |
E |
Heads (or arrow ends) of the arcs of AS-PCD for 2D data set |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
arcsAStri
, arcsPEtri
, arcsCStri
, arcsPE
,
and arcsCS
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx=20; nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) Arcs<-arcsAS(Xp,Yp,M) #try also the default M with Arcs<-arcsAS(Xp,Yp) Arcs summary(Arcs) plot(Arcs) arcsAS(Xp,Yp[1:3,],M) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx=20; nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) Arcs<-arcsAS(Xp,Yp,M) #try also the default M with Arcs<-arcsAS(Xp,Yp) Arcs summary(Arcs) plot(Arcs) arcsAS(Xp,Yp[1:3,],M) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for data set Xp
as the vertices
of AS-PCD and related parameters and the quantities of the digraph.
AS proximity regions are constructed with respect to the triangle tri
, i.e.,
arcs may exist for points only inside tri
.
It also provides various descriptions and quantities about the arcs of the AS-PCD
such as number of arcs, arc density, etc.
Vertex regions are based on the center M="CC"
for
circumcenter of tri
; or in Cartesian coordinates or
in barycentric
coordinates in the interior of the triangle
tri
; default is M="CC"
the circumcenter of tri
.
The different consideration of circumcenter vs any other interior center of the triangle is because
the projections from circumcenter are orthogonal to the edges, while projections of M
on the edges are on the extensions
of the lines connecting M
and the vertices.
See also (Ceyhan (2005, 2010)).
arcsAStri(Xp, tri, M = "CC")
arcsAStri(Xp, tri, M = "CC")
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, it is the center used to construct the vertex regions. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support triangle. |
tess.name |
Name of data set used in tessellation (i.e., vertices of the triangle). |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of AS-PCD for 2D data set |
E |
Heads (or arrow ends) of the arcs of AS-PCD for 2D data set |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
arcsAS
, arcsPEtri
, arcsCStri
, arcsPE
,
and arcsCS
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) or M<-circumcenter.tri(Tr) Arcs<-arcsAStri(Xp,Tr,M) #try also Arcs<-arcsAStri(Xp,Tr) #uses the default center, namely circumcenter for M Arcs summary(Arcs) plot(Arcs) #use plot(Arcs,asp=1) if M=CC #can add vertex regions #but we first need to determine center is the circumcenter or not, #see the description for more detail. CC<-circumcenter.tri(Tr) M = as.numeric(Arcs$parameters[[1]]) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) #now we add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.03,.02,.03,.04,-.03,-.01) yc<-txt[,2]+c(.02,.02,.03,.06,.04,.05,-.07) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) or M<-circumcenter.tri(Tr) Arcs<-arcsAStri(Xp,Tr,M) #try also Arcs<-arcsAStri(Xp,Tr) #uses the default center, namely circumcenter for M Arcs summary(Arcs) plot(Arcs) #use plot(Arcs,asp=1) if M=CC #can add vertex regions #but we first need to determine center is the circumcenter or not, #see the description for more detail. CC<-circumcenter.tri(Tr) M = as.numeric(Arcs$parameters[[1]]) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) #now we add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.03,.02,.03,.04,-.03,-.01) yc<-txt[,2]+c(.02,.02,.03,.06,.04,.05,-.07) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) of Central Similarity Proximity Catch Digraph
(CS-PCD) whose vertices are the data points in Xp
in the multiple triangle case
and related parameters and the quantities of the digraph.
CS proximity regions are
defined with respect to the Delaunay triangles based on Yp
points with expansion parameter and
edge regions in each triangle are based on the center
in barycentric coordinates
in the interior of each Delaunay triangle (default for
which is the center of mass of
the triangle). Each Delaunay triangle is first converted to an (nonscaled) basic triangle so that
M
will be the same type of center for each Delaunay triangle (this conversion is not necessary when M
is ).
Convex hull of Yp
is partitioned by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles whose union constitutes the
convex hull of Yp
points). For the number of arcs, loops are not allowed so arcs are only possible
for points inside the convex hull of Yp
points.
See (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)) for more on CS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
arcsCS(Xp, Yp, t, M = c(1, 1, 1))
arcsCS(Xp, Yp, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 3D point in barycentric coordinates which serves as a center in the interior of each Delaunay
triangle, default for |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, it is the center used to construct the edge regions. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is Delaunay triangulation based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of CS-PCD for 2D data set |
E |
Heads (or arrow ends) of the arcs of CS-PCD for 2D data set |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of triangles, number of arcs, and arc density. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) tau<-1.5 #try also tau<-2 Arcs<-arcsCS(Xp,Yp,tau,M) #or use the default center Arcs<-arcsCS(Xp,Yp,tau) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) tau<-1.5 #try also tau<-2 Arcs<-arcsCS(Xp,Yp,tau,M) #or use the default center Arcs<-arcsCS(Xp,Yp,tau) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of CS-PCD and related parameters and the quantities of the digraph.
Yp
determines the end points of the intervals.
For this function, CS proximity regions are constructed data points inside or outside the intervals based
on Yp
points with expansion parameter and centrality parameter
. That is, for this function,
arcs may exist for points in the middle or end intervals.
It also provides various descriptions and quantities about the arcs of the CS-PCD
such as number of arcs, arc density, etc.
Equivalent to function arcsCS1D
.
See also (Ceyhan (2016)).
arcsCS1D(Xp, Yp, t, c = 0.5)
arcsCS1D(Xp, Yp, t, c = 0.5)
Xp |
A set or |
Yp |
A set or |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, they are expansion and centrality parameters. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization of the real line based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of CS-PCD for 1D data |
E |
Heads (or arrow ends) of the arcs of CS-PCD for 1D data |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
arcsCSend.int
, arcsCSmid.int
, arcsCS1D
, and arcsPE1D
t<-2 c<-.4 a<-0; b<-10; #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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.1 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) Arcs<-arcsCS1D(Xp,Yp,t,c) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E arcsCS1D(Xp,Yp,t,c) arcsCS1D(Xp,Yp+10,t,c) jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), main="arcs of CS-PCD for points (jittered along y-axis)\n in middle intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) t<-2 c<-.4 a<-0; b<-10; nx<-20; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) arcsCS1D(Xp,Yp,t,c)
t<-2 c<-.4 a<-0; b<-10; #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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.1 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) Arcs<-arcsCS1D(Xp,Yp,t,c) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E arcsCS1D(Xp,Yp,t,c) arcsCS1D(Xp,Yp+10,t,c) jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), main="arcs of CS-PCD for points (jittered along y-axis)\n in middle intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) t<-2 c<-.4 a<-0; b<-10; nx<-20; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) arcsCS1D(Xp,Yp,t,c)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of CS-PCD and related parameters and the quantities of the digraph.
Yp
determines the end points of the end intervals.
For this function, CS proximity regions are constructed data points outside the intervals based on
Yp
points with expansion parameter . That is, for this function,
arcs may exist for points only inside end intervals.
It also provides various descriptions and quantities about the arcs of the CS-PCD
such as number of arcs, arc density, etc.
See also (Ceyhan (2016)).
arcsCSend.int(Xp, Yp, t)
arcsCSend.int(Xp, Yp, t)
Xp |
A set or |
Yp |
A set or |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, it is the expansion parameter. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitutes the vertices of the digraph |
S |
Tails (or sources) of the arcs of CS-PCD for 1D data in the end intervals |
E |
Heads (or arrow ends) of the arcs of CS-PCD for 1D data in the end intervals |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals (which is 2 for end intervals), number of arcs, and arc density. |
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
arcsCSmid.int
, arcsCS1D
, arcsPEmid.int
,
arcsPEend.int
and arcsPE1D
t<-1.5 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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.5 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) arcsCSend.int(Xp,Yp,t) Arcs<-arcsCSend.int(Xp,Yp,t) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0),pch=".", main="arcs of CS-PCD with vertices (jittered along y-axis)\n in end intervals ", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit)) abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) arcsCSend.int(Xp,Yp,t)
t<-1.5 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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.5 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) arcsCSend.int(Xp,Yp,t) Arcs<-arcsCSend.int(Xp,Yp,t) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0),pch=".", main="arcs of CS-PCD with vertices (jittered along y-axis)\n in end intervals ", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit)) abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) arcsCSend.int(Xp,Yp,t)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of CS-PCD. int
determines the end points of the interval.
For this function, CS proximity regions are constructed data points inside or outside the interval based
on int
points with expansion parameter and centrality parameter
. That is, for this function,
arcs may exist for points in the middle or end intervals.
It also provides various descriptions and quantities about the arcs of the CS-PCD
such as number of arcs, arc density, etc.
arcsCSint(Xp, int, t, c = 0.5)
arcsCSint(Xp, int, t, c = 0.5)
Xp |
A set or |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, they are expansion and centrality parameters. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization of the real line based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of CS-PCD for 1D data |
E |
Heads (or arrow ends) of the arcs of CS-PCD for 1D data |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
There are no references for Rd macro \insertAllCites
on this help page.
arcsCS1D
, arcsCSmid.int
, arcsCSend.int
, and arcsPE1D
tau<-2 c<-.4 a<-0; b<-10; int<-c(a,b); #n is number of X points n<-10; #try also n<-20 xf<-(int[2]-int[1])*.1 set.seed(1) Xp<-runif(n,a-xf,b+xf) Arcs<-arcsCSint(Xp,int,tau,c) Arcs summary(Arcs) plot(Arcs) Xp<-runif(n,a+10,b+10) Arcs=arcsCSint(Xp,int,tau,c) Arcs summary(Arcs) plot(Arcs)
tau<-2 c<-.4 a<-0; b<-10; int<-c(a,b); #n is number of X points n<-10; #try also n<-20 xf<-(int[2]-int[1])*.1 set.seed(1) Xp<-runif(n,a-xf,b+xf) Arcs<-arcsCSint(Xp,int,tau,c) Arcs summary(Arcs) plot(Arcs) Xp<-runif(n,a+10,b+10) Arcs=arcsCSint(Xp,int,tau,c) Arcs summary(Arcs) plot(Arcs)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of CS-PCD and related parameters and the quantities of the digraph.
For this function, CS proximity regions are constructed with respect to the intervals
based on Yp
points with expansion parameter and centrality parameter
. That is, for this
function, arcs may exist for points only inside the intervals.
It also provides various descriptions and quantities about the arcs of the CS-PCD
such as number of arcs, arc density, etc.
Vertex regions are based on center of each middle interval.
See also (Ceyhan (2016)).
arcsCSmid.int(Xp, Yp, t, c = 0.5)
arcsCSmid.int(Xp, Yp, t, c = 0.5)
Xp |
A set or |
Yp |
A set or |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, they are expansion and centrality parameters. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, i.e., |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of CS-PCD for 1D data in the middle intervals |
E |
Heads (or arrow ends) of the arcs of CS-PCD for 1D data in the middle intervals |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
arcsPEend.int
, arcsPE1D
, arcsCSmid.int
,
arcsCSend.int
and arcsCS1D
t<-1.5 c<-.4 a<-0; b<-10 #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) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) arcsCSmid.int(Xp,Yp,t,c) arcsCSmid.int(Xp,Yp+10,t,c) Arcs<-arcsCSmid.int(Xp,Yp,t,c) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), main="arcs of CS-PCD whose vertices (jittered along y-axis)\n in middle intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) t<-.5 c<-.4 a<-0; b<-10; nx<-20; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) arcsCSmid.int(Xp,Yp,t,c)
t<-1.5 c<-.4 a<-0; b<-10 #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) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) arcsCSmid.int(Xp,Yp,t,c) arcsCSmid.int(Xp,Yp+10,t,c) Arcs<-arcsCSmid.int(Xp,Yp,t,c) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), main="arcs of CS-PCD whose vertices (jittered along y-axis)\n in middle intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) t<-.5 c<-.4 a<-0; b<-10; nx<-20; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) arcsCSmid.int(Xp,Yp,t,c)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for data set Xp
as the vertices
of CS-PCD and related parameters and the quantities of the digraph.
CS proximity regions are constructed with respect to the triangle tri
with expansion
parameter , i.e., arcs may exist for points only inside
tri
.
It also provides various descriptions and quantities about the arcs of the CS-PCD
such as number of arcs, arc density, etc.
Edge regions are based on center
in Cartesian coordinates or
in barycentric coordinates in the interior of
the triangle
tri
; default is i.e., the center of mass of
tri
.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
arcsCStri(Xp, tri, t, M = c(1, 1, 1))
arcsCStri(Xp, tri, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, the center |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support triangle. |
tess.name |
Name of data set used in tessellation (i.e., vertices of the triangle) |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of CS-PCD for 2D data set |
E |
Heads (or arrow ends) of the arcs of CS-PCD for 2D data set |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of triangles, number of arcs, and arc density. |
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
arcsCS
, arcsAStri
and arcsPEtri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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) t<-1.5 #try also t<-2 Arcs<-arcsCStri(Xp,Tr,t,M) #or try with the default center Arcs<-arcsCStri(Xp,Tr,t); M= (Arcs$param)$c Arcs summary(Arcs) plot(Arcs) #can add edge regions L<-rbind(M,M,M); R<-Tr segments(L[,1], L[,2], R[,1], R[,2], lty=2) #now we can add the vertex names and annotation txt<-rbind(Tr,M) xc<-txt[,1]+c(-.02,.03,.02,.03) yc<-txt[,2]+c(.02,.02,.03,.06) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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) t<-1.5 #try also t<-2 Arcs<-arcsCStri(Xp,Tr,t,M) #or try with the default center Arcs<-arcsCStri(Xp,Tr,t); M= (Arcs$param)$c Arcs summary(Arcs) plot(Arcs) #can add edge regions L<-rbind(M,M,M); R<-Tr segments(L[,1], L[,2], R[,1], R[,2], lty=2) #now we can add the vertex names and annotation txt<-rbind(Tr,M) xc<-txt[,1]+c(-.02,.03,.02,.03) yc<-txt[,2]+c(.02,.02,.03,.06) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) of
Proportional Edge Proximity Catch Digraph
(PE-PCD) whose vertices are the data points in Xp
in the multiple triangle case
and related parameters and the quantities of the digraph.
PE proximity regions are
defined with respect to the Delaunay triangles
based on Yp
points with expansion parameter and
vertex regions in each triangle are
based on the center
in barycentric coordinates
in the interior of each Delaunay triangle or
based on circumcenter of each Delaunay triangle
(default for
which is the center of mass of the triangle).
Each Delaunay triangle is first converted to
an (nonscaled) basic triangle so that
M
will be the same
type of center for each Delaunay triangle
(this conversion is not necessary when M
is ).
Convex hull of Yp
is partitioned
by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles
whose union constitutes the
convex hull of Yp
points).
For the number of arcs, loops are not allowed so arcs are only possible
for points inside the convex hull of Yp
points.
See (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)) for more on the PE-PCDs. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
arcsPE(Xp, Yp, r, M = c(1, 1, 1))
arcsPE(Xp, Yp, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 3D point in barycentric coordinates
which serves as a center in the interior of each Delaunay
triangle or circumcenter of each Delaunay triangle
(for this, argument should be set as |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, the center used to construct the vertex regions and the expansion parameter. |
tess.points |
Points on which the tessellation
of the study region is performed,
here, tessellation
is Delaunay triangulation based on |
tess.name |
Name of data set used in tessellation,
it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of PE-PCD for 2D data set |
E |
Heads (or arrow ends) of the arcs of PE-PCD for 2D data set |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of triangles, number of arcs, and arc density. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 Arcs<-arcsPE(Xp,Yp,r,M) #or try with the default center Arcs<-arcsPE(Xp,Yp,r) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 Arcs<-arcsPE(Xp,Yp,r,M) #or try with the default center Arcs<-arcsPE(Xp,Yp,r) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of PE-PCD and related parameters and the quantities of the digraph.
Yp
determines the end points of the intervals.
For this function, PE proximity regions are constructed data points inside or outside the intervals based
on Yp
points with expansion parameter and centrality parameter
. That is, for this function,
arcs may exist for points in the middle or end intervals.
It also provides various descriptions and quantities about the arcs of the PE-PCD
such as number of arcs, arc density, etc.
See also (Ceyhan (2012)).
arcsPE1D(Xp, Yp, r, c = 0.5)
arcsPE1D(Xp, Yp, r, c = 0.5)
Xp |
A set or |
Yp |
A set or |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, they are expansion and centrality parameters. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization of the real line based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of PE-PCD for 1D data |
E |
Heads (or arrow ends) of the arcs of PE-PCD for 1D data |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
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.
arcsPEint
, arcsPEmid.int
, arcsPEend.int
, and arcsCS1D
## Not run: 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<-15; 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) Arcs<-arcsPE1D(Xp,Yp,r,c) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
## Not run: 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<-15; 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) Arcs<-arcsPE1D(Xp,Yp,r,c) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of PE-PCD and related parameters and the quantities of the digraph. Yp
determines the end points of the end intervals.
For this function, PE proximity regions are constructed data points outside the intervals based on
Yp
points with expansion parameter . That is, for this function,
arcs may exist for points only inside end intervals.
It also provides various descriptions and quantities about the arcs of the PE-PCD
such as number of arcs, arc density, etc.
See also (Ceyhan (2012)).
arcsPEend.int(Xp, Yp, r)
arcsPEend.int(Xp, Yp, r)
Xp |
A set or |
Yp |
A set or |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, it is the expansion parameter. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitutes the vertices of the digraph |
S |
Tails (or sources) of the arcs of PE-PCD for 1D data in the end intervals |
E |
Heads (or arrow ends) of the arcs of PE-PCD for 1D data in the end intervals |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals (which is 2 for end intervals), number of arcs, and arc density. |
Elvan Ceyhan
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.
arcsPEmid.int
, arcsPE1D
, arcsCSmid.int
,
arcsCSend.int
and arcsCS1D
## Not run: r<-2 a<-0; b<-10; int<-c(a,b); #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) xf<-(int[2]-int[1])*.5 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) #try also Yp<-runif(ny,a,b)+c(-10,10) Arcs<-arcsPEend.int(Xp,Yp,r) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0),pch=".", main="arcs of PE-PCDs for points (jittered along y-axis)\n in end intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit)) abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) ## End(Not run)
## Not run: r<-2 a<-0; b<-10; int<-c(a,b); #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) xf<-(int[2]-int[1])*.5 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) #try also Yp<-runif(ny,a,b)+c(-10,10) Arcs<-arcsPEend.int(Xp,Yp,r) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0),pch=".", main="arcs of PE-PCDs for points (jittered along y-axis)\n in end intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit)) abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of PE-PCD. int
determines the end points of the interval.
For this function, PE proximity regions are constructed data points inside or outside the interval based
on int
points with expansion parameter and centrality parameter
. That is, for this function,
arcs may exist for points in the middle or end intervals.
It also provides various descriptions and quantities about the arcs of the PE-PCD
such as number of arcs, arc density, etc.
See also (Ceyhan (2012)).
arcsPEint(Xp, int, r, c = 0.5)
arcsPEint(Xp, int, r, c = 0.5)
Xp |
A set or |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, they are expansion and centrality parameters. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization of the real line based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of PE-PCD for 1D data |
E |
Heads (or arrow ends) of the arcs of PE-PCD for 1D data |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
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.
arcsPE1D
, arcsPEmid.int
, arcsPEend.int
, and arcsCS1D
## Not run: r<-2 c<-.4 a<-0; b<-10; int<-c(a,b); #n is number of X points n<-10; #try also n<-20 xf<-(int[2]-int[1])*.1 set.seed(1) Xp<-runif(n,a-xf,b+xf) Arcs<-arcsPEint(Xp,int,r,c) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
## Not run: r<-2 c<-.4 a<-0; b<-10; int<-c(a,b); #n is number of X points n<-10; #try also n<-20 xf<-(int[2]-int[1])*.1 set.seed(1) Xp<-runif(n,a-xf,b+xf) Arcs<-arcsPEint(Xp,int,r,c) Arcs summary(Arcs) plot(Arcs) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends) for 1D data set Xp
as the vertices
of PE-PCD.
For this function, PE proximity regions are constructed with respect to the intervals
based on Yp
points with expansion parameter and centrality parameter
. That is, for this function,
arcs may exist for points only inside the intervals.
It also provides various descriptions and quantities about the arcs of the PE-PCD
such as number of arcs, arc density, etc.
Vertex regions are based on center of each middle interval.
See also (Ceyhan (2012)).
arcsPEmid.int(Xp, Yp, r, c = 0.5)
arcsPEmid.int(Xp, Yp, r, c = 0.5)
Xp |
A set or |
Yp |
A set or |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph, here, they are expansion and centrality parameters. |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the intervalization based on |
tess.name |
Name of data set used in tessellation, it is |
vertices |
Vertices of the digraph, i.e., |
vert.name |
Name of the data set which constitute the vertices of the digraph |
S |
Tails (or sources) of the arcs of PE-PCD for 1D data in the middle intervals |
E |
Heads (or arrow ends) of the arcs of PE-PCD for 1D data in the middle intervals |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of intervals, number of arcs, and arc density. |
Elvan Ceyhan
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.
arcsPEend.int
, arcsPE1D
, arcsCSmid.int
,
arcsCSend.int
and arcsCS1D
## Not run: r<-2 c<-.4 a<-0; b<-10; #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) Arcs<-arcsPEmid.int(Xp,Yp,r,c) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E arcsPEmid.int(Xp,Yp,r,c) arcsPEmid.int(Xp,Yp+10,r,c) jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), main="arcs of PE-PCD for points (jittered along y-axis)\n in middle intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) ## End(Not run)
## Not run: r<-2 c<-.4 a<-0; b<-10; #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) Arcs<-arcsPEmid.int(Xp,Yp,r,c) Arcs summary(Arcs) plot(Arcs) S<-Arcs$S E<-Arcs$E arcsPEmid.int(Xp,Yp,r,c) arcsPEmid.int(Xp,Yp+10,r,c) jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), main="arcs of PE-PCD for points (jittered along y-axis)\n in middle intervals ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0,lty=1) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) arrows(S, yjit, E, yjit, length = .05, col= 4) ## End(Not run)
An object of class "PCDs"
.
Returns arcs as tails (or sources) and heads (or arrow ends)
for data set Xp
as the vertices of PE-PCD
and related parameters and the quantities of the digraph.
PE proximity regions are constructed
with respect to the triangle tri
with expansion
parameter , i.e.,
arcs may exist only for points inside
tri
.
It also provides various descriptions
and quantities about the arcs of the PE-PCD
such as number of arcs, arc density, etc.
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
.
When the center is the circumcenter, CC
,
the vertex regions are constructed based on the
orthogonal projections to the edges,
while with any interior center M
,
the vertex regions are constructed using the extensions
of the lines combining vertices with M
.
M
-vertex regions are recommended spatial inference,
due to geometry invariance property of the arc density
and domination number the PE-PCDs based on uniform data.
See also (Ceyhan (2005); Ceyhan et al. (2006)).
arcsPEtri(Xp, tri, r, M = c(1, 1, 1))
arcsPEtri(Xp, tri, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute 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 |
A list
with the elements
type |
A description of the type of the digraph |
parameters |
Parameters of the digraph,
the center |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support triangle. |
tess.name |
Name of data set (i.e. points from the non-target class) used in the tessellation of the space (here, vertices of the triangle) |
vertices |
Vertices of the digraph, |
vert.name |
Name of the data set which constitutes the vertices of the digraph |
S |
Tails (or sources) of the arcs of PE-PCD
for 2D data set |
E |
Heads (or arrow ends) of the arcs of PE-PCD
for 2D data set |
mtitle |
Text for |
quant |
Various quantities for the digraph: number of vertices, number of partition points, number of triangles, number of arcs, and arc density. |
Elvan Ceyhan
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
arcsPE
, arcsAStri
,
and arcsCStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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 Arcs<-arcsPEtri(Xp,Tr,r,M) #or try with the default center Arcs<-arcsPEtri(Xp,Tr,r); M= (Arcs$param)$cent Arcs summary(Arcs) plot(Arcs) #can add vertex regions #but we first need to determine center is the circumcenter or not, #see the description for more detail. CC<-circumcenter.tri(Tr) if (isTRUE(all.equal(M,CC))) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) #now we can add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.02,.02,.02,.03,-.03,-.01) yc<-txt[,2]+c(.02,.02,.03,.06,.04,.05,-.07) txt.str<-c("A","B","C","M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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 Arcs<-arcsPEtri(Xp,Tr,r,M) #or try with the default center Arcs<-arcsPEtri(Xp,Tr,r); M= (Arcs$param)$cent Arcs summary(Arcs) plot(Arcs) #can add vertex regions #but we first need to determine center is the circumcenter or not, #see the description for more detail. CC<-circumcenter.tri(Tr) if (isTRUE(all.equal(M,CC))) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) #now we can add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.02,.02,.02,.03,-.03,-.01) yc<-txt[,2]+c(.02,.02,.03,.06,.04,.05,-.07) txt.str<-c("A","B","C","M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Returns the area of the polygon, h
,
in the real plane ; the vertices of the polygon
h
must be provided in clockwise or counter-clockwise order,
otherwise the function does not yield
the area of the polygon. Also, the polygon could be convex or non-convex.
See (Weisstein (2019)).
area.polygon(h)
area.polygon(h)
h |
A |
area of the polygon h
Elvan Ceyhan
Weisstein EW (2019). “Polygon Area.” From MathWorld — A Wolfram Web Resource, http://mathworld.wolfram.com/PolygonArea.html.
## Not run: A<-c(0,0); B<-c(1,0); C<-c(0.5,.8); Tr<-rbind(A,B,C); area.polygon(Tr) A<-c(0,0); B<-c(1,0); C<-c(.7,.6); D<-c(0.3,.8); h1<-rbind(A,B,C,D); #try also h1<-rbind(A,B,D,C) or h1<-rbind(A,C,B,D) or h1<-rbind(A,D,C,B); area.polygon(h1) Xlim<-range(h1[,1]) Ylim<-range(h1[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(h1,xlab="",ylab="",main="A Convex Polygon with Four Vertices", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(h1) xc<-rbind(A,B,C,D)[,1]+c(-.03,.03,.02,-.01) yc<-rbind(A,B,C,D)[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","D") text(xc,yc,txt.str) #when the triangle is degenerate, it gives zero area B<-A+2*(C-A); T2<-rbind(A,B,C) area.polygon(T2) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(0.5,.8); Tr<-rbind(A,B,C); area.polygon(Tr) A<-c(0,0); B<-c(1,0); C<-c(.7,.6); D<-c(0.3,.8); h1<-rbind(A,B,C,D); #try also h1<-rbind(A,B,D,C) or h1<-rbind(A,C,B,D) or h1<-rbind(A,D,C,B); area.polygon(h1) Xlim<-range(h1[,1]) Ylim<-range(h1[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(h1,xlab="",ylab="",main="A Convex Polygon with Four Vertices", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(h1) xc<-rbind(A,B,C,D)[,1]+c(-.03,.03,.02,-.01) yc<-rbind(A,B,C,D)[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","D") text(xc,yc,txt.str) #when the triangle is degenerate, it gives zero area B<-A+2*(C-A); T2<-rbind(A,B,C) area.polygon(T2) ## End(Not run)
Labels the vertices of triangle, tri
,
as so that
is the longest edge,
is the second longest
and
is the shortest edge
(the order is as in the basic triangle).
The standard basic triangle form is
where
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle
by a combination of rigid body motions
(i.e., translation, rotation and reflection) and scaling,
preserving uniformity of the points in the
original triangle. Hence, standard basic triangle is useful for simulation
studies under the uniformity hypothesis.
The option scaled
a logical argument
for scaling the resulting triangle or not.
If scaled=TRUE
, then the resulting triangle is scaled
to be a regular basic triangle,
i.e., longest edge having unit length,
else (i.e., if scaled=FALSE
which is the default),
the new triangle is nonscaled,
i.e., the longest edge
may not be of unit length.
The vertices of the resulting triangle (whether scaled or not) is presented
in the order of vertices of the corresponding
basic triangle, however when scaled the triangle
is equivalent to the basic triangle
up to translation and rotation.
That is, this function converts any triangle to a basic triangle
(up to translation and rotation),
so that the output triangle is $T(A',B',C')$
so that edges in decreasing length are $A'B'$, $B'C'$, and $A'C'$.
Most of the times,
the resulting triangle will still need to be translated
and/or rotated to be in the standard basic triangle form.
as.basic.tri(tri, scaled = FALSE)
as.basic.tri(tri, scaled = FALSE)
tri |
A |
scaled |
A logical argument
for scaling the resulting basic triangle.
If |
A list
with three elements
tri |
The vertices of the basic triangle stacked row-wise
and labeled row-wise as |
desc |
Description of the edges based on the vertices, i.e.,
|
orig.order |
Row order of the input triangle, |
Elvan Ceyhan
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); as.basic.tri(rbind(A,B,C)) as.basic.tri(rbind(B,C,A)) A<-c(1,1); B<-c(2,0); C<-c(1.5,2); as.basic.tri(rbind(A,B,C)) as.basic.tri(rbind(A,C,B)) as.basic.tri(rbind(B,A,C)) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); as.basic.tri(rbind(A,B,C)) as.basic.tri(rbind(B,C,A)) A<-c(1,1); B<-c(2,0); C<-c(1.5,2); as.basic.tri(rbind(A,B,C)) as.basic.tri(rbind(A,C,B)) as.basic.tri(rbind(B,A,C)) ## End(Not run)
Returns the arc density of AS-PCD whose vertex set is the given 2D numerical data set, Xp
,
(some of its members are) in the triangle tri
.
AS proximity regions is defined with respect to tri
and vertex regions are defined with the center M="CC"
for circumcenter of tri
;
or in Cartesian coordinates or
in barycentric coordinates in the
interior of the triangle
tri
; default is M="CC"
i.e., circumcenter of tri
.
For the number of arcs, loops are not allowed so arcs are only possible for points inside tri
for this function.
tri.cor
is a logical argument for triangle correction (default is TRUE
),
if TRUE
, only the points inside the triangle are considered (i.e., digraph induced by these vertices
are considered) in computing the arc density, otherwise all points are considered
(for the number of vertices in the denominator of arc density).
See also (Ceyhan (2005, 2010)).
ASarc.dens.tri(Xp, tri, M = "CC", tri.cor = FALSE)
ASarc.dens.tri(Xp, tri, M = "CC", tri.cor = FALSE)
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
tri.cor |
A logical argument for computing the arc density for only the points inside the triangle, |
Arc density of AS-PCD whose vertices are the 2D numerical data set, Xp
;
AS proximity regions are defined with respect to the triangle tri
and -vertex regions.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
ASarc.dens.tri
, CSarc.dens.tri
, and num.arcsAStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); set.seed(1) n<-10 #try also n<-20 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) num.arcsAStri(Xp,Tr,M) ASarc.dens.tri(Xp,Tr,M) ASarc.dens.tri(Xp,Tr,M,tri.cor = FALSE) ASarc.dens.tri(Xp,Tr,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); set.seed(1) n<-10 #try also n<-20 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) num.arcsAStri(Xp,Tr,M) ASarc.dens.tri(Xp,Tr,M) ASarc.dens.tri(Xp,Tr,M,tri.cor = FALSE) ASarc.dens.tri(Xp,Tr,M) ## End(Not run)
Returns the centers
which yield nondegenerate asymptotic distribution for the domination number
of PE-PCD for uniform data in a triangle,
tri
.
PE proximity region is defined with
respect to the triangle tri
with expansion parameter r
in .
Vertex regions are defined with the centers
that are output of this function.
Centers are stacked row-wise
with row number is corresponding to the vertex
row number in tri
(see the examples for an illustration). The center labels 1,2,3 correspond
to the vertices ,
, and
(which are the three centers for
r
in
which becomes center of mass
for
.).
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)).
center.nondegPE(tri, r)
center.nondegPE(tri, r)
tri |
A |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
The centers (stacked row-wise)
which give nondegenerate asymptotic distribution
for the domination number of PE-PCD for uniform data in a triangle, tri
.
Elvan Ceyhan
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.
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); r<-1.35 Ms<-center.nondegPE(Tr,r) Ms Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Centers of nondegeneracy\n for the PE-PCD in a triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Ms,pch=".",col=1) polygon(Ms,lty = 2) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.03) txt.str<-c("A","B","C") text(xc,yc,txt.str) xc<-Ms[,1]+c(-.04,.04,.03) yc<-Ms[,2]+c(.02,.02,.05) txt.str<-c("M1","M2","M3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); r<-1.35 Ms<-center.nondegPE(Tr,r) Ms Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Centers of nondegeneracy\n for the PE-PCD in a triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Ms,pch=".",col=1) polygon(Ms,lty = 2) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.03) txt.str<-c("A","B","C") text(xc,yc,txt.str) xc<-Ms[,1]+c(-.04,.04,.03) yc<-Ms[,2]+c(.02,.02,.05) txt.str<-c("M1","M2","M3") text(xc,yc,txt.str) ## End(Not run)
Returns the (parameterized) center, ,
of the interval,
int
,
parameterized by
so that
% of the length of interval is to the left of
and
% of the length of the interval
is to the right of
.
That is, for the interval,
int
,
the parameterized center is
.
See also (Ceyhan (2012, 2016)).
centerMc(int, c = 0.5)
centerMc(int, c = 0.5)
int |
A |
c |
A positive real number in |
(parameterized) center inside int
Elvan Ceyhan
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.
c<-.4 a<-0; b<-10 int = c(a,b) centerMc(int,c) c<-.3 a<-2; b<-4; int<-c(a,b) centerMc(int,c)
c<-.4 a<-0; b<-10 int = c(a,b) centerMc(int,c) c<-.3 a<-2; b<-4; int<-c(a,b) centerMc(int,c)
Returns the centers of the intervals based on
1D points in Yp
parameterized by
so that
% of the length of interval is to the left of
and
% of the length of the interval
is to the right of
. That is, for an interval
,
the parameterized center is
Yp
is a vector
of 1D points, not necessarily sorted.
See also (Ceyhan (2012, 2016)).
centersMc(Yp, c = 0.5)
centersMc(Yp, c = 0.5)
Yp |
A |
c |
A positive real number in |
(parameterized) centers of the intervals
based on Yp
points as a vector
Elvan Ceyhan
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.
## Not run: n<-10 c<-.4 #try also c<-runif(1) Yp<-runif(n) centersMc(Yp,c) c<-.3 #try also c<-runif(1) Yp<-runif(n,0,10) centersMc(Yp,c) ## End(Not run)
## Not run: n<-10 c<-.4 #try also c<-runif(1) Yp<-runif(n) centersMc(Yp,c) c<-.3 #try also c<-runif(1) Yp<-runif(n,0,10) centersMc(Yp,c) ## End(Not run)
Returns the circumcenter of
a standard basic triangle form
given
,
where
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See (Weisstein (2019); Ceyhan (2010)) for triangle centers and (Ceyhan et al. (2006); Ceyhan et al. (2007); Ceyhan (2011)) for the standard basic triangle form.
circumcenter.basic.tri(c1, c2)
circumcenter.basic.tri(c1, c2)
c1 , c2
|
Positive real numbers representing the top vertex
in standard basic triangle form |
circumcenter of the standard basic triangle form
given
,
as the arguments of the function.
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Weisstein EW (2019).
“Triangle Centers.”
From MathWorld — A Wolfram Web Resource, http://mathworld.wolfram.com/TriangleCenter.html.
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle form Tb Tb<-rbind(A,B,C) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] par(pty = "s") plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(rbind(CC)) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.04,.03,.06,.06,-.03,0) yc<-txt[,2]+c(.02,.02,.03,-.03,.02,.04,-.03) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) #for an obtuse triangle c1<-.4; c2<-.3; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle form Tb Tb<-rbind(A,B,C) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],CC[1]) Ylim<-range(Tb[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] par(pty = "s") plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(rbind(CC)) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.03,.03,.07,.07,-.05,0) yc<-txt[,2]+c(.02,.02,.04,-.03,.03,.04,.06) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle form Tb Tb<-rbind(A,B,C) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] par(pty = "s") plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(rbind(CC)) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.04,.03,.06,.06,-.03,0) yc<-txt[,2]+c(.02,.02,.03,-.03,.02,.04,-.03) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) #for an obtuse triangle c1<-.4; c2<-.3; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle form Tb Tb<-rbind(A,B,C) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],CC[1]) Ylim<-range(Tb[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] par(pty = "s") plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(rbind(CC)) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.03,.03,.07,.07,-.05,0) yc<-txt[,2]+c(.02,.02,.04,-.03,.03,.04,.06) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Returns the circumcenter a given tetrahedron th
with vertices stacked row-wise.
circumcenter.tetra(th)
circumcenter.tetra(th)
th |
A |
circumcenter of the tetrahedron th
Elvan Ceyhan
## Not run: set.seed(123) A<-c(0,0,0)+runif(3,-.2,.2); B<-c(1,0,0)+runif(3,-.2,.2); C<-c(1/2,sqrt(3)/2,0)+runif(3,-.2,.2); D<-c(1/2,sqrt(3)/6,sqrt(6)/3)+runif(3,-.2,.2); tetra<-rbind(A,B,C,D) CC<-circumcenter.tetra(tetra) CC Xlim<-range(tetra[,1],CC[1]) Ylim<-range(tetra[,2],CC[2]) Zlim<-range(tetra[,3],CC[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(tetra[,1],tetra[,2],tetra[,3], phi =0,theta=40, bty = "g", main="Illustration of the Circumcenter\n in a Tetrahedron", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(CC[1],CC[2],CC[3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CC,6),byrow = TRUE,ncol=3) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty = 2) plot3D::text3D(CC[1],CC[2],CC[3], labels="CC", add=TRUE) ## End(Not run)
## Not run: set.seed(123) A<-c(0,0,0)+runif(3,-.2,.2); B<-c(1,0,0)+runif(3,-.2,.2); C<-c(1/2,sqrt(3)/2,0)+runif(3,-.2,.2); D<-c(1/2,sqrt(3)/6,sqrt(6)/3)+runif(3,-.2,.2); tetra<-rbind(A,B,C,D) CC<-circumcenter.tetra(tetra) CC Xlim<-range(tetra[,1],CC[1]) Ylim<-range(tetra[,2],CC[2]) Zlim<-range(tetra[,3],CC[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(tetra[,1],tetra[,2],tetra[,3], phi =0,theta=40, bty = "g", main="Illustration of the Circumcenter\n in a Tetrahedron", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(CC[1],CC[2],CC[3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CC,6),byrow = TRUE,ncol=3) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty = 2) plot3D::text3D(CC[1],CC[2],CC[3], labels="CC", add=TRUE) ## End(Not run)
Returns the circumcenter a given triangle, tri
,
with vertices stacked row-wise.
See (Weisstein (2019); Ceyhan (2010))
for triangle centers.
circumcenter.tri(tri)
circumcenter.tri(tri)
tri |
A |
circumcenter of the triangle tri
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Weisstein EW (2019).
“Triangle Centers.”
From MathWorld — A Wolfram Web Resource, http://mathworld.wolfram.com/TriangleCenter.html.
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); #the vertices of the triangle Tr CC<-circumcenter.tri(Tr) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],CC[1]) Ylim<-range(Tr[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,asp=1,pch=".",xlab="",ylab="",main="Circumcenter of a triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(rbind(CC)) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.08,.08,.08,.12,-.09,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,-.06,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); #the vertices of the equilateral triangle Te circumcenter.tri(Te) #the circumcenter A<-c(0,0); B<-c(0,1); C<-c(2,0); Tr<-rbind(A,B,C); #the vertices of the triangle T circumcenter.tri(Tr) #the circumcenter ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); #the vertices of the triangle Tr CC<-circumcenter.tri(Tr) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],CC[1]) Ylim<-range(Tr[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,asp=1,pch=".",xlab="",ylab="",main="Circumcenter of a triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(rbind(CC)) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.08,.08,.08,.12,-.09,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,-.06,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); #the vertices of the equilateral triangle Te circumcenter.tri(Te) #the circumcenter A<-c(0,0); B<-c(0,1); C<-c(2,0); Tr<-rbind(A,B,C); #the vertices of the triangle T circumcenter.tri(Tr) #the circumcenter ## End(Not run)
-vertex region
in a triangleAn object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
to circumcenter, , in each
-vertex region
in the triangle
tri
(vertex 1,vertex 2,vertex 3).
ch.all.intri
is for checking whether all data points are
inside tri
(default is FALSE
).
If some of the data points are not inside tri
and ch.all.intri=TRUE
, then the function yields
an error message.
If some of the data points are not inside tri
and ch.all.intri=FALSE
, then the function yields
the closest points to among the data points
in each
-vertex region of
tri
(yields NA
if
there are no data points inside tri
).
See also (Ceyhan (2005, 2012)).
cl2CCvert.reg(Xp, tri, ch.all.intri = FALSE)
cl2CCvert.reg(Xp, tri, ch.all.intri = FALSE)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
ch.all.intri |
A logical argument (default= |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
mtitle |
The |
ext |
The extrema points, here,
closest points to |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points,
here, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from closest points
in each |
Elvan Ceyhan
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 (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.
cl2CCvert.reg.basic.tri
, cl2edges.vert.reg.basic.tri
,
cl2edgesMvert.reg
, cl2edgesCMvert.reg
,
and fr2edgesCMedge.reg.std.tri
## Not run: 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 Ext<-cl2CCvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) c2CC<-Ext CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main="Closest Points in CC-Vertex Regions \n to the Circumcenter", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(c2CC$ext,pch=4,col=2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.07,.08,.06,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) Xp2<-rbind(Xp,c(.2,.4)) cl2CCvert.reg(Xp2,Tr,ch.all.intri = FALSE) #gives an error message if ch.all.intri = TRUE since not all points are in the triangle ## End(Not run)
## Not run: 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 Ext<-cl2CCvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) c2CC<-Ext CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main="Closest Points in CC-Vertex Regions \n to the Circumcenter", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(c2CC$ext,pch=4,col=2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.07,.08,.06,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) Xp2<-rbind(Xp,c(.2,.4)) cl2CCvert.reg(Xp2,Tr,ch.all.intri = FALSE) #gives an error message if ch.all.intri = TRUE since not all points are in the triangle ## End(Not run)
-vertex region
in a standard basic triangleAn object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
to circumcenter, , in each
-vertex region
in the standard basic triangle
(vertex 1,vertex 2,vertex 3).
ch.all.intri
is for
checking whether all data points are inside
(default is
FALSE
).
See also (Ceyhan (2005, 2012)).
cl2CCvert.reg.basic.tri(Xp, c1, c2, ch.all.intri = FALSE)
cl2CCvert.reg.basic.tri(Xp, c1, c2, ch.all.intri = FALSE)
Xp |
A set of 2D points representing the set of data points. |
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle.
adjacent to the shorter edges; |
ch.all.intri |
A logical argument for
checking whether all data points are inside |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
mtitle |
The |
ext |
The extrema points, here,
closest points to |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, here, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from closest points in each vertex region to CC. |
Elvan Ceyhan
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 (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.
cl2CCvert.reg
, cl2edges.vert.reg.basic.tri
,
cl2edgesMvert.reg
, cl2edgesCMvert.reg
,
and fr2edgesCMedge.reg.std.tri
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-15 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g Ext<-cl2CCvert.reg.basic.tri(Xp,c1,c2) Ext summary(Ext) plot(Ext) c2CC<-Ext CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main="Closest Points in CC-Vertex Regions \n to the Circumcenter", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(c2CC$ext,pch=4,col=2) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,.02,.07,.06,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,-.01,.03,.03,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) Xp2<-rbind(Xp,c(.2,.4)) cl2CCvert.reg.basic.tri(Xp2,c1,c2,ch.all.intri = FALSE) #gives an error message if ch.all.intri = TRUE #since not all points are in the standard basic triangle ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-15 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g Ext<-cl2CCvert.reg.basic.tri(Xp,c1,c2) Ext summary(Ext) plot(Ext) c2CC<-Ext CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main="Closest Points in CC-Vertex Regions \n to the Circumcenter", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(c2CC$ext,pch=4,col=2) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,.02,.07,.06,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,-.01,.03,.03,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) Xp2<-rbind(Xp,c(.2,.4)) cl2CCvert.reg.basic.tri(Xp2,c1,c2,ch.all.intri = FALSE) #gives an error message if ch.all.intri = TRUE #since not all points are in the standard basic triangle ## End(Not run)
An object of class "Extrema"
.
Returns the closest points from the 2D data set, Xp
,
to the edges in the
standard equilateral triangle
.
ch.all.intri
is for checking
whether all data points are inside (default is
FALSE
).
If some of the data points are not inside
and
ch.all.intri=TRUE
, then the function yields
an error message.
If some of the data points are not inside
and
ch.all.intri=FALSE
, then the function yields
the closest points to edges
among the data points inside (yields
NA
if there are no data points
inside ).
See also (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan and Priebe (2007)).
cl2edges.std.tri(Xp, ch.all.intri = FALSE)
cl2edges.std.tri(Xp, ch.all.intri = FALSE)
Xp |
A set of 2D points representing the set of data points. |
ch.all.intri |
A logical argument (default= |
A list
with the elements
txt1 |
Edge labels as |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, i.e., closest points to edges |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, i.e.,
the standard equilateral triangle |
cent |
The center point used for construction of edge regions,
not required for this extrema,
hence it is |
ncent |
Name of the center, |
regions |
Edge regions inside the triangle, |
region.names |
Names of the edge regions,
not required for this extrema,
hence it is |
region.centers |
Centers of mass of the edge regions inside |
dist2ref |
Distances from closest points in each edge region to the corresponding edge |
Elvan Ceyhan
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, 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.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
cl2edges.vert.reg.basic.tri
, cl2edgesMvert.reg
,
cl2edgesCMvert.reg
and fr2edgesCMedge.reg.std.tri
## Not run: n<-20 #try also n<-100 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext summary(Ext) plot(Ext,asp=1) ed.clo<-Ext A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 p1<-(A+B)/2 p2<-(B+C)/2 p3<-(A+C)/2 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,xlab="",ylab="") points(ed.clo$ext,pty=2,pch=4,col="red") txt<-rbind(Te,p1,p2,p3) xc<-txt[,1]+c(-.03,.03,.03,0,0,0) yc<-txt[,2]+c(.02,.02,.02,0,0,0) txt.str<-c("A","B","C","re=1","re=2","re=3") text(xc,yc,txt.str) ## End(Not run)
## Not run: n<-20 #try also n<-100 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext summary(Ext) plot(Ext,asp=1) ed.clo<-Ext A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 p1<-(A+B)/2 p2<-(B+C)/2 p3<-(A+C)/2 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,xlab="",ylab="") points(ed.clo$ext,pty=2,pch=4,col="red") txt<-rbind(Te,p1,p2,p3) xc<-txt[,1]+c(-.03,.03,.03,0,0,0) yc<-txt[,2]+c(.02,.02,.02,0,0,0) txt.str<-c("A","B","C","re=1","re=2","re=3") text(xc,yc,txt.str) ## End(Not run)
An object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
to edge in
M
-vertex region for
in the standard basic triangle
where
is in
,
and
.
Vertex labels are
,
, and
,
and corresponding edge labels are
,
, and
.
Vertex regions are based on center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the standard basic triangle
or based on the circumcenter of
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010)).
cl2edges.vert.reg.basic.tri(Xp, c1, c2, M)
cl2edges.vert.reg.basic.tri(Xp, c1, c2, M)
Xp |
A set of 2D points representing the set of data points. |
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle
adjacent to the shorter edges; |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard basic triangle |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, closest points to edges in the corresponding vertex region. |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, here, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances of closest points in the vertex regions to corresponding edges. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
cl2edgesCMvert.reg
, cl2edgesMvert.reg
,
and cl2edges.std.tri
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); set.seed(1) n<-20 Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.3) Ext<-cl2edges.vert.reg.basic.tri(Xp,c1,c2,M) Ext summary(Ext) plot(Ext) cl2e<-Ext Ds<-prj.cent2edges.basic.tri(c1,c2,M) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,pch=".",xlab="",ylab="", main="Closest Points in M-Vertex Regions \n to the Opposite Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) 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(cl2e$ext,pch=3,col=2) xc<-Tb[,1]+c(-.02,.02,0.02) yc<-Tb[,2]+c(.02,.02,.02) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.03,0) yc<-txt[,2]+c(-.02,.02,.02,-.03) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); set.seed(1) n<-20 Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.3) Ext<-cl2edges.vert.reg.basic.tri(Xp,c1,c2,M) Ext summary(Ext) plot(Ext) cl2e<-Ext Ds<-prj.cent2edges.basic.tri(c1,c2,M) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,pch=".",xlab="",ylab="", main="Closest Points in M-Vertex Regions \n to the Opposite Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) 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(cl2e$ext,pch=3,col=2) xc<-Tb[,1]+c(-.02,.02,0.02) yc<-Tb[,2]+c(.02,.02,.02) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.03,0) yc<-txt[,2]+c(-.02,.02,.02,-.03) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
-vertex region in a triangleAn object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
to edge in
-vertex region
for
in the triangle,
tri
,
where
stands for circumcenter.
Vertex labels are
,
, and
,
and corresponding edge labels are
,
, and
.
Function yields
NA
if there are no data points in a -vertex region.
See also (Ceyhan (2005, 2010)).
cl2edgesCCvert.reg(Xp, tri)
cl2edgesCCvert.reg(Xp, tri)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, closest points to edges in the respective vertex region. |
ind.ext |
Indices of the extrema points, |
X |
The input data, |
num.points |
The number of data points,
i.e., size of |
supp |
Support of the data points,
here, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances of closest points in the vertex regions to corresponding edges |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
cl2edges.vert.reg.basic.tri
, cl2edgesCMvert.reg
,
cl2edgesMvert.reg
, and cl2edges.std.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-20 #try also n<-100 set.seed(1) Xp<-runif.tri(n,Tr)$g Ext<-cl2edgesCCvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) cl2e<-Ext CC<-circumcenter.tri(Tr); D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1],CC[1]) Ylim<-range(Tr[,2],Xp[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,asp=1,pch=".",xlab="",ylab="", main="Closest Points in CC-Vertex Regions \n to the Opposite Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) points(Xp,pch=1,col=1) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(cl2e$ext,pch=3,col=2) txt<-rbind(CC,Ds) xc<-txt[,1]+c(-.04,.04,-.03,0) yc<-txt[,2]+c(-.05,.04,.06,-.08) txt.str<-c("CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-20 #try also n<-100 set.seed(1) Xp<-runif.tri(n,Tr)$g Ext<-cl2edgesCCvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) cl2e<-Ext CC<-circumcenter.tri(Tr); D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1],CC[1]) Ylim<-range(Tr[,2],Xp[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,asp=1,pch=".",xlab="",ylab="", main="Closest Points in CC-Vertex Regions \n to the Opposite Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) points(Xp,pch=1,col=1) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(cl2e$ext,pch=3,col=2) txt<-rbind(CC,Ds) xc<-txt[,1]+c(-.04,.04,-.03,0) yc<-txt[,2]+c(-.05,.04,.06,-.08) txt.str<-c("CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
-vertex region in a triangleAn object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
to edge in
-vertex region
for
in the triangle,
tri
,
where
stands for center of mass.
Vertex labels are
,
, and
,
and corresponding edge labels are
,
, and
.
Function yields
NA
if there are no data points in a -vertex region.
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2010, 2011)).
cl2edgesCMvert.reg(Xp, tri)
cl2edgesCMvert.reg(Xp, tri)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, closest points to edges in the respective vertex region. |
X |
The input data, |
num.points |
The number of data points,
i.e., size of |
supp |
Support of the data points,
here, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances of closest points in the vertex regions to corresponding edges |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, 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.
cl2edges.vert.reg.basic.tri
, cl2edgesCCvert.reg
,
cl2edgesMvert.reg
, and cl2edges.std.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-20 #try also n<-100 set.seed(1) Xp<-runif.tri(n,Tr)$g Ext<-cl2edgesCMvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) cl2e<-Ext CM<-(A+B+C)/3; D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Closest Points in CM-Vertex Regions \n to the Opposite Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) points(Xp,pch=1,col=1) L<-matrix(rep(CM,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(cl2e$ext,pch=3,col=2) txt<-rbind(CM,Ds) xc<-txt[,1]+c(-.04,.04,-.03,0) yc<-txt[,2]+c(-.05,.04,.06,-.08) txt.str<-c("CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-20 #try also n<-100 set.seed(1) Xp<-runif.tri(n,Tr)$g Ext<-cl2edgesCMvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) cl2e<-Ext CM<-(A+B+C)/3; D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Closest Points in CM-Vertex Regions \n to the Opposite Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) points(Xp,pch=1,col=1) L<-matrix(rep(CM,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(cl2e$ext,pch=3,col=2) txt<-rbind(CM,Ds) xc<-txt[,1]+c(-.04,.04,-.03,0) yc<-txt[,2]+c(-.05,.04,.06,-.08) txt.str<-c("CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
An object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
to edge in
M
-vertex region for
in the triangle
tri
.
Vertex labels are
,
, and
,
and corresponding edge labels are
,
, 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
.
Two methods of finding these extrema are provided in the function,
which can be chosen in the logical argument alt
,
whose default is alt=FALSE
.
When alt=FALSE
, the function sequentially finds
the vertex region of the data point and then updates the minimum distance
to the opposite edge and the relevant extrema objects,
and when alt=TRUE
, it first partitions the data set according
which vertex regions they reside, and
then finds the minimum distance to the opposite edge
and the relevant extrema on each partition.
Both options yield equivalent results for the extrema points and indices,
with the default being slightly ~ 20
See also (Ceyhan (2005, 2010)).
cl2edgesMvert.reg(Xp, tri, M, alt = FALSE)
cl2edgesMvert.reg(Xp, tri, M, alt = FALSE)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
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 |
alt |
A logical argument for alternative method of
finding the closest points to the edges,
default |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, closest points to edges in the respective vertex region. |
ind.ext |
The data indices of extrema points, |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, here, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions
inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances of closest points
in the |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
cl2edges.vert.reg.basic.tri
, cl2edgesCMvert.reg
,
and cl2edges.std.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-20 #try also n<-100 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) Ext<-cl2edgesMvert.reg(Xp,Tr,M) Ext summary(Ext) plot(Ext) cl2e<-Ext Ds<-prj.cent2edges(Tr,M) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Closest Points in M-Vertex Regions \n to the Opposite Edges", 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(cl2e$ext,pch=3,col=2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.05,-.02,-.01) yc<-txt[,2]+c(-.03,.02,.08,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-20 #try also n<-100 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) Ext<-cl2edgesMvert.reg(Xp,Tr,M) Ext summary(Ext) plot(Ext) cl2e<-Ext Ds<-prj.cent2edges(Tr,M) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Closest Points in M-Vertex Regions \n to the Opposite Edges", 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(cl2e$ext,pch=3,col=2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.05,-.02,-.01) yc<-txt[,2]+c(-.03,.02,.08,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
An object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
to face in
M
-vertex region for
in the tetrahedron
.
Vertex labels are
,
,
, and
and corresponding face labels are
,
,
, and
.
Vertex regions are based on center M
which can be the center of mass ("CM"
)
or circumcenter ("CC"
) of th
.
cl2faces.vert.reg.tetra(Xp, th, M = "CM")
cl2faces.vert.reg.tetra(Xp, th, M = "CM")
Xp |
A set of 3D points representing the set of data points. |
th |
A |
M |
The center to be used in the construction of the vertex regions
in the tetrahedron, |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, closest points to faces in the respective vertex region. |
ind.ext |
The data indices of extrema points, |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points,
here, it is |
cent |
The center point used for construction of vertex regions, it is circumcenter of center of mass for this function |
ncent |
Name of the center, it is circumcenter |
regions |
Vertex regions
inside the tetrahedron |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from closest points in each vertex region to the corresponding face. |
Elvan Ceyhan
fr2vertsCCvert.reg
, fr2edgesCMedge.reg.std.tri
,
fr2vertsCCvert.reg.basic.tri
and kfr2vertsCCvert.reg
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) set.seed(1) tetra<-rbind(A,B,C,D)+matrix(runif(12,-.25,.25),ncol=3) n<-10 #try also n<-20 Cent<-"CC" #try also "CM" n<-20 #try also n<-100 Xp<-runif.tetra(n,tetra)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) Ext<-cl2faces.vert.reg.tetra(Xp,tetra,Cent) Ext summary(Ext) plot(Ext) clf<-Ext$ext if (Cent=="CC") {M<-circumcenter.tetra(tetra)} if (Cent=="CM") {M<-apply(tetra,2,mean)} Xlim<-range(tetra[,1],Xp[,1],M[1]) Ylim<-range(tetra[,2],Xp[,2],M[2]) Zlim<-range(tetra[,3],Xp[,3],M[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =0,theta=40, bty = "g", main="Closest Pointsin CC-Vertex Regions \n to the Opposite Faces", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::points3D(clf[,1],clf[,2],clf[,3], pch=4,col="red", add=TRUE) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) #for center of mass use #Cent<-apply(tetra,2,mean) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-rbind(M,M,M,M,M,M) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty=2) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) set.seed(1) tetra<-rbind(A,B,C,D)+matrix(runif(12,-.25,.25),ncol=3) n<-10 #try also n<-20 Cent<-"CC" #try also "CM" n<-20 #try also n<-100 Xp<-runif.tetra(n,tetra)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) Ext<-cl2faces.vert.reg.tetra(Xp,tetra,Cent) Ext summary(Ext) plot(Ext) clf<-Ext$ext if (Cent=="CC") {M<-circumcenter.tetra(tetra)} if (Cent=="CM") {M<-apply(tetra,2,mean)} Xlim<-range(tetra[,1],Xp[,1],M[1]) Ylim<-range(tetra[,2],Xp[,2],M[2]) Zlim<-range(tetra[,3],Xp[,3],M[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =0,theta=40, bty = "g", main="Closest Pointsin CC-Vertex Regions \n to the Opposite Faces", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::points3D(clf[,1],clf[,2],clf[,3], pch=4,col="red", add=TRUE) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) #for center of mass use #Cent<-apply(tetra,2,mean) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-rbind(M,M,M,M,M,M) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty=2) ## End(Not run)
An object of class "Extrema"
.
Returns the closest data points among the data set, Xp
,
in each -vertex region
i.e., finds the closest points from right and left to
among points of the 1D data set
Xp
which reside in
in the interval int
.
is based on the centrality parameter
,
so that
% of the length of interval is to the left of
and
% of the length of the interval
is to the right of
.
That is, for the interval
,
.
If there are no points from
Xp
to
the left of in the interval, then it yields
NA
,
and likewise for the right of in the interval.
See also (Ceyhan (2012)).
cl2Mc.int(Xp, int, c)
cl2Mc.int(Xp, int, c)
Xp |
A set or |
int |
A |
c |
A positive real number in |
A list
with the elements
txt1 |
Vertex Labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here,
closest points to |
ind.ext |
The data indices of extrema points, |
X |
The input data vector, |
num.points |
The number of data points,
i.e., size of |
supp |
Support of the data points,
here, it is |
cent |
The (parameterized) center point used for construction of vertex regions. |
ncent |
Name of the (parameterized) center, |
regions |
Vertex regions inside the interval, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from closest points
in each vertex region to |
Elvan Ceyhan
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.
cl2CCvert.reg.basic.tri
and cl2CCvert.reg
## Not run: c<-.4 a<-0; b<-10; int<-c(a,b) Mc<-centerMc(int,c) nx<-10 xr<-range(a,b,Mc) xf<-(xr[2]-xr[1])*.5 Xp<-runif(nx,a,b) Ext<-cl2Mc.int(Xp,int,c) Ext summary(Ext) plot(Ext) cMc<-Ext Xlim<-range(a,b,Xp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0),xlab="",pch=".", main=paste("Closest Points in Mc-Vertex Regions \n to the Center Mc = ",Mc,sep=""), xlim=Xlim+xd*c(-.05,.05)) abline(h=0) abline(v=c(a,b,Mc),col=c(1,1,2),lty=2) points(cbind(Xp,0)) points(cbind(c(cMc$ext),0),pch=4,col=2) text(cbind(c(a,b,Mc)-.02*xd,-0.05),c("a","b",expression(M[c]))) ## End(Not run)
## Not run: c<-.4 a<-0; b<-10; int<-c(a,b) Mc<-centerMc(int,c) nx<-10 xr<-range(a,b,Mc) xf<-(xr[2]-xr[1])*.5 Xp<-runif(nx,a,b) Ext<-cl2Mc.int(Xp,int,c) Ext summary(Ext) plot(Ext) cMc<-Ext Xlim<-range(a,b,Xp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0),xlab="",pch=".", main=paste("Closest Points in Mc-Vertex Regions \n to the Center Mc = ",Mc,sep=""), xlim=Xlim+xd*c(-.05,.05)) abline(h=0) abline(v=c(a,b,Mc),col=c(1,1,2),lty=2) points(cbind(Xp,0)) points(cbind(c(cMc$ext),0),pch=4,col=2) text(cbind(c(a,b,Mc)-.02*xd,-0.05),c("a","b",expression(M[c]))) ## End(Not run)
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 convex hull 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 2D data
in the convex hull of Yp
points.
The function yields the test statistic, -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 convex hull 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 triangles, or segregation).
CS proximity region is constructed with the expansion parameter and
-edge regions
(i.e., the test is not available for a general center
at this version of the function).
**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
has a substantial overlap.
Currently, the Xp
points outside the convex hull of Yp
points are handled with a convex hull correction factor
(see the description below and the function code.)
However, in the special case of no Xp
points in the convex hull 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.
ch.cor
is for convex hull correction (default is "no convex hull correction"
, i.e., ch.cor=FALSE
)
which is recommended when both Xp
and Yp
have the same rectangular support.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
CSarc.dens.test( Xp, Yp, t, ch.cor = FALSE, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
CSarc.dens.test( Xp, Yp, t, ch.cor = FALSE, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
ch.cor |
A logical argument for convex hull correction, default |
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
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
PEarc.dens.test
and CSarc.dens.test1D
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab = "") CSarc.dens.test(Xp,Yp,t=.5) CSarc.dens.test(Xp,Yp,t=.5,ch=TRUE) #try also t=1.0 and 1.5 above ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab = "") CSarc.dens.test(Xp,Yp,t=.5) CSarc.dens.test(Xp,Yp,t=.5,ch=TRUE) #try also t=1.0 and 1.5 above ## End(Not run)
An object of class "htest"
(i.e., hypothesis test) function which performs a hypothesis test of uniformity of 1D
data in one interval based on the normal approximation of the arc density of the CS-PCD with expansion
parameter and centrality parameter
.
The function yields the test statistic, -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.
The null hypothesis is that data is
uniform in a finite interval (i.e., arc density of CS-PCD equals to its expected value under uniform
distribution) and alternative
could be two-sided, or left-sided (i.e., data is accumulated around the end
points) or right-sided (i.e., data is accumulated around the mid point or center ).
See also (Ceyhan (2016)).
CSarc.dens.test.int( Xp, int, t, c = 0.5, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
CSarc.dens.test.int( Xp, int, t, c = 0.5, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
Xp |
A set or |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
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 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
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) n<-10 Xp<-runif(n,a,b) num.arcsCSmid.int(Xp,int,t,c) CSarc.dens.test.int(Xp,int,t,c) num.arcsCSmid.int(Xp,int,t,c=.3) CSarc.dens.test.int(Xp,int,t,c=.3) num.arcsCSmid.int(Xp,int,t=1.5,c) CSarc.dens.test.int(Xp,int,t=1.5,c) Xp<-runif(n,a-1,b+1) num.arcsCSmid.int(Xp,int,t,c) CSarc.dens.test.int(Xp,int,t,c) c<-.4 t<-.5 a<-0; b<-10; int<-c(a,b) n<-10 #try also n<-20 Xp<-runif(n,a,b) CSarc.dens.test.int(Xp,int,t,c)
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) n<-10 Xp<-runif(n,a,b) num.arcsCSmid.int(Xp,int,t,c) CSarc.dens.test.int(Xp,int,t,c) num.arcsCSmid.int(Xp,int,t,c=.3) CSarc.dens.test.int(Xp,int,t,c=.3) num.arcsCSmid.int(Xp,int,t=1.5,c) CSarc.dens.test.int(Xp,int,t=1.5,c) Xp<-runif(n,a-1,b+1) num.arcsCSmid.int(Xp,int,t,c) CSarc.dens.test.int(Xp,int,t,c) c<-.4 t<-.5 a<-0; b<-10; int<-c(a,b) n<-10 #try also n<-20 Xp<-runif(n,a,b) CSarc.dens.test.int(Xp,int,t,c)
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, -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 and centrality parameter
c
which yields
-vertex regions. More precisely, for a middle interval
, the center is
for the centrality parameter
.
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 )
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
There are no references for Rd macro \insertAllCites
on this help page.
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)
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)
Returns the arc density of CS-PCD whose vertex set is the given 2D numerical data set, Xp
,
(some of its members are) in the triangle tri
.
CS proximity regions is defined with respect to tri
with
expansion parameter and edge regions are based on center
in Cartesian coordinates or
in barycentric coordinates in the interior of the triangle
tri
; default is
i.e., the center of mass of
tri
.
The function also provides arc density standardized by the mean and asymptotic variance of the arc density
of CS-PCD for uniform data in the triangle tri
only when M
is the center of mass. For the number of arcs, loops are not allowed.
tri.cor
is a logical argument for triangle correction (default is TRUE
), if TRUE
, only the points inside the
triangle are considered (i.e., digraph induced by these vertices are considered) in computing the arc density,
otherwise all points are considered (for the number of vertices in the denominator of arc density).
See (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)) for more on CS-PCDs.
CSarc.dens.tri(Xp, tri, t, M = c(1, 1, 1), tri.cor = FALSE)
CSarc.dens.tri(Xp, tri, t, M = c(1, 1, 1), tri.cor = FALSE)
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
tri.cor |
A logical argument for computing the arc density for only the points inside the triangle,
|
A list
with the elements
arc.dens |
Arc density of CS-PCD whose vertices are the 2D numerical data set, |
std.arc.dens |
Arc density standardized by the mean and asymptotic variance of the arc
density of CS-PCD for uniform data in the triangle |
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
ASarc.dens.tri
, PEarc.dens.tri
, and num.arcsCStri
## Not run: 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) CSarc.dens.tri(Xp,Tr,t=.5,M) CSarc.dens.tri(Xp,Tr,t=.5,M,tri.cor = FALSE) #try also t=1 and t=1.5 above ## End(Not run)
## Not run: 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) CSarc.dens.tri(Xp,Tr,t=.5,M) CSarc.dens.tri(Xp,Tr,t=.5,M,tri.cor = FALSE) #try also t=1 and t=1.5 above ## End(Not run)
vector
or matrix or a data frameReturns the dimension (i.e., number of columns) of x
,
which is a matrix or a vector
or a data frame.
This is different than the dim
function in base R
,
in the sense that,
dimension
gives only the number of columns of the argument x
,
while dim
gives the number of rows and
columns of x
.
dimension
also works for a scalar or a vector,
while dim
yields NULL
for such arguments.
dimension(x)
dimension(x)
x |
A |
Dimension (i.e., number of columns) of x
Elvan Ceyhan
is.point
and dim
from the base distribution of R
## Not run: dimension(3) dim(3) A<-c(1,2) dimension(A) dim(A) B<-c(2,3) dimension(rbind(A,B,A)) dimension(cbind(A,B,A)) M<-matrix(runif(20),ncol=5) dimension(M) dim(M) dimension(c("a","b")) ## End(Not run)
## Not run: dimension(3) dim(3) A<-c(1,2) dimension(A) dim(A) B<-c(2,3) dimension(rbind(A,B,A)) dimension(cbind(A,B,A)) M<-matrix(runif(20),ncol=5) dimension(M) dim(M) dimension(c("a","b")) ## End(Not run)
Returns the Euclidean distance between x
and y
which can be vectors
or matrices or data frames of any dimension (x
and y
should be of same dimension).
This function is different from the dist
function
in the stats
package of the standard R
distribution.
dist
requires its argument to be a data matrix
and dist
computes
and returns the distance matrix computed
by using the specified distance measure
to compute the distances between the rows of a data matrix
(Becker et al. (1988)),
while Dist
needs two arguments to find the distances between.
For two data matrices and
,
dist(rbind(as.vector(A), as.vector(B)))
and Dist(A,B)
yield the same result.
Dist(x, y)
Dist(x, y)
x , y
|
Vectors, matrices or data frames (both should be of the same type). |
Euclidean distance between x
and y
Elvan Ceyhan
Becker RA, Chambers JM, Wilks AR (1988). The New S Language. Wadsworth & Brooks/Cole.
dist
from the base package stats
## Not run: B<-c(1,0); C<-c(1/2,sqrt(3)/2); Dist(B,C); dist(rbind(B,C)) x<-runif(10) y<-runif(10) Dist(x,y) xm<-matrix(x,ncol=2) ym<-matrix(y,ncol=2) Dist(xm,ym) dist(rbind(as.vector(xm),as.vector(ym))) Dist(xm,xm) ## End(Not run)
## Not run: B<-c(1,0); C<-c(1/2,sqrt(3)/2); Dist(B,C); dist(rbind(B,C)) x<-runif(10) y<-runif(10) Dist(x,y) xm<-matrix(x,ncol=2) ym<-matrix(y,ncol=2) Dist(xm,ym) dist(rbind(as.vector(xm),as.vector(ym))) Dist(xm,xm) ## End(Not run)
Returns the distance from a point p
to the line joining
points a
and b
in 2D space.
dist.point2line(p, a, b)
dist.point2line(p, a, b)
p |
A 2D point, distance from |
a , b
|
2D points that determine the straight line (i.e., through which the straight line passes). |
A list
with two elements
dis |
Distance from point |
cl2p |
The closest point on the line
passing through |
Elvan Ceyhan
dist.point2plane
, dist.point2set
,
and Dist
## Not run: A<-c(1,2); B<-c(2,3); P<-c(3,1.5) dpl<-dist.point2line(P,A,B); dpl C<-dpl$cl2p pts<-rbind(A,B,C,P) xr<-range(pts[,1]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 lnAB<-Line(A,B,x) y<-lnAB$y int<-lnAB$intercept #intercept sl<-lnAB$slope #slope xsq<-seq(min(A[1],B[1],P[1])-xf,max(A[1],B[1],P[1])+xf,l=5) #try also l=10, 20, or 100 pline<-(-1/sl)*(xsq-P[1])+P[2] #line passing thru P and perpendicular to AB Xlim<-range(pts[,1],x) Ylim<-range(pts[,2],y) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(P),asp=1,pch=1,xlab="x",ylab="y", main="Illustration of the distance from P \n to the Line Crossing Points A and B", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(rbind(A,B),pch=1) lines(x,y,lty=1,xlim=Xlim,ylim=Ylim) int<-round(int,2); sl<-round(sl,2) text(rbind((A+B)/2+xd*c(-.01,-.01)),ifelse(sl==0,paste("y=",int), ifelse(sl==1,paste("y=x+",int), ifelse(int==0,paste("y=",sl,"x"),paste("y=",sl,"x+",int))))) text(rbind(A+xd*c(0,-.01),B+xd*c(.0,-.01),P+xd*c(.01,-.01)),c("A","B","P")) lines(xsq,pline,lty=2) segments(P[1],P[2], C[1], C[2], lty=1,col=2,lwd=2) text(rbind(C+xd*c(-.01,-.01)),"C") text(rbind((P+C)/2),col=2,paste("d=",round(dpl$dis,2))) ## End(Not run)
## Not run: A<-c(1,2); B<-c(2,3); P<-c(3,1.5) dpl<-dist.point2line(P,A,B); dpl C<-dpl$cl2p pts<-rbind(A,B,C,P) xr<-range(pts[,1]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 lnAB<-Line(A,B,x) y<-lnAB$y int<-lnAB$intercept #intercept sl<-lnAB$slope #slope xsq<-seq(min(A[1],B[1],P[1])-xf,max(A[1],B[1],P[1])+xf,l=5) #try also l=10, 20, or 100 pline<-(-1/sl)*(xsq-P[1])+P[2] #line passing thru P and perpendicular to AB Xlim<-range(pts[,1],x) Ylim<-range(pts[,2],y) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(P),asp=1,pch=1,xlab="x",ylab="y", main="Illustration of the distance from P \n to the Line Crossing Points A and B", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(rbind(A,B),pch=1) lines(x,y,lty=1,xlim=Xlim,ylim=Ylim) int<-round(int,2); sl<-round(sl,2) text(rbind((A+B)/2+xd*c(-.01,-.01)),ifelse(sl==0,paste("y=",int), ifelse(sl==1,paste("y=x+",int), ifelse(int==0,paste("y=",sl,"x"),paste("y=",sl,"x+",int))))) text(rbind(A+xd*c(0,-.01),B+xd*c(.0,-.01),P+xd*c(.01,-.01)),c("A","B","P")) lines(xsq,pline,lty=2) segments(P[1],P[2], C[1], C[2], lty=1,col=2,lwd=2) text(rbind(C+xd*c(-.01,-.01)),"C") text(rbind((P+C)/2),col=2,paste("d=",round(dpl$dis,2))) ## End(Not run)
Returns the distance from a point p
to the plane
passing through points a
, b
, and c
in 3D space.
dist.point2plane(p, a, b, c)
dist.point2plane(p, a, b, c)
p |
A 3D point, distance from |
a , b , c
|
3D points that determine the plane (i.e., through which the plane is passing). |
A list
with two elements
dis |
Distance from point |
cl2pl |
The closest point on the plane
spanned by 3D points |
Elvan Ceyhan
dist.point2line
, dist.point2set
,
and Dist
## Not run: P<-c(5,2,40) P1<-c(1,2,3); P2<-c(3,9,12); P3<-c(1,1,3); dis<-dist.point2plane(P,P1,P2,P3); dis Pr<-dis$proj #projection on the plane xseq<-seq(0,10,l=5) #try also l=10, 20, or 100 yseq<-seq(0,10,l=5) #try also l=10, 20, or 100 pl.grid<-Plane(P1,P2,P3,xseq,yseq)$z plot3D::persp3D(z = pl.grid, x = xseq, y = yseq, theta =225, phi = 30, ticktype = "detailed", expand = 0.7, facets = FALSE, scale = TRUE, main="Point P and its Orthogonal Projection \n on the Plane Defined by P1, P2, P3") #plane spanned by points P1, P2, P3 #add the vertices of the tetrahedron plot3D::points3D(P[1],P[2],P[3], add=TRUE) plot3D::points3D(Pr[1],Pr[2],Pr[3], add=TRUE) plot3D::segments3D(P[1], P[2], P[3], Pr[1], Pr[2],Pr[3], add=TRUE,lwd=2) plot3D::text3D(P[1]-.5,P[2],P[3]+1, c("P"),add=TRUE) plot3D::text3D(Pr[1]-.5,Pr[2],Pr[3]+2, c("Pr"),add=TRUE) persp(xseq,yseq,pl.grid, xlab="x",ylab="y",zlab="z",theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") ## End(Not run)
## Not run: P<-c(5,2,40) P1<-c(1,2,3); P2<-c(3,9,12); P3<-c(1,1,3); dis<-dist.point2plane(P,P1,P2,P3); dis Pr<-dis$proj #projection on the plane xseq<-seq(0,10,l=5) #try also l=10, 20, or 100 yseq<-seq(0,10,l=5) #try also l=10, 20, or 100 pl.grid<-Plane(P1,P2,P3,xseq,yseq)$z plot3D::persp3D(z = pl.grid, x = xseq, y = yseq, theta =225, phi = 30, ticktype = "detailed", expand = 0.7, facets = FALSE, scale = TRUE, main="Point P and its Orthogonal Projection \n on the Plane Defined by P1, P2, P3") #plane spanned by points P1, P2, P3 #add the vertices of the tetrahedron plot3D::points3D(P[1],P[2],P[3], add=TRUE) plot3D::points3D(Pr[1],Pr[2],Pr[3], add=TRUE) plot3D::segments3D(P[1], P[2], P[3], Pr[1], Pr[2],Pr[3], add=TRUE,lwd=2) plot3D::text3D(P[1]-.5,P[2],P[3]+1, c("P"),add=TRUE) plot3D::text3D(Pr[1]-.5,Pr[2],Pr[3]+2, c("Pr"),add=TRUE) persp(xseq,yseq,pl.grid, xlab="x",ylab="y",zlab="z",theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") ## End(Not run)
Returns the Euclidean distance between a point p
and set of points Yp
and the
closest point in set Yp
to p
.
Distance between a point and a set is by definition the distance
from the point to the closest point in the set.
p
should be of finite dimension and Yp
should
be of finite cardinality and p
and elements of Yp
must have the same dimension.
dist.point2set(p, Yp)
dist.point2set(p, Yp)
p |
A |
Yp |
A set of |
A list
with the elements
distance |
Distance from point |
ind.cl.point |
Index of the closest point in set |
closest.point |
The closest point
in set |
Elvan Ceyhan
dist.point2line
and dist.point2plane
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); dist.point2set(c(1,2),Te) X2<-cbind(runif(10),runif(10)) dist.point2set(c(1,2),X2) x<-runif(1) y<-as.matrix(runif(10)) dist.point2set(x,y) #this works, because x is a 1D point, and y is treated as a set of 10 1D points #but will give an error message if y<-runif(10) is used above ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); dist.point2set(c(1,2),Te) X2<-cbind(runif(10),runif(10)) dist.point2set(c(1,2),X2) x<-runif(1) y<-as.matrix(runif(10)) dist.point2set(x,y) #this works, because x is a 1D point, and y is treated as a set of 10 1D points #but will give an error message if y<-runif(10) is used above ## End(Not run)
Returns the (exact) domination number
based on the incidence matrix Inc.Mat
of a graph
or a digraph
and the indices (i.e., row numbers of Inc.Mat
)
for the corresponding (exact) minimum dominating set.
Here the row number in the incidence matrix corresponds
to the index of the vertex (i.e., index of the data
point). The function works whether loops are allowed
or not (i.e., whether the first diagonal is all 1 or
all 0). It takes a rather long time for large number of vertices
(i.e., large number of row numbers).
dom.num.exact(Inc.Mat)
dom.num.exact(Inc.Mat)
Inc.Mat |
A square matrix consisting of 0's and 1's which represents the incidence matrix of a graph or digraph. |
A list
with two elements
dom.num |
The cardinality of the (exact) minimum dominating set,
i.e., (exact) domination number of the
graph or digraph whose incidence matrix |
ind.mds |
The vector of indices of the rows
in the incidence matrix |
Elvan Ceyhan
dom.num.greedy
, PEdom.num1D
,
PEdom.num.tri
, PEdom.num.nondeg
,
and Idom.numCSup.bnd.tri
## Not run: n<-10 M<-matrix(sample(c(0,1),n^2,replace=TRUE),nrow=n) diag(M)<-1 dom.num.greedy(M) Idom.num.up.bnd(M,2) dom.num.exact(M) ## End(Not run)
## Not run: n<-10 M<-matrix(sample(c(0,1),n^2,replace=TRUE),nrow=n) diag(M)<-1 dom.num.greedy(M) Idom.num.up.bnd(M,2) dom.num.exact(M) ## End(Not run)
Returns the (approximate) domination number
and the indices (i.e., row numbers) for the corresponding
(approximate) minimum dominating set
based on the incidence matrix Inc.Mat
of a graph or a digraph
by using the greedy algorithm (Chvatal (1979)).
Here the row number in the incidence matrix corresponds
to the index of the vertex (i.e., index of the
data point). The function works
whether loops are allowed or not (i.e., whether the first diagonal
is all 1 or all 0).
This function may yield the actual domination number
or overestimates it.
dom.num.greedy(Inc.Mat)
dom.num.greedy(Inc.Mat)
Inc.Mat |
A square matrix consisting of 0's and 1's which represents the incidence matrix of a graph or digraph. |
A list
with two elements
dom.num |
The cardinality of the (approximate) minimum dominating set
found by the greedy algorithm.
i.e., (approximate) domination number of the graph or digraph
whose incidence matrix |
ind.dom.set |
Indices of the rows
in the incidence matrix |
Elvan Ceyhan
Chvatal V (1979). “A greedy heuristic for the set-covering problem.” Mathematics of Operations Research, 4(3), 233 — 235.
n<-5 M<-matrix(sample(c(0,1),n^2,replace=TRUE),nrow=n) diag(M)<-1 dom.num.greedy(M)
n<-5 M<-matrix(sample(c(0,1),n^2,replace=TRUE),nrow=n) diag(M)<-1 dom.num.greedy(M)
-edge region in a triangle
that contains the pointReturns the edge whose region contains point, p
, in
the triangle tri
with edge regions based on center of mass
.
This function is related to rel.edge.triCM
,
but unlike rel.edge.triCM
the related edges are given as vertices ABC
for , as
BCA
for
and as
CAB
for
where edges are labeled as 3 for edge
,
1 for edge
,
and 2 for edge
.
The vertices are given one vertex in each row in the output,
e.g.,
is printed as
rbind(A,B,C)
,
where row 1 has the entries of vertex A,
row 2 has the entries of vertex B,
and row 3 has the entries of vertex C.
If the point, p
, is not inside tri
,
then the function yields NA
as output.
Edge region for BCA is the triangle ,
edge region CAB is
, and edge region ABC is
.
See also (Ceyhan (2005, 2010)).
edge.reg.triCM(p, tri)
edge.reg.triCM(p, tri)
p |
A 2D point for which |
tri |
A |
The -edge region that contains point,
p
in the triangle tri
.
The related edges are given as
vertices ABC
for ,
as
BCA
for and as
CAB
for
where edges are labeled as 3
for edge
, 1 for edge
, and 2 for edge
.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.edge.tri
, rel.edge.triCM
,
rel.edge.basic.triCM
, rel.edge.basic.tri
,
rel.edge.std.triCM
, and edge.reg.triCM
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) #try also P<-as.numeric(runif.tri(1,Tr)$g) edge.reg.triCM(P,Tr) P<-c(1.8,.5) edge.reg.triCM(P,Tr) CM<-(A+B+C)/3 p1<-(A+B+CM)/3 p2<-(B+C+CM)/3 p3<-(A+C+CM)/3 Xlim<-range(Tr[,1]) Ylim<-range(Tr[,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) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CM,p1,p2,p3) xc<-txt[,1]+c(-.02,.02,.02,-.05,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.02,0,0,0) txt.str<-c("A","B","C","CM","re=T(A,B,CM)","re=T(B,C,CM)","re=T(A,C,CM)") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) #try also P<-as.numeric(runif.tri(1,Tr)$g) edge.reg.triCM(P,Tr) P<-c(1.8,.5) edge.reg.triCM(P,Tr) CM<-(A+B+C)/3 p1<-(A+B+CM)/3 p2<-(B+C+CM)/3 p3<-(A+C+CM)/3 Xlim<-range(Tr[,1]) Ylim<-range(Tr[,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) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CM,p1,p2,p3) xc<-txt[,1]+c(-.02,.02,.02,-.05,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.02,0,0,0) txt.str<-c("A","B","C","CM","re=T(A,B,CM)","re=T(B,C,CM)","re=T(A,C,CM)") text(xc,yc,txt.str) ## End(Not run)
-edge region in the standard equilateral triangleAn object of class "Extrema"
.
Returns the furthest data points among the data set, Xp
,
in each -edge region from the edge in the
standard equilateral triangle
.
ch.all.intri
is for checking
whether all data points are inside (default is
FALSE
).
See also (Ceyhan (2005)).
fr2edgesCMedge.reg.std.tri(Xp, ch.all.intri = FALSE)
fr2edgesCMedge.reg.std.tri(Xp, ch.all.intri = FALSE)
Xp |
A set of 2D points,
some could be inside and some could be outside standard equilateral triangle
|
ch.all.intri |
A logical argument used
for checking whether all data points are inside |
A list
with the elements
txt1 |
Edge labels as |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, furthest points from edges in each edge region. |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, here, it is |
cent |
The center point used for construction of edge regions. |
ncent |
Name of the center, |
regions |
Edge regions inside the triangle, |
region.names |
Names of the edge regions
as |
region.centers |
Centers of mass of the edge regions
inside |
dist2ref |
Distances from furthest points in each edge region to the corresponding edge. |
Elvan Ceyhan
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.
fr2vertsCCvert.reg.basic.tri
, fr2vertsCCvert.reg
,
fr2vertsCCvert.reg.basic.tri
, kfr2vertsCCvert.reg
,
and cl2edges.std.tri
## Not run: n<-20 Xp<-runif.std.tri(n)$gen.points Ext<-fr2edgesCMedge.reg.std.tri(Xp) Ext summary(Ext) plot(Ext,asp=1) ed.far<-Ext Xp2<-rbind(Xp,c(.8,.8)) fr2edgesCMedge.reg.std.tri(Xp2) fr2edgesCMedge.reg.std.tri(Xp2,ch.all.intri = FALSE) #gives error if ch.all.intri = TRUE A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 p1<-(A+B)/2 p2<-(B+C)/2 p3<-(A+C)/2 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="", main="Furthest Points in CM-Edge Regions \n of Std Equilateral Triangle from its Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp,xlab="",ylab="") points(ed.far$ext,pty=2,pch=4,col="red") txt<-rbind(Te,CM,p1,p2,p3) xc<-txt[,1]+c(-.03,.03,.03,-.06,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.02,0,0,0) txt.str<-c("A","B","C","CM","re=2","re=3","re=1") text(xc,yc,txt.str) ## End(Not run)
## Not run: n<-20 Xp<-runif.std.tri(n)$gen.points Ext<-fr2edgesCMedge.reg.std.tri(Xp) Ext summary(Ext) plot(Ext,asp=1) ed.far<-Ext Xp2<-rbind(Xp,c(.8,.8)) fr2edgesCMedge.reg.std.tri(Xp2) fr2edgesCMedge.reg.std.tri(Xp2,ch.all.intri = FALSE) #gives error if ch.all.intri = TRUE A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 p1<-(A+B)/2 p2<-(B+C)/2 p3<-(A+C)/2 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="", main="Furthest Points in CM-Edge Regions \n of Std Equilateral Triangle from its Edges", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp,xlab="",ylab="") points(ed.far$ext,pty=2,pch=4,col="red") txt<-rbind(Te,CM,p1,p2,p3) xc<-txt[,1]+c(-.03,.03,.03,-.06,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.02,0,0,0) txt.str<-c("A","B","C","CM","re=2","re=3","re=1") text(xc,yc,txt.str) ## End(Not run)
-vertex region in a triangleAn object of class "Extrema"
.
Returns the furthest data points among the data set, Xp
,
in each -vertex region from the vertex in the
triangle,
tri
.
Vertex region labels/numbers correspond
to the row number of the vertex in
tri
.
ch.all.intri
is for checking
whether all data points are inside tri
(default is FALSE
).
If some of the data points are not
inside tri
and ch.all.intri=TRUE
,
then the function yields
an error message.
If some of the data points are not inside tri
and ch.all.intri=FALSE
, then the function yields
the closest points to edges among the data points
inside tri
(yields NA
if there are no data points
inside tri
).
See also (Ceyhan (2005, 2012)).
fr2vertsCCvert.reg(Xp, tri, ch.all.intri = FALSE)
fr2vertsCCvert.reg(Xp, tri, ch.all.intri = FALSE)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
ch.all.intri |
A logical argument (default= |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here,
furthest points from vertices in each |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, here,
it is the triangle |
cent |
The center point used for construction of edge regions. |
ncent |
Name of the center, |
regions |
CC-Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from furthest points in each vertex region to the corresponding vertex |
Elvan Ceyhan
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 (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.
fr2vertsCCvert.reg.basic.tri
, fr2edgesCMedge.reg.std.tri
,
fr2vertsCCvert.reg.basic.tri
and kfr2vertsCCvert.reg
## Not run: 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 Ext<-fr2vertsCCvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) f2v<-Ext CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,xlab="",asp=1,ylab="",pch=".", main="Furthest Points in CC-Vertex Regions \n from the Vertices", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(rbind(f2v$ext),pch=4,col=2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.06,.08,.05,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.05,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) Xp2<-rbind(Xp,c(.2,.4)) fr2vertsCCvert.reg(Xp2,Tr,ch.all.intri = FALSE) #gives an error message if ch.all.intri = TRUE #since not all points in the data set are in the triangle ## End(Not run)
## Not run: 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 Ext<-fr2vertsCCvert.reg(Xp,Tr) Ext summary(Ext) plot(Ext) f2v<-Ext CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,xlab="",asp=1,ylab="",pch=".", main="Furthest Points in CC-Vertex Regions \n from the Vertices", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(rbind(f2v$ext),pch=4,col=2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.06,.08,.05,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.05,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) Xp2<-rbind(Xp,c(.2,.4)) fr2vertsCCvert.reg(Xp2,Tr,ch.all.intri = FALSE) #gives an error message if ch.all.intri = TRUE #since not all points in the data set are in the triangle ## End(Not run)
-vertex region
in a standard basic triangleAn object of class "Extrema"
.
Returns the furthest data points among the data set, Xp
,
in each -vertex region from the
corresponding vertex in the standard basic triangle
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.
ch.all.intri
is for checking whether all data points are
inside (default is
FALSE
).
See also (Ceyhan (2005, 2012)).
An object of class "Extrema"
.
Returns the k
furthest data points
among the data set, Xp
,
in each -vertex region from the vertex in the
standard basic triangle
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.
ch.all.intri
is for checking whether all data points are
inside (default is
FALSE
).
In the extrema, , in the output,
the first
k
entries are the k
furthest points from vertex 1,
second k
entries are k
furthest points are from vertex 2, and
last k
entries are the k
furthest points from vertex 3
If data size does not allow, NA
's are inserted for some
or all of the k
furthest points for each vertex.
fr2vertsCCvert.reg.basic.tri(Xp, c1, c2, k, ch.all.intri = FALSE) fr2vertsCCvert.reg.basic.tri(Xp, c1, c2, k, ch.all.intri = FALSE)
fr2vertsCCvert.reg.basic.tri(Xp, c1, c2, k, ch.all.intri = FALSE) fr2vertsCCvert.reg.basic.tri(Xp, c1, c2, k, ch.all.intri = FALSE)
Xp |
A set of 2D points representing the set of data points. |
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle.
adjacent to the shorter edges;
|
k |
A positive integer. |
ch.all.intri |
A logical argument for checking
whether all data points are inside |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, furthest points from vertices in each vertex region. |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, here, it is |
cent |
The center point used for construction of edge regions. |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from furthest points in each vertex region to the corresponding vertex. |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A shorter description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here,
|
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points,
here, it is |
cent |
The center point used for construction of edge regions. |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions inside |
dist2ref |
Distances from |
Elvan Ceyhan
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 (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.
fr2vertsCCvert.reg
, fr2edgesCMedge.reg.std.tri
,
and kfr2vertsCCvert.reg
fr2vertsCCvert.reg.basic.tri
, fr2vertsCCvert.reg
,
fr2edgesCMedge.reg.std.tri
, and kfr2vertsCCvert.reg
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-20 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g Ext<-fr2vertsCCvert.reg.basic.tri(Xp,c1,c2) Ext summary(Ext) plot(Ext) f2v<-Ext CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main="Furthest Points in CC-Vertex Regions \n from the Vertices", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(rbind(f2v$ext),pch=4,col=2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.03,0.02,.07,.06,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,.01,.02,.02,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run) ## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-20 k<-3 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g Ext<-fr2vertsCCvert.reg.basic.tri(Xp,c1,c2,k) Ext summary(Ext) plot(Ext) kf2v<-Ext CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main=paste(k," Furthest Points in CC-Vertex Regions \n from the Vertices",sep=""), xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(kf2v$ext,pch=4,col=2) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,.02,.07,.06,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,-.02,.02,.03,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-20 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g Ext<-fr2vertsCCvert.reg.basic.tri(Xp,c1,c2) Ext summary(Ext) plot(Ext) f2v<-Ext CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main="Furthest Points in CC-Vertex Regions \n from the Vertices", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(rbind(f2v$ext),pch=4,col=2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.03,0.02,.07,.06,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,.01,.02,.02,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run) ## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-20 k<-3 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g Ext<-fr2vertsCCvert.reg.basic.tri(Xp,c1,c2,k) Ext summary(Ext) plot(Ext) kf2v<-Ext CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main=paste(k," Furthest Points in CC-Vertex Regions \n from the Vertices",sep=""), xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(kf2v$ext,pch=4,col=2) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,.02,.07,.06,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,-.02,.02,.03,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Two functions, lineA2CMinTe
and lineB2CMinTe
of class "TriLines"
.
Returns the equation, slope, intercept
,
and -coordinates of the lines joining
and
and
also
and
.
lineA2CMinTe
is the line joining to the center of mass,
,
and
lineB2CMinTe
is the line joining to the center of mass,
,
in the standard equilateral triangle
with
,
,
;
-coordinates are provided in
vector
x
.
lineA2CMinTe(x) lineB2CMinTe(x)
lineA2CMinTe(x) lineB2CMinTe(x)
x |
A single scalar or a |
A list
with the elements
txt1 |
Longer description of the line. |
txt2 |
Shorter description of the line (to be inserted over the line in the plot). |
mtitle |
The |
cent |
The center chosen inside the standard equilateral triangle. |
cent.name |
The name of the center
inside the standard equilateral triangle.
It is |
tri |
The triangle (it is the standard equilateral triangle for this function). |
x |
The input vector, can be a scalar or a |
y |
The output vector,
will be a scalar if |
slope |
Slope of the line. |
intercept |
Intercept of the line. |
equation |
Equation of the line. |
Elvan Ceyhan
lineA2MinTe
, lineB2MinTe
,
and lineC2MinTe
## Not run: #Examples for lineA2CMinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .1) #try also by = .01 lnACM<-lineA2CMinTe(x) lnACM summary(lnACM) plot(lnACM) CM<-(A+B+C)/3; D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,CM,D1,D2,D3,c(.25,lineA2CMinTe(.25)$y),c(.75,lineB2CMinTe(.75)$y)) xc<-txt[,1]+c(-.02,.02,.02,.05,.05,-.03,.0,0,0) yc<-txt[,2]+c(.02,.02,.02,.02,0,.02,-.04,0,0) txt.str<-c("A","B","C","CM","D1","D2","D3","lineA2CMinTe(x)","lineB2CMinTe(x)") text(xc,yc,txt.str) lineA2CMinTe(.25)$y ## End(Not run) ## Not run: #Examples for lineB2CMinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .1) #try also by = .01 lnBCM<-lineB2CMinTe(x) lnBCM summary(lnBCM) plot(lnBCM,xlab=" x",ylab="y") lineB2CMinTe(.25)$y ## End(Not run)
## Not run: #Examples for lineA2CMinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .1) #try also by = .01 lnACM<-lineA2CMinTe(x) lnACM summary(lnACM) plot(lnACM) CM<-(A+B+C)/3; D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,CM,D1,D2,D3,c(.25,lineA2CMinTe(.25)$y),c(.75,lineB2CMinTe(.75)$y)) xc<-txt[,1]+c(-.02,.02,.02,.05,.05,-.03,.0,0,0) yc<-txt[,2]+c(.02,.02,.02,.02,0,.02,-.04,0,0) txt.str<-c("A","B","C","CM","D1","D2","D3","lineA2CMinTe(x)","lineB2CMinTe(x)") text(xc,yc,txt.str) lineA2CMinTe(.25)$y ## End(Not run) ## Not run: #Examples for lineB2CMinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .1) #try also by = .01 lnBCM<-lineB2CMinTe(x) lnBCM summary(lnBCM) plot(lnBCM,xlab=" x",ylab="y") lineB2CMinTe(.25)$y ## End(Not run)
M
, of itThree functions, lineA2MinTe
, lineB2MinTe
and lineC2MinTe
of class "TriLines"
.
Returns the equation, slope, intercept
,
and -coordinates of the lines joining
and
M
,
and
M
, and also and
M
.
lineA2MinTe
is the line joining to the center,
M
,
lineB2MinTe
is the line joining to
M
,
and lineC2MinTe
is the line joining C to M
,
in the standard equilateral triangle
with
,
,
;
-coordinates are provided in
vector
x
lineA2MinTe(x, M) lineB2MinTe(x, M) lineC2MinTe(x, M)
lineA2MinTe(x, M) lineB2MinTe(x, M) lineC2MinTe(x, M)
x |
A single scalar or a |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates which serves as a center in the interior of the standard equilateral triangle. |
A list
with the elements
txt1 |
Longer description of the line. |
txt2 |
Shorter description of the line (to be inserted over the line in the plot). |
mtitle |
The |
cent |
The center chosen inside the standard equilateral triangle. |
cent.name |
The name of the center inside the standard equilateral triangle. |
tri |
The triangle (it is the standard equilateral triangle for this function). |
x |
The input vector, can be a scalar
or a |
y |
The output vector,
will be a scalar if |
slope |
Slope of the line. |
intercept |
Intercept of the line. |
equation |
Equation of the line. |
## Not run: #Examples for lineA2MinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) M<-c(.65,.2) #try also M<-c(1,1,1) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .1) #try also by = .01 lnAM<-lineA2MinTe(x,M) lnAM summary(lnAM) plot(lnAM) Ds<-prj.cent2edges(Te,M) #finds the projections from a point M=(m1,m2) to the edges on the #extension of the lines joining M to the vertices in the triangle Te Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) L<-Ds; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 3,col=2) txt<-rbind(Te,M,Ds,c(.25,lineA2MinTe(.25,M)$y),c(.4,lineB2MinTe(.4,M)$y), c(.60,lineC2MinTe(.60,M)$y)) xc<-txt[,1]+c(-.02,.02,.02,.02,.04,-.03,.0,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.05,.02,.03,-.03,0,0,0) txt.str<-c("A","B","C","M","D1","D2","D3","lineA2MinTe(x)","lineB2MinTe(x)","lineC2MinTe(x)") text(xc,yc,txt.str) lineA2MinTe(.25,M) ## End(Not run) ## Not run: #Examples for lineB2MinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) M<-c(.65,.2) #try also M<-c(1,1,1) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .5) #try also by = .1 lnBM<-lineB2MinTe(x,M) lnBM summary(lnBM) plot(lnBM) ## End(Not run) ## Not run: #Examples for lineC2MinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) M<-c(.65,.2) #try also M<-c(1,1,1) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .5) #try also by = .1 lnCM<-lineC2MinTe(x,M) lnCM summary(lnCM) plot(lnCM) ## End(Not run)
## Not run: #Examples for lineA2MinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) M<-c(.65,.2) #try also M<-c(1,1,1) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .1) #try also by = .01 lnAM<-lineA2MinTe(x,M) lnAM summary(lnAM) plot(lnAM) Ds<-prj.cent2edges(Te,M) #finds the projections from a point M=(m1,m2) to the edges on the #extension of the lines joining M to the vertices in the triangle Te Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) L<-Ds; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 3,col=2) txt<-rbind(Te,M,Ds,c(.25,lineA2MinTe(.25,M)$y),c(.4,lineB2MinTe(.4,M)$y), c(.60,lineC2MinTe(.60,M)$y)) xc<-txt[,1]+c(-.02,.02,.02,.02,.04,-.03,.0,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.05,.02,.03,-.03,0,0,0) txt.str<-c("A","B","C","M","D1","D2","D3","lineA2MinTe(x)","lineB2MinTe(x)","lineC2MinTe(x)") text(xc,yc,txt.str) lineA2MinTe(.25,M) ## End(Not run) ## Not run: #Examples for lineB2MinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) M<-c(.65,.2) #try also M<-c(1,1,1) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .5) #try also by = .1 lnBM<-lineB2MinTe(x,M) lnBM summary(lnBM) plot(lnBM) ## End(Not run) ## Not run: #Examples for lineC2MinTe A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) M<-c(.65,.2) #try also M<-c(1,1,1) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by = .5) #try also by = .1 lnCM<-lineC2MinTe(x,M) lnCM summary(lnCM) plot(lnCM) ## End(Not run)
Two functions: cart2bary
and bary2cart
.
cart2bary
converts Cartesian coordinates of
a given point P
to barycentric coordinates
(in the normalized form)
with respect to the triangle
tri
with vertex labeling done row-wise in
tri
(i.e., row corresponds to vertex
for
).
bary2cart
converts barycentric coordinates of
the point P
(not necessarily normalized) to
Cartesian coordinates according to the coordinates of the triangle,
tri
.
For information on barycentric coordinates,
see (Weisstein (2019)).
cart2bary(P, tri) bary2cart(P, tri)
cart2bary(P, tri) bary2cart(P, tri)
P |
A 2D point for |
tri |
A |
cart2bary
returns the barycentric coordinates
of a given point P
and
bary2cart
returns the Cartesian coordinates
of the point P
(not necessarily normalized).
Elvan Ceyhan
Weisstein EW (2019). “Barycentric Coordinates.” From MathWorld — A Wolfram Web Resource, http://mathworld.wolfram.com/BarycentricCoordinates.html.
## Not run: #Examples for cart2bary c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tr<-rbind(A,B,C) cart2bary(A,Tr) cart2bary(c(.3,.2),Tr) ## End(Not run) ## Not run: #Examples for bary2cart c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tr<-rbind(A,B,C) bary2cart(c(.3,.2,.5),Tr) bary2cart(c(6,2,4),Tr) ## End(Not run)
## Not run: #Examples for cart2bary c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tr<-rbind(A,B,C) cart2bary(A,Tr) cart2bary(c(.3,.2),Tr) ## End(Not run) ## Not run: #Examples for bary2cart c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tr<-rbind(A,B,C) bary2cart(c(.3,.2,.5),Tr) bary2cart(c(6,2,4),Tr) ## End(Not run)
Three indicator functions: IarcCSstd.triRAB
, IarcCSstd.triRBC
and IarcCSstd.triRAC
.
The function IarcCSstd.triRAB
returns I(p2
is in for
p1
in (edge region for edge
,
i.e., edge 3) in the standard equilateral triangle
;
IarcCSstd.triRBC
returns I(p2
is in for
p1
in (edge region for edge
, i.e., edge 1) in
;
and
IarcCSstd.triRAC
returns I(p2
is in for
p1
in (edge region for edge
, i.e., edge 2) in
.
That is, each function returns 1 if
p2
is in , returns 0 otherwise.
CS proximity region is defined with respect to whose vertices are also labeled as
with expansion parameter
and edge regions are based on the center
in Cartesian coordinates
or
in barycentric coordinates in the interior of
If p1
and p2
are distinct and p1
is outside the corresponding edge region and p2
is outside , it returns 0,
but if they are identical, then it returns 1 regardless of their location (i.e., it allows loops).
See also (Ceyhan (2005, 2010)).
IarcCSstd.triRAB(p1, p2, t, M) IarcCSstd.triRBC(p1, p2, t, M) IarcCSstd.triRAC(p1, p2, t, M)
IarcCSstd.triRAB(p1, p2, t, M) IarcCSstd.triRBC(p1, p2, t, M) IarcCSstd.triRAC(p1, p2, t, M)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates
which serves as a center in the interior of the standard equilateral triangle |
Each function returns p2
is in for
p1
, that is, returns 1 if p2
is in ,
returns 0 otherwise
Elvan Ceyhan
IarcCSt1.std.triRAB
, IarcCSt1.std.triRBC
and IarcCSt1.std.triRAC
## Not run: #Examples for IarcCSstd.triRAB A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T3<-rbind(A,B,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSstd.triRAB(Xp[1,],Xp[2,],t,M) IarcCSstd.triRAB(c(.2,.5),Xp[2,],t,M) ## End(Not run) ## Not run: #Examples for IarcCSstd.triRBC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T1<-rbind(B,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSstd.triRBC(Xp[1,],Xp[2,],t,M) IarcCSstd.triRBC(c(.2,.5),Xp[2,],t,M) ## End(Not run) ## Not run: #Examples for IarcCSstd.triRAC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T2<-rbind(A,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSstd.triRAC(Xp[1,],Xp[2,],t,M) IarcCSstd.triRAC(c(.2,.5),Xp[2,],t,M) ## End(Not run)
## Not run: #Examples for IarcCSstd.triRAB A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T3<-rbind(A,B,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSstd.triRAB(Xp[1,],Xp[2,],t,M) IarcCSstd.triRAB(c(.2,.5),Xp[2,],t,M) ## End(Not run) ## Not run: #Examples for IarcCSstd.triRBC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T1<-rbind(B,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSstd.triRBC(Xp[1,],Xp[2,],t,M) IarcCSstd.triRBC(c(.2,.5),Xp[2,],t,M) ## End(Not run) ## Not run: #Examples for IarcCSstd.triRAC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T2<-rbind(A,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSstd.triRAC(Xp[1,],Xp[2,],t,M) IarcCSstd.triRAC(c(.2,.5),Xp[2,],t,M) ## End(Not run)
gammakCSstd.tri
is for
(
) points constituting a dominating set for Central Similarity
Proximity Catch Digraphs (CS-PCDs) - standard equilateral triangle caseFour indicator functions: Idom.num2CSstd.tri
, Idom.num3CSstd.tri
, Idom.num4CSstd.tri
, Idom.num5CSstd.tri
and Idom.num6CSstd.tri
.
The function gammakCSstd.tri
returns I({p1
,...,pk
} is a dominating set of the CS-PCD)
where vertices of CS-PCD are the 2D data set Xp
, that is, returns 1 if {p1
,...,pk
}
is a dominating set of CS-PCD, returns 0 otherwise for .
CS proximity region is constructed with respect to
with expansion parameter
and edge regions are based on center of mass
.
ch.data.pnts
is for checking whether points p1
,...,pk
are data points in Xp
or not
(default is FALSE
), so by default this function checks whether the points p1
,...,pk
would be a
dominating set if they actually were in the data set.
See also (Ceyhan (2005, 2010)).
Idom.num2CSstd.tri(p1, p2, Xp, t, ch.data.pnts = FALSE) Idom.num3CSstd.tri(p1, p2, p3, Xp, t, ch.data.pnts = FALSE) Idom.num4CSstd.tri(p1, p2, p3, p4, Xp, t, ch.data.pnts = FALSE) Idom.num5CSstd.tri(p1, p2, p3, p4, p5, Xp, t, ch.data.pnts = FALSE) Idom.num6CSstd.tri(p1, p2, p3, p4, p5, p6, Xp, t, ch.data.pnts = FALSE)
Idom.num2CSstd.tri(p1, p2, Xp, t, ch.data.pnts = FALSE) Idom.num3CSstd.tri(p1, p2, p3, Xp, t, ch.data.pnts = FALSE) Idom.num4CSstd.tri(p1, p2, p3, p4, Xp, t, ch.data.pnts = FALSE) Idom.num5CSstd.tri(p1, p2, p3, p4, p5, Xp, t, ch.data.pnts = FALSE) Idom.num6CSstd.tri(p1, p2, p3, p4, p5, p6, Xp, t, ch.data.pnts = FALSE)
p1 , p2 , p3 , p4 , p5 , p6
|
The points { |
Xp |
A set of 2D points which constitutes the vertices of the CS-PCD. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
ch.data.pnts |
A logical argument for checking whether points { |
The function gammakCSstd.tri
returns {p1
,...,pk
} is a dominating set of the CS-PCD) where
vertices of the CS-PCD are the 2D data set Xp
), that is, returns 1 if {p1
,...,pk
}
is a dominating set of CS-PCD, returns 0 otherwise.
Elvan Ceyhan
Idom.num1CSstd.tri
, Idom.num2PEtri
and Idom.num2PEtetra
## Not run: set.seed(123) #Examples for Idom.num2CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num2CSstd.tri(Xp[1,],Xp[2,],Xp,t) Idom.num2CSstd.tri(c(.2,.2),Xp[2,],Xp,t) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2CSstd.tri(Xp[i,],Xp[j,],Xp,t)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 ## End(Not run) ## Not run: #Examples for Idom.num3CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num3CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp,t) ind.gam3<-vector() for (i in 1:(n-2)) for (j in (i+1):(n-1)) for (k in (j+1):n) {if (Idom.num3CSstd.tri(Xp[i,],Xp[j,],Xp[k,],Xp,t)==1) ind.gam3<-rbind(ind.gam3,c(i,j,k))} ind.gam3 ## End(Not run) ## Not run: #Examples for Idom.num4CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num4CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp,t) ind.gam4<-vector() for (i in 1:(n-3)) for (j in (i+1):(n-2)) for (k in (j+1):(n-1)) for (l in (k+1):n) {if (Idom.num4CSstd.tri(Xp[i,],Xp[j,],Xp[k,],Xp[l,],Xp,t)==1) ind.gam4<-rbind(ind.gam4,c(i,j,k,l))} ind.gam4 Idom.num4CSstd.tri(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp,t,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run) ## Not run: #Examples for Idom.num5CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num5CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp,t) ind.gam5<-vector() for (i1 in 1:(n-4)) for (i2 in (i1+1):(n-3)) for (i3 in (i2+1):(n-2)) for (i4 in (i3+1):(n-1)) for (i5 in (i4+1):n) {if (Idom.num5CSstd.tri(Xp[i1,],Xp[i2,],Xp[i3,],Xp[i4,],Xp[i5,],Xp,t)==1) ind.gam5<-rbind(ind.gam5,c(i1,i2,i3,i4,i5))} ind.gam5 Idom.num5CSstd.tri(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp,t,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run) ## Not run: #Examples for Idom.num6CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num6CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp[6,],Xp,t) ind.gam6<-vector() for (i1 in 1:(n-5)) for (i2 in (i1+1):(n-4)) for (i3 in (i2+1):(n-3)) for (i4 in (i3+1):(n-2)) for (i5 in (i4+1):(n-1)) for (i6 in (i5+1):n) {if (Idom.num6CSstd.tri(Xp[i1,],Xp[i2,],Xp[i3,],Xp[i4,],Xp[i5,],Xp[i6,],Xp,t)==1) ind.gam6<-rbind(ind.gam6,c(i1,i2,i3,i4,i5,i6))} ind.gam6 Idom.num6CSstd.tri(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp[6,],Xp,t,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run)
## Not run: set.seed(123) #Examples for Idom.num2CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num2CSstd.tri(Xp[1,],Xp[2,],Xp,t) Idom.num2CSstd.tri(c(.2,.2),Xp[2,],Xp,t) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2CSstd.tri(Xp[i,],Xp[j,],Xp,t)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 ## End(Not run) ## Not run: #Examples for Idom.num3CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num3CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp,t) ind.gam3<-vector() for (i in 1:(n-2)) for (j in (i+1):(n-1)) for (k in (j+1):n) {if (Idom.num3CSstd.tri(Xp[i,],Xp[j,],Xp[k,],Xp,t)==1) ind.gam3<-rbind(ind.gam3,c(i,j,k))} ind.gam3 ## End(Not run) ## Not run: #Examples for Idom.num4CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num4CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp,t) ind.gam4<-vector() for (i in 1:(n-3)) for (j in (i+1):(n-2)) for (k in (j+1):(n-1)) for (l in (k+1):n) {if (Idom.num4CSstd.tri(Xp[i,],Xp[j,],Xp[k,],Xp[l,],Xp,t)==1) ind.gam4<-rbind(ind.gam4,c(i,j,k,l))} ind.gam4 Idom.num4CSstd.tri(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp,t,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run) ## Not run: #Examples for Idom.num5CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num5CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp,t) ind.gam5<-vector() for (i1 in 1:(n-4)) for (i2 in (i1+1):(n-3)) for (i3 in (i2+1):(n-2)) for (i4 in (i3+1):(n-1)) for (i5 in (i4+1):n) {if (Idom.num5CSstd.tri(Xp[i1,],Xp[i2,],Xp[i3,],Xp[i4,],Xp[i5,],Xp,t)==1) ind.gam5<-rbind(ind.gam5,c(i1,i2,i3,i4,i5))} ind.gam5 Idom.num5CSstd.tri(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp,t,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run) ## Not run: #Examples for Idom.num6CSstd.tri t<-1.5 n<-10 #try also 10, 20 (it may take longer for larger n) set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num6CSstd.tri(Xp[1,],Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp[6,],Xp,t) ind.gam6<-vector() for (i1 in 1:(n-5)) for (i2 in (i1+1):(n-4)) for (i3 in (i2+1):(n-3)) for (i4 in (i3+1):(n-2)) for (i5 in (i4+1):(n-1)) for (i6 in (i5+1):n) {if (Idom.num6CSstd.tri(Xp[i1,],Xp[i2,],Xp[i3,],Xp[i4,],Xp[i5,],Xp[i6,],Xp,t)==1) ind.gam6<-rbind(ind.gam6,c(i1,i2,i3,i4,i5,i6))} ind.gam6 Idom.num6CSstd.tri(c(.2,.2),Xp[2,],Xp[3,],Xp[4,],Xp[5,],Xp[6,],Xp,t,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run)
Three indicator functions: IarcCSt1.std.triRAB
, IarcCSt1.std.triRBC
and IarcCSt1.std.triRAC
.
The function IarcCSt1.std.triRAB
returns p2
is in for
p1
in
(edge region for edge
, i.e., edge 3) in the standard equilateral triangle
;
IarcCSt1.std.triRBC
returns p2
is in for
p1
in (edge region for edge
, i.e., edge 1) in
;
and
IarcCSt1.std.triRAC
returns p2
is in for
p1
in (edge region for edge
, i.e., edge 2) in
.
That is, each function returns 1 if p2
is in , returns 0 otherwise, where
is the
CS proximity region for point
with expansion parameter
.
IarcCSt1.std.triRAB(p1, p2) IarcCSt1.std.triRBC(p1, p2) IarcCSt1.std.triRAC(p1, p2)
IarcCSt1.std.triRAB(p1, p2) IarcCSt1.std.triRBC(p1, p2) IarcCSt1.std.triRAC(p1, p2)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
Each function returns p2
is in for
p1
, that is,
returns 1 if p2
is in , returns 0 otherwise
Elvan Ceyhan
IarcCSstd.triRAB
, IarcCSstd.triRBC
and IarcCSstd.triRAC
## Not run: #Examples for IarcCSt1.std.triRAB A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T3<-rbind(A,B,CM); set.seed(1) Xp<-runif.std.tri(10)$gen.points IarcCSt1.std.triRAB(Xp[1,],Xp[2,]) IarcCSt1.std.triRAB(c(.2,.5),Xp[2,]) ## End(Not run) ## Not run: #Examples for IarcCSt1.std.triRBC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T1<-rbind(B,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points IarcCSt1.std.triRBC(Xp[1,],Xp[2,]) IarcCSt1.std.triRBC(c(.2,.5),Xp[2,]) ## End(Not run) ## Not run: #Examples for IarcCSt1.std.triRAC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T2<-rbind(A,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points IarcCSt1.std.triRAC(Xp[1,],Xp[2,]) IarcCSt1.std.triRAC(c(1,2),Xp[2,]) ## End(Not run)
## Not run: #Examples for IarcCSt1.std.triRAB A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T3<-rbind(A,B,CM); set.seed(1) Xp<-runif.std.tri(10)$gen.points IarcCSt1.std.triRAB(Xp[1,],Xp[2,]) IarcCSt1.std.triRAB(c(.2,.5),Xp[2,]) ## End(Not run) ## Not run: #Examples for IarcCSt1.std.triRBC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T1<-rbind(B,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points IarcCSt1.std.triRBC(Xp[1,],Xp[2,]) IarcCSt1.std.triRBC(c(.2,.5),Xp[2,]) ## End(Not run) ## Not run: #Examples for IarcCSt1.std.triRAC A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 T2<-rbind(A,C,CM); set.seed(1) Xp<-runif.std.tri(3)$gen.points IarcCSt1.std.triRAC(Xp[1,],Xp[2,]) IarcCSt1.std.triRAC(c(1,2),Xp[2,]) ## End(Not run)
Two functions: index.delaunay.tri
and indices.delaunay.tri
.
index.delaunay.tri
finds the index of the Delaunay triangle
in which the given point, p
, resides.
indices.delaunay.tri
finds the indices of triangles
for all the points in data set, Xp
, as a vector.
Delaunay triangulation is based on Yp
and DTmesh
are the Delaunay triangles with default NULL
.
The function returns NA
for a point not inside the convex hull of Yp
.
Number of Yp
points (i.e., size of Yp
)
should be at least three and the points
should be in general position so that Delaunay triangulation is (uniquely) defined.
If the number of Yp
points is 3,
then there is only one Delaunay triangle and the indices of all
the points inside this triangle are all 1.
See (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
index.delaunay.tri(p, Yp, DTmesh = NULL) indices.delaunay.tri(Xp, Yp, DTmesh = NULL)
index.delaunay.tri(p, Yp, DTmesh = NULL) indices.delaunay.tri(Xp, Yp, DTmesh = NULL)
p |
A 2D point; the index of the Delaunay triangle
in which |
Yp |
A set of 2D points from which Delaunay triangulation is constructed. |
DTmesh |
Delaunay triangles based on |
Xp |
A set of 2D points representing the set of data points
for which the indices of the Delaunay
triangles they reside is to be determined.
It is an argument for |
index.delaunay.tri
returns the index of the Delaunay triangle
in which the given point, p
, resides
and indices.delaunay.tri
returns the vector
of indices of
the Delaunay triangles in which points in the data
set, Xp
, reside.
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
## Not run: #Examples for index.delaunay.tri nx<-20 #number of X points (target) ny<-5 #number of Y points (nontarget) set.seed(1) Yp<-cbind(runif(ny),runif(ny)) Xp<-runif.multi.tri(nx,Yp)$g #data under CSR in the convex hull of Ypoints #try also Xp<-cbind(runif(nx),runif(nx)) index.delaunay.tri(Xp[10,],Yp) #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation TRY<-interp::triangles(DTY)[,1:3]; index.delaunay.tri(Xp[10,],Yp,DTY) ind.DT<-vector() for (i in 1:nx) ind.DT<-c(ind.DT,index.delaunay.tri(Xp[i,],Yp)) ind.DT Xlim<-range(Yp[,1],Xp[,1]) Ylim<-range(Yp[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points #plot of the data in the convex hull of Y points together with the Delaunay triangulation plot(Xp,main=" ", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points = TRUE,pch=16,col="blue") points(Xp,pch=".",cex=3) text(Xp,labels = factor(ind.DT)) ## End(Not run) ## Not run: #Examples for indices.delaunay.tri #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) Yp<-cbind(runif(ny),runif(ny)) Xp<-runif.multi.tri(nx,Yp)$g #data under CSR in the convex hull of Ypoints #try also Xp<-cbind(runif(nx),runif(nx)) tr.ind<-indices.delaunay.tri(Xp,Yp) #indices of the Delaunay triangles tr.ind #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points tr.ind<-indices.delaunay.tri(Xp,Yp,DTY) #indices of the Delaunay triangles tr.ind Xlim<-range(Yp[,1],Xp[,1]) Ylim<-range(Yp[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation par(pty = "s") plot(Xp,main=" ", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),pch=".") interp::plot.triSht(DTY, add=TRUE, do.points = TRUE,pch=16,col="blue") text(Xp,labels = factor(tr.ind)) ## End(Not run)
## Not run: #Examples for index.delaunay.tri nx<-20 #number of X points (target) ny<-5 #number of Y points (nontarget) set.seed(1) Yp<-cbind(runif(ny),runif(ny)) Xp<-runif.multi.tri(nx,Yp)$g #data under CSR in the convex hull of Ypoints #try also Xp<-cbind(runif(nx),runif(nx)) index.delaunay.tri(Xp[10,],Yp) #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation TRY<-interp::triangles(DTY)[,1:3]; index.delaunay.tri(Xp[10,],Yp,DTY) ind.DT<-vector() for (i in 1:nx) ind.DT<-c(ind.DT,index.delaunay.tri(Xp[i,],Yp)) ind.DT Xlim<-range(Yp[,1],Xp[,1]) Ylim<-range(Yp[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points #plot of the data in the convex hull of Y points together with the Delaunay triangulation plot(Xp,main=" ", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points = TRUE,pch=16,col="blue") points(Xp,pch=".",cex=3) text(Xp,labels = factor(ind.DT)) ## End(Not run) ## Not run: #Examples for indices.delaunay.tri #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) Yp<-cbind(runif(ny),runif(ny)) Xp<-runif.multi.tri(nx,Yp)$g #data under CSR in the convex hull of Ypoints #try also Xp<-cbind(runif(nx),runif(nx)) tr.ind<-indices.delaunay.tri(Xp,Yp) #indices of the Delaunay triangles tr.ind #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points tr.ind<-indices.delaunay.tri(Xp,Yp,DTY) #indices of the Delaunay triangles tr.ind Xlim<-range(Yp[,1],Xp[,1]) Ylim<-range(Yp[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation par(pty = "s") plot(Xp,main=" ", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),pch=".") interp::plot.triSht(DTY, add=TRUE, do.points = TRUE,pch=16,col="blue") text(Xp,labels = factor(tr.ind)) ## End(Not run)
Two functions: muCS1D
and asyvarCS1D
.
muCS1D
returns the mean of the (arc) density of CS-PCD
and asyvarCS1D
returns the (asymptotic) variance of the arc density of CS-PCD
for a given centrality parameter and an expansion parameter
and 1D uniform data in a
finite interval
, i.e., data from
distribution.
See also (Ceyhan (2016)).
muCS1D(t, c) asyvarCS1D(t, c)
muCS1D(t, c) asyvarCS1D(t, c)
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
muCS1D
returns the mean and asyvarCS1D
returns the asymptotic variance of the
arc density of CS-PCD for uniform data in an interval
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
muPE1D
and asyvarPE1D
#Examples for muCS1D muCS1D(1.2,.4) muCS1D(1.2,.6) tseq<-seq(0.01,5,by=.05) cseq<-seq(0.01,.99,by=.05) ltseq<-length(tseq) lcseq<-length(cseq) mu.grid<-matrix(0,nrow=ltseq,ncol=lcseq) for (i in 1:ltseq) for (j in 1:lcseq) { mu.grid[i,j]<-muCS1D(tseq[i],cseq[j]) } persp(tseq,cseq,mu.grid, xlab="t", ylab="c", zlab="mu(t,c)",theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") #Examples for asyvarCS1D asyvarCS1D(1.2,.8) tseq<-seq(0.01,5,by=.05) cseq<-seq(0.01,.99,by=.05) ltseq<-length(tseq) lcseq<-length(cseq) var.grid<-matrix(0,nrow=ltseq,ncol=lcseq) for (i in 1:ltseq) for (j in 1:lcseq) { var.grid[i,j]<-asyvarCS1D(tseq[i],cseq[j]) } persp(tseq,cseq,var.grid, xlab="t", ylab="c", zlab="var(t,c)", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed")
#Examples for muCS1D muCS1D(1.2,.4) muCS1D(1.2,.6) tseq<-seq(0.01,5,by=.05) cseq<-seq(0.01,.99,by=.05) ltseq<-length(tseq) lcseq<-length(cseq) mu.grid<-matrix(0,nrow=ltseq,ncol=lcseq) for (i in 1:ltseq) for (j in 1:lcseq) { mu.grid[i,j]<-muCS1D(tseq[i],cseq[j]) } persp(tseq,cseq,mu.grid, xlab="t", ylab="c", zlab="mu(t,c)",theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") #Examples for asyvarCS1D asyvarCS1D(1.2,.8) tseq<-seq(0.01,5,by=.05) cseq<-seq(0.01,.99,by=.05) ltseq<-length(tseq) lcseq<-length(cseq) var.grid<-matrix(0,nrow=ltseq,ncol=lcseq) for (i in 1:ltseq) for (j in 1:lcseq) { var.grid[i,j]<-asyvarCS1D(tseq[i],cseq[j]) } persp(tseq,cseq,var.grid, xlab="t", ylab="c", zlab="var(t,c)", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed")
Two functions: muCS2D
and asyvarCS2D
.
muCS2D
returns the mean of the (arc) density of CS-PCD
and asyvarCS2D
returns the asymptotic variance of the arc density of CS-PCD
with expansion parameter for 2D uniform data in a triangle.
CS proximity regions are defined with respect to the triangle and
vertex regions are based on center of mass, of the triangle.
See also (Ceyhan (2005); Ceyhan et al. (2007)).
muCS2D(t) asyvarCS2D(t)
muCS2D(t) asyvarCS2D(t)
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
muCS2D
returns the mean and asyvarCS2D
returns the (asymptotic) variance of the
arc density of CS-PCD for uniform data in any triangle
Elvan Ceyhan
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
muPE2D
and asyvarPE2D
## Not run: #Examples for muCS2D muCS2D(.5) tseq<-seq(0.01,5,by=.1) ltseq<-length(tseq) mu<-vector() for (i in 1:ltseq) { mu<-c(mu,muCS2D(tseq[i])) } plot(tseq, mu,type="l",xlab="t",ylab=expression(mu(t)),lty=1,xlim=range(tseq)) ## End(Not run) ## Not run: #Examples for asyvarCS2D asyvarCS2D(.5) tseq<-seq(0.01,10,by=.1) ltseq<-length(tseq) asyvar<-vector() for (i in 1:ltseq) { asyvar<-c(asyvar,asyvarCS2D(tseq[i])) } par(mar=c(5,5,4,2)) plot(tseq, asyvar,type="l",xlab="t",ylab=expression(paste(sigma^2,"(t)")),lty=1,xlim=range(tseq)) ## End(Not run)
## Not run: #Examples for muCS2D muCS2D(.5) tseq<-seq(0.01,5,by=.1) ltseq<-length(tseq) mu<-vector() for (i in 1:ltseq) { mu<-c(mu,muCS2D(tseq[i])) } plot(tseq, mu,type="l",xlab="t",ylab=expression(mu(t)),lty=1,xlim=range(tseq)) ## End(Not run) ## Not run: #Examples for asyvarCS2D asyvarCS2D(.5) tseq<-seq(0.01,10,by=.1) ltseq<-length(tseq) asyvar<-vector() for (i in 1:ltseq) { asyvar<-c(asyvar,asyvarCS2D(tseq[i])) } par(mar=c(5,5,4,2)) plot(tseq, asyvar,type="l",xlab="t",ylab=expression(paste(sigma^2,"(t)")),lty=1,xlim=range(tseq)) ## End(Not run)
Two functions: muCSend.int
and asyvarCSend.int
.
muCSend.int
returns the mean of the arc density of CS-PCD
and asyvarCSend.int
returns the asymptotic variance of the arc density of CS-PCD
for a given expansion parameter for 1D uniform data in the left and right end intervals
for the interval
.
See also (Ceyhan (2016)).
muCSend.int(t) asyvarCSend.int(t)
muCSend.int(t) asyvarCSend.int(t)
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
funsMuVarCSend.int
muCSend.int
returns the mean and asyvarCSend.int
returns the asymptotic variance of the
arc density of CS-PCD for uniform data in end intervals
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
muPEend.int
and asyvarPEend.int
#Examples for muCSend.int muCSend.int(1.2) tseq<-seq(0.01,5,by=.05) ltseq<-length(tseq) mu.end<-vector() for (i in 1:ltseq) { mu.end<-c(mu.end,muCSend.int(tseq[i])) } oldpar <- par(no.readonly = TRUE) par(mar = c(5,4,4,2) + 0.1) plot(tseq, mu.end,type="l", ylab=expression(paste(mu,"(t)")),xlab="t",lty=1,xlim=range(tseq),ylim=c(0,1)) par(oldpar) #Examples for asyvarCSend.int asyvarCSend.int(1.2) tseq<-seq(.01,5,by=.05) ltseq<-length(tseq) var.end<-vector() for (i in 1:ltseq) { var.end<-c(var.end,asyvarCSend.int(tseq[i])) } oldpar <- par(no.readonly = TRUE) par(mar=c(5,5,4,2)) plot(tseq, var.end,type="l",xlab="t",ylab=expression(paste(sigma^2,"(t)")),lty=1,xlim=range(tseq)) par(oldpar)
#Examples for muCSend.int muCSend.int(1.2) tseq<-seq(0.01,5,by=.05) ltseq<-length(tseq) mu.end<-vector() for (i in 1:ltseq) { mu.end<-c(mu.end,muCSend.int(tseq[i])) } oldpar <- par(no.readonly = TRUE) par(mar = c(5,4,4,2) + 0.1) plot(tseq, mu.end,type="l", ylab=expression(paste(mu,"(t)")),xlab="t",lty=1,xlim=range(tseq),ylim=c(0,1)) par(oldpar) #Examples for asyvarCSend.int asyvarCSend.int(1.2) tseq<-seq(.01,5,by=.05) ltseq<-length(tseq) var.end<-vector() for (i in 1:ltseq) { var.end<-c(var.end,asyvarCSend.int(tseq[i])) } oldpar <- par(no.readonly = TRUE) par(mar=c(5,5,4,2)) plot(tseq, var.end,type="l",xlab="t",ylab=expression(paste(sigma^2,"(t)")),lty=1,xlim=range(tseq)) par(oldpar)
The functions muPE1D
and asyvarPE1D
and their auxiliary functions.
muPE1D
returns the mean of the (arc) density of PE-PCD
and asyvarPE1D
returns the (asymptotic) variance of the arc density of PE-PCD
for a given centrality parameter and an expansion parameter
and for 1D uniform data in a
finite interval
, i.e., data from
distribution.
muPE1D
uses auxiliary (internal) function mu1PE1D
which yields mean (i.e., expected value)
of the arc density of PE-PCD for a given and
.
asyvarPE1D
uses auxiliary (internal) functions fvar1
which yields asymptotic variance
of the arc density of PE-PCD for and
; and
fvar2
which yields asymptotic variance
of the arc density of PE-PCD for and
.
See also (Ceyhan (2012)).
mu1PE1D(r, c) muPE1D(r, c) fvar1(r, c) fvar2(r, c) asyvarPE1D(r, c)
mu1PE1D(r, c) muPE1D(r, c) fvar1(r, c) fvar2(r, c) asyvarPE1D(r, c)
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
muPE1D
returns the mean and asyvarPE1D
returns the asymptotic variance of the
arc density of PE-PCD for data
Elvan Ceyhan
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.
muCS1D
and asyvarCS1D
## Not run: #Examples for muPE1D muPE1D(1.2,.4) muPE1D(1.2,.6) rseq<-seq(1.01,5,by=.1) cseq<-seq(0.01,.99,by=.1) lrseq<-length(rseq) lcseq<-length(cseq) mu.grid<-matrix(0,nrow=lrseq,ncol=lcseq) for (i in 1:lrseq) for (j in 1:lcseq) { mu.grid[i,j]<-muPE1D(rseq[i],cseq[j]) } persp(rseq,cseq,mu.grid, xlab="r", ylab="c", zlab="mu(r,c)", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") ## End(Not run) ## Not run: #Examples for asyvarPE1D asyvarPE1D(1.2,.8) rseq<-seq(1.01,5,by=.1) cseq<-seq(0.01,.99,by=.1) lrseq<-length(rseq) lcseq<-length(cseq) var.grid<-matrix(0,nrow=lrseq,ncol=lcseq) for (i in 1:lrseq) for (j in 1:lcseq) { var.grid[i,j]<-asyvarPE1D(rseq[i],cseq[j]) } persp(rseq,cseq,var.grid, xlab="r", ylab="c", zlab="var(r,c)", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") ## End(Not run)
## Not run: #Examples for muPE1D muPE1D(1.2,.4) muPE1D(1.2,.6) rseq<-seq(1.01,5,by=.1) cseq<-seq(0.01,.99,by=.1) lrseq<-length(rseq) lcseq<-length(cseq) mu.grid<-matrix(0,nrow=lrseq,ncol=lcseq) for (i in 1:lrseq) for (j in 1:lcseq) { mu.grid[i,j]<-muPE1D(rseq[i],cseq[j]) } persp(rseq,cseq,mu.grid, xlab="r", ylab="c", zlab="mu(r,c)", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") ## End(Not run) ## Not run: #Examples for asyvarPE1D asyvarPE1D(1.2,.8) rseq<-seq(1.01,5,by=.1) cseq<-seq(0.01,.99,by=.1) lrseq<-length(rseq) lcseq<-length(cseq) var.grid<-matrix(0,nrow=lrseq,ncol=lcseq) for (i in 1:lrseq) for (j in 1:lcseq) { var.grid[i,j]<-asyvarPE1D(rseq[i],cseq[j]) } persp(rseq,cseq,var.grid, xlab="r", ylab="c", zlab="var(r,c)", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") ## End(Not run)
Two functions: muPE2D
and asyvarPE2D
.
muPE2D
returns the mean of the (arc) density of PE-PCD
and asyvarPE2D
returns the asymptotic variance
of the arc density of PE-PCD
for 2D uniform data in a triangle.
PE proximity regions are defined
with expansion parameter
with respect to the triangle
in which the points reside and
vertex regions are based on center of mass,
of the triangle.
See also (Ceyhan et al. (2006)).
muPE2D(r) asyvarPE2D(r)
muPE2D(r) asyvarPE2D(r)
r |
A positive real number which serves
as the expansion parameter in PE proximity region;
must be |
muPE2D
returns the mean
and asyvarPE2D
returns the (asymptotic) variance of the
arc density of PE-PCD for uniform data in any triangle.
Elvan Ceyhan
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
muCS2D
and asyvarCS2D
## Not run: #Examples for muPE2D muPE2D(1.2) rseq<-seq(1.01,5,by=.05) lrseq<-length(rseq) mu<-vector() for (i in 1:lrseq) { mu<-c(mu,muPE2D(rseq[i])) } plot(rseq, mu,type="l",xlab="r",ylab=expression(mu(r)),lty=1, xlim=range(rseq),ylim=c(0,1)) ## End(Not run) ## Not run: #Examples for asyvarPE2D asyvarPE2D(1.2) rseq<-seq(1.01,5,by=.05) lrseq<-length(rseq) avar<-vector() for (i in 1:lrseq) { avar<-c(avar,asyvarPE2D(rseq[i])) } par(mar=c(5,5,4,2)) plot(rseq, avar,type="l",xlab="r", ylab=expression(paste(sigma^2,"(r)")),lty=1,xlim=range(rseq)) ## End(Not run)
## Not run: #Examples for muPE2D muPE2D(1.2) rseq<-seq(1.01,5,by=.05) lrseq<-length(rseq) mu<-vector() for (i in 1:lrseq) { mu<-c(mu,muPE2D(rseq[i])) } plot(rseq, mu,type="l",xlab="r",ylab=expression(mu(r)),lty=1, xlim=range(rseq),ylim=c(0,1)) ## End(Not run) ## Not run: #Examples for asyvarPE2D asyvarPE2D(1.2) rseq<-seq(1.01,5,by=.05) lrseq<-length(rseq) avar<-vector() for (i in 1:lrseq) { avar<-c(avar,asyvarPE2D(rseq[i])) } par(mar=c(5,5,4,2)) plot(rseq, avar,type="l",xlab="r", ylab=expression(paste(sigma^2,"(r)")),lty=1,xlim=range(rseq)) ## End(Not run)
Two functions: muPEend.int
and asyvarPEend.int
.
muPEend.int
returns the mean of the arc density of PE-PCD
and asyvarPEend.int
returns the asymptotic variance of the arc density of PE-PCD
for a given expansion parameter for 1D uniform data in the left and right end intervals
for the interval
.
See also (Ceyhan (2012)).
muPEend.int(r) asyvarPEend.int(r)
muPEend.int(r) asyvarPEend.int(r)
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
muPEend.int
returns the mean and asyvarPEend.int
returns the asymptotic variance of the
arc density of PE-PCD for uniform data in end intervals
Elvan Ceyhan
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.
muCSend.int
and asyvarCSend.int
## Not run: #Examples for muPEend.int muPEend.int(1.2) rseq<-seq(1.01,5,by=.1) lrseq<-length(rseq) mu.end<-vector() for (i in 1:lrseq) { mu.end<-c(mu.end,muPEend.int(rseq[i])) } plot(rseq, mu.end,type="l", ylab=expression(paste(mu,"(r)")),xlab="r",lty=1,xlim=range(rseq),ylim=c(0,1)) ## End(Not run) ## Not run: #Examples for asyvarPEend.int asyvarPEend.int(1.2) rseq<-seq(1.01,5,by=.1) lrseq<-length(rseq) var.end<-vector() for (i in 1:lrseq) { var.end<-c(var.end,asyvarPEend.int(rseq[i])) } par(mar=c(5,5,4,2)) plot(rseq, var.end,type="l", xlab="r",ylab=expression(paste(sigma^2,"(r)")),lty=1,xlim=range(rseq)) ## End(Not run)
## Not run: #Examples for muPEend.int muPEend.int(1.2) rseq<-seq(1.01,5,by=.1) lrseq<-length(rseq) mu.end<-vector() for (i in 1:lrseq) { mu.end<-c(mu.end,muPEend.int(rseq[i])) } plot(rseq, mu.end,type="l", ylab=expression(paste(mu,"(r)")),xlab="r",lty=1,xlim=range(rseq),ylim=c(0,1)) ## End(Not run) ## Not run: #Examples for asyvarPEend.int asyvarPEend.int(1.2) rseq<-seq(1.01,5,by=.1) lrseq<-length(rseq) var.end<-vector() for (i in 1:lrseq) { var.end<-c(var.end,asyvarPEend.int(rseq[i])) } par(mar=c(5,5,4,2)) plot(rseq, var.end,type="l", xlab="r",ylab=expression(paste(sigma^2,"(r)")),lty=1,xlim=range(rseq)) ## End(Not run)
for Proportional Edge Proximity Catch Digraphs
(PE-PCDs) - middle interval caseThe function Pdom.num2PE1D
and its auxiliary functions.
Returns for PE-PCD whose vertices are a uniform data set of size
n
in a finite interval
where
stands for the domination number.
The PE proximity region is defined with respect to
with centrality parameter
and expansion parameter
.
To compute the probability for PE-PCD in the 1D case,
we partition the domain
, and compute the probability for each partition
set. The sample size (i.e., number of vertices or data points) is a positive integer,
n
.
Pdom.num2AI(r, c, n) Pdom.num2AII(r, c, n) Pdom.num2AIII(r, c, n) Pdom.num2AIV(r, c, n) Pdom.num2A(r, c, n) Pdom.num2Asym(r, c, n) Pdom.num2BIII(r, c, n) Pdom.num2B(r, c, n) Pdom.num2Bsym(r, c, n) Pdom.num2CIV(r, c, n) Pdom.num2C(r, c, n) Pdom.num2Csym(r, c, n) Pdom.num2PE1D(r, c, n)
Pdom.num2AI(r, c, n) Pdom.num2AII(r, c, n) Pdom.num2AIII(r, c, n) Pdom.num2AIV(r, c, n) Pdom.num2A(r, c, n) Pdom.num2Asym(r, c, n) Pdom.num2BIII(r, c, n) Pdom.num2B(r, c, n) Pdom.num2Bsym(r, c, n) Pdom.num2CIV(r, c, n) Pdom.num2C(r, c, n) Pdom.num2Csym(r, c, n) Pdom.num2PE1D(r, c, n)
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
n |
A positive integer representing the size of the uniform data set. |
domination number
for PE-PCD whose vertices are a uniform data set of size
n
in a finite
interval
Pdom.num2PE1D
The auxiliary functions are Pdom.num2AI, Pdom.num2AII, Pdom.num2AIII, Pdom.num2AIV, Pdom.num2A, Pdom.num2Asym, Pdom.num2BIII, Pdom.num2B, Pdom.num2B,
Pdom.num2Bsym, Pdom.num2CIV, Pdom.num2C
, and Pdom.num2Csym
, each corresponding to a partition of the domain of
r
and c
. In particular, the domain partition is handled in 3 cases as
CASE A:
CASE B: and
CASE C: .
In Case A, we compute with
Pdom.num2AIV(r,c,n)
if ;
Pdom.num2AIII(r,c,n)
if ;
Pdom.num2AII(r,c,n)
if ;
and Pdom.num2AI(r,c,n)
otherwise.
Pdom.num2A(r,c,n)
combines these functions in Case A: .
Due to the symmetry in the PE proximity regions, we use
Pdom.num2Asym(r,c,n)
for in
with the same auxiliary functions
Pdom.num2AIV(r,1-c,n)
if ;
Pdom.num2AIII(r,1-c,n)
if ;
Pdom.num2AII(r,1-c,n)
if ;
and Pdom.num2AI(r,1-c,n)
otherwise.
In Case B, we compute with
Pdom.num2AIV(r,c,n)
if ;
Pdom.num2BIII(r,c,n)
if ;
Pdom.num2AII(r,c,n)
if ;
and Pdom.num2AI(r,c,n)
otherwise.
Pdom.num2B(r,c,n)
combines these functions in Case B: .
Due to the symmetry in the PE proximity regions,
we use
Pdom.num2Bsym(r,c,n)
for c
in
with the same auxiliary functions
Pdom.num2AIV(r,1-c,n)
if ;
Pdom.num2BIII(r,1-c,n)
if ;
Pdom.num2AII(r,1-c,n)
if ;
and Pdom.num2AI(r,1-c,n)
otherwise.
In Case C, we compute with
Pdom.num2AIV(r,c,n)
if ;
Pdom.num2BIII(r,c,n)
if ;
Pdom.num2CIV(r,c,n)
if ;
Pdom.num2BIII(r,c,n)
if ;
Pdom.num2AII(r,c,n)
if ;
and Pdom.num2AI(r,c,n)
otherwise.
Pdom.num2C(r,c,n)
combines these functions in Case C: .
Due to the symmetry in the PE proximity regions,
we use
Pdom.num2Csym(r,c,n)
for
with the same auxiliary functions
Pdom.num2AIV(r,1-c,n)
if ;
Pdom.num2BIII(r,1-c,n)
if ;
Pdom.num2CIV(r,1-c,n)
if ;
Pdom.num2BIII(r,1-c,n)
if ;
Pdom.num2AII(r,1-c,n)
if ;
and Pdom.num2AI(r,1-c,n)
otherwise.
Combining Cases A, B, and C, we get our main function Pdom.num2PE1D
which computes
for any (
r,c
) in its domain.
Elvan Ceyhan
Pdom.num2PEtri
and Pdom.num2PE1Dasy
#Examples for the main function Pdom.num2PE1D r<-2 c<-.5 Pdom.num2PE1D(r,c,n=10) Pdom.num2PE1D(r=1.5,c=1/1.5,n=100)
#Examples for the main function Pdom.num2PE1D r<-2 c<-.5 Pdom.num2PE1D(r,c,n=10) Pdom.num2PE1D(r=1.5,c=1/1.5,n=100)
Two functions: rank.dist2edges.std.tri
and order.dist2edges.std.tri
.
rank.dist2edges.std.tri
finds the ranks of the distances of points
in data, Xp
, to the edges of the standard equilateral triangle
dec
is a logical argument, default is TRUE
,
so the ranks are for decreasing distances, if FALSE
it will be
in increasing distances.
order.dist2edges.std.tri
finds the orders of the distances of points
in data, Xp
, to the edges of .
The arguments are as in
rank.dist2edges.std.tri
.
rank.dist2edges.std.tri(Xp, dec = TRUE) order.dist2edges.std.tri(Xp, dec = TRUE)
rank.dist2edges.std.tri(Xp, dec = TRUE) order.dist2edges.std.tri(Xp, dec = TRUE)
Xp |
A set of 2D points representing the data set
in which ranking in terms of the distance
to the edges of |
dec |
A logical argument
indicating the how the ranking will be performed.
If |
A list
with two elements
distances |
Distances from data points to the edges of |
dist.rank |
The ranks of the data points
in decreasing distances to the edges of |
Elvan Ceyhan
## Not run: #Examples for rank.dist2edges.std.tri n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points dec.dist<-rank.dist2edges.std.tri(Xp) dec.dist dec.dist.rank<-dec.dist[[2]] #the rank of distances to the edges in decreasing order dec.dist.rank A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.0,.01), ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp,pch=".") text(Xp,labels = factor(dec.dist.rank) ) inc.dist<-rank.dist2edges.std.tri(Xp,dec = FALSE) inc.dist inc.dist.rank<-inc.dist[[2]] #the rank of distances to the edges in increasing order inc.dist.rank dist<-inc.dist[[1]] #distances to the edges of the std eq. triangle dist plot(A,pch=".",xlab="",ylab="",xlim=Xlim,ylim=Ylim) polygon(Te) points(Xp,pch=".",xlab="",ylab="", main="",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) text(Xp,labels = factor(inc.dist.rank)) ## End(Not run) ## Not run: #Examples for order.dist2edges.std.tri n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points #try also Xp<-cbind(runif(n),runif(n)) dec.dist<-order.dist2edges.std.tri(Xp) dec.dist dec.dist.order<-dec.dist[[2]] #the order of distances to the edges in decreasing order dec.dist.order A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp,pch=".") text(Xp[dec.dist.order,],labels = factor(1:n) ) inc.dist<-order.dist2edges.std.tri(Xp,dec = FALSE) inc.dist inc.dist.order<-inc.dist[[2]] #the order of distances to the edges in increasing order inc.dist.order dist<-inc.dist[[1]] #distances to the edges of the std eq. triangle dist dist[inc.dist.order] #distances in increasing order plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".") text(Xp[inc.dist.order,],labels = factor(1:n)) ## End(Not run)
## Not run: #Examples for rank.dist2edges.std.tri n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points dec.dist<-rank.dist2edges.std.tri(Xp) dec.dist dec.dist.rank<-dec.dist[[2]] #the rank of distances to the edges in decreasing order dec.dist.rank A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.0,.01), ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp,pch=".") text(Xp,labels = factor(dec.dist.rank) ) inc.dist<-rank.dist2edges.std.tri(Xp,dec = FALSE) inc.dist inc.dist.rank<-inc.dist[[2]] #the rank of distances to the edges in increasing order inc.dist.rank dist<-inc.dist[[1]] #distances to the edges of the std eq. triangle dist plot(A,pch=".",xlab="",ylab="",xlim=Xlim,ylim=Ylim) polygon(Te) points(Xp,pch=".",xlab="",ylab="", main="",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) text(Xp,labels = factor(inc.dist.rank)) ## End(Not run) ## Not run: #Examples for order.dist2edges.std.tri n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points #try also Xp<-cbind(runif(n),runif(n)) dec.dist<-order.dist2edges.std.tri(Xp) dec.dist dec.dist.order<-dec.dist[[2]] #the order of distances to the edges in decreasing order dec.dist.order A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp,pch=".") text(Xp[dec.dist.order,],labels = factor(1:n) ) inc.dist<-order.dist2edges.std.tri(Xp,dec = FALSE) inc.dist inc.dist.order<-inc.dist[[2]] #the order of distances to the edges in increasing order inc.dist.order dist<-inc.dist[[1]] #distances to the edges of the std eq. triangle dist dist[inc.dist.order] #distances in increasing order plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".") text(Xp[inc.dist.order,],labels = factor(1:n)) ## End(Not run)
lineD1CCinTb
and lineD2CCinTb
which are of class "TriLines"
—
The lines joining the midpoints of edges to the circumcenter (
) in the standard basic triangle.Returns the equation, slope, intercept
, and -coordinates of the lines
joining
and
and also
and
, in the standard basic triangle
where
is in
,
and
and
and
are the midpoints of edges
and
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions
(i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the
original triangle. Hence standard basic triangle is useful for simulation
studies under the uniformity hypothesis.
-coordinates are provided in
vector
x
.
lineD1CCinTb(x, c1, c2) lineD2CCinTb(x, c1, c2)
lineD1CCinTb(x, c1, c2) lineD2CCinTb(x, c1, c2)
x |
A single scalar or a |
c1 , c2
|
Positive real numbers which constitute the vertex of the standard basic triangle
adjacent to the shorter edges; |
A list
with the elements
txt1 |
Longer description of the line. |
txt2 |
Shorter description of the line (to be inserted over the line in the plot). |
mtitle |
The |
cent |
The center chosen inside the standard equilateral triangle. |
cent.name |
The name of the center inside the standard basic triangle.
It is |
tri |
The triangle (it is the standard basic triangle for this function). |
x |
The input vector, can be a scalar or a |
y |
The output vector, will be a scalar if |
slope |
Slope of the line. |
intercept |
Intercept of the line. |
equation |
Equation of the line. |
Elvan Ceyhan
lineA2CMinTe
, lineB2CMinTe
, lineA2MinTe
,
lineB2MinTe
, and lineC2MinTe
## Not run: #Examples for lineD1CCinTb c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle Tb Tb<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by=.1) #try also by=.01 lnD1CC<-lineD1CCinTb(x,c1,c2) lnD1CC summary(lnD1CC) plot(lnD1CC) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) x1<-seq(0,1,by=.1) #try also by=.01 y1<-lineD1CCinTb(x1,c1,c2)$y Xlim<-range(Tb[,1],x1) Ylim<-range(Tb[,2],y1) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.04,.03,.02,.09,-.08,0) yc<-txt[,2]+c(.02,.02,.04,.08,.03,.03,-.05) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) lines(x1,y1,type="l",lty=2) text(.8,.5,"lineD1CCinTb") c1<-.4; c2<-.6; x1<-seq(0,1,by=.1) #try also by=.01 lineD1CCinTb(x1,c1,c2) ## End(Not run) ## Not run: #Examples for lineD2CCinTb c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle Tb Tb<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by=.1) #try also by=.01 lnD2CC<-lineD2CCinTb(x,c1,c2) lnD2CC summary(lnD2CC) plot(lnD2CC) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) x2<-seq(0,1,by=.1) #try also by=.01 y2<-lineD2CCinTb(x2,c1,c2)$y Xlim<-range(Tb[,1],x1) Ylim<-range(Tb[,2],y2) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.04,.03,.02,.09,-.08,0) yc<-txt[,2]+c(.02,.02,.04,.08,.03,.03,-.05) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) lines(x2,y2,type="l",lty=2) text(0,.5,"lineD2CCinTb") ## End(Not run)
## Not run: #Examples for lineD1CCinTb c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle Tb Tb<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by=.1) #try also by=.01 lnD1CC<-lineD1CCinTb(x,c1,c2) lnD1CC summary(lnD1CC) plot(lnD1CC) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) x1<-seq(0,1,by=.1) #try also by=.01 y1<-lineD1CCinTb(x1,c1,c2)$y Xlim<-range(Tb[,1],x1) Ylim<-range(Tb[,2],y1) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.04,.03,.02,.09,-.08,0) yc<-txt[,2]+c(.02,.02,.04,.08,.03,.03,-.05) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) lines(x1,y1,type="l",lty=2) text(.8,.5,"lineD1CCinTb") c1<-.4; c2<-.6; x1<-seq(0,1,by=.1) #try also by=.01 lineD1CCinTb(x1,c1,c2) ## End(Not run) ## Not run: #Examples for lineD2CCinTb c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); #the vertices of the standard basic triangle Tb Tb<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,by=.1) #try also by=.01 lnD2CC<-lineD2CCinTb(x,c1,c2) lnD2CC summary(lnD2CC) plot(lnD2CC) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; #midpoints of the edges Ds<-rbind(D1,D2,D3) x2<-seq(0,1,by=.1) #try also by=.01 y2<-lineD2CCinTb(x2,c1,c2)$y Xlim<-range(Tb[,1],x1) Ylim<-range(Tb[,2],y2) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) txt<-rbind(Tb,CC,D1,D2,D3) xc<-txt[,1]+c(-.03,.04,.03,.02,.09,-.08,0) yc<-txt[,2]+c(.02,.02,.04,.08,.03,.03,-.05) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) lines(x2,y2,type="l",lty=2) text(0,.5,"lineD2CCinTb") ## End(Not run)
Returns for points
p1
and p2
, that is, returns 1 if is in
, returns 0
otherwise, where
is the AS proximity region for point
.
AS proximity region is constructed in the standard basic triangle
where
is in
,
and
.
Vertex regions are based on the center M="CC"
for circumcenter of ;
or
in Cartesian coordinates or
in barycentric coordinates in the
interior of
; default is
M="CC"
i.e., circumcenter of .
rv
is the index of the vertex region p1
resides, with default=NULL
.
If p1
and p2
are distinct and either of them are outside , the function returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence standard basic triangle is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010)).
IarcASbasic.tri(p1, p2, c1, c2, M = "CC", rv = NULL)
IarcASbasic.tri(p1, p2, c1, c2, M = "CC", rv = NULL)
p1 |
A 2D point whose AS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
c1 , c2
|
Positive real numbers representing the top vertex in standard basic triangle |
M |
The center of the triangle. |
rv |
The index of the |
for points
p1
and p2
, that is, returns 1 if is in
(i.e., if there is an arc from
p1
to p2
), returns 0 otherwise.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) P2<-as.numeric(runif.basic.tri(1,c1,c2)$g) IarcASbasic.tri(P1,P2,c1,c2,M) P1<-c(.3,.2) P2<-c(.6,.2) IarcASbasic.tri(P1,P2,c1,c2,M) #or try Rv<-rel.vert.basic.triCC(P1,c1,c2)$rv IarcASbasic.tri(P1,P2,c1,c2,M,Rv) P1<-c(.3,.2) P2<-c(.8,.2) IarcASbasic.tri(P1,P2,c1,c2,M) P3<-c(.5,.4) IarcASbasic.tri(P1,P3,c1,c2,M) P4<-c(1.5,.4) IarcASbasic.tri(P1,P4,c1,c2,M) IarcASbasic.tri(P4,P4,c1,c2,M) c1<-.4; c2<-.6; P1<-c(.3,.2) P2<-c(.6,.2) IarcASbasic.tri(P1,P2,c1,c2,M) ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) P2<-as.numeric(runif.basic.tri(1,c1,c2)$g) IarcASbasic.tri(P1,P2,c1,c2,M) P1<-c(.3,.2) P2<-c(.6,.2) IarcASbasic.tri(P1,P2,c1,c2,M) #or try Rv<-rel.vert.basic.triCC(P1,c1,c2)$rv IarcASbasic.tri(P1,P2,c1,c2,M,Rv) P1<-c(.3,.2) P2<-c(.8,.2) IarcASbasic.tri(P1,P2,c1,c2,M) P3<-c(.5,.4) IarcASbasic.tri(P1,P3,c1,c2,M) P4<-c(1.5,.4) IarcASbasic.tri(P1,P4,c1,c2,M) IarcASbasic.tri(P4,P4,c1,c2,M) c1<-.4; c2<-.6; P1<-c(.3,.2) P2<-c(.6,.2) IarcASbasic.tri(P1,P2,c1,c2,M) ## End(Not run)
S
to the point p
for
Arc Slice Proximity Catch Digraphs (AS-PCDs) - one triangle caseReturns I( for some
), that is, returns 1 if
is in
,
returns 0 otherwise, where
is the AS proximity region for point
.
AS proximity regions are constructed with respect to the triangle, tri
(rv=1,rv=2,rv=3)
,
and vertices of tri
are also labeled as 1,2, and 3, respectively.
Vertex regions are based on the center M="CC"
for circumcenter of tri
;
or in Cartesian coordinates or
in barycentric coordinates in the
interior of the triangle
tri
; default is M="CC"
i.e., circumcenter of tri
.
If p
is not in S
and either p
or all points in S
are outside tri
, it returns 0,
but if p
is in S
, then it always returns 1 (i.e., loops are allowed).
See also (Ceyhan (2005, 2010)).
IarcASset2pnt.tri(S, p, tri, M = "CC")
IarcASset2pnt.tri(S, p, tri, M = "CC")
S |
A set of 2D points whose AS proximity regions are considered. |
p |
A 2D point. The function determines whether |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
, that is, returns 1 if
p
is in S
or inside for at least
one
in
S
, returns 0 otherwise, where AS proximity region is constructed in tri
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
IarcAStri
, IarcASset2pnt.tri
, and IarcCSset2pnt.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(1.5,1) M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) IarcASset2pnt.tri(S,Xp[3,],Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) IarcASset2pnt.tri(S,Xp[3,],Tr,M) IarcASset2pnt.tri(S,Xp[6,],Tr,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcASset2pnt.tri(S,Xp[3,],Tr,M) IarcASset2pnt.tri(c(.2,.5),Xp[2,],Tr,M) IarcASset2pnt.tri(Xp,c(.2,.5),Tr,M) IarcASset2pnt.tri(Xp,Xp[2,],Tr,M) IarcASset2pnt.tri(c(.2,.5),c(.2,.5),Tr,M) IarcASset2pnt.tri(Xp[5,],Xp[2,],Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,],c(.2,.5)) IarcASset2pnt.tri(S,Xp[3,],Tr,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] IarcASset2pnt.tri(Xp,P,Tr,M) IarcASset2pnt.tri(S,P,Tr,M) IarcASset2pnt.tri(rbind(S,S),P,Tr,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(1.5,1) M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) IarcASset2pnt.tri(S,Xp[3,],Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) IarcASset2pnt.tri(S,Xp[3,],Tr,M) IarcASset2pnt.tri(S,Xp[6,],Tr,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcASset2pnt.tri(S,Xp[3,],Tr,M) IarcASset2pnt.tri(c(.2,.5),Xp[2,],Tr,M) IarcASset2pnt.tri(Xp,c(.2,.5),Tr,M) IarcASset2pnt.tri(Xp,Xp[2,],Tr,M) IarcASset2pnt.tri(c(.2,.5),c(.2,.5),Tr,M) IarcASset2pnt.tri(Xp[5,],Xp[2,],Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,],c(.2,.5)) IarcASset2pnt.tri(S,Xp[3,],Tr,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] IarcASset2pnt.tri(Xp,P,Tr,M) IarcASset2pnt.tri(S,P,Tr,M) IarcASset2pnt.tri(rbind(S,S),P,Tr,M) ## End(Not run)
Returns for points
p1
and p2
, that is, returns 1 if is in
, returns 0
otherwise, where
is the AS proximity region for point
.
AS proximity regions are constructed with respect to the triangle, tri
(rv=1,rv=2,rv=3)
,
and vertex regions are based on the center M="CC"
for circumcenter of tri
;
or in Cartesian coordinates or
in barycentric coordinates in the
interior of the triangle
tri
; default is M="CC"
i.e., circumcenter of tri
.
rv
is the index of the vertex region p1
resides, with default=NULL
.
If p1
and p2
are distinct and either of them are outside tri
, the function returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2005, 2010)).
IarcAStri(p1, p2, tri, M = "CC", rv = NULL)
IarcAStri(p1, p2, tri, M = "CC", rv = NULL)
p1 |
A 2D point whose AS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
rv |
The index of the |
for
p1
, that is, returns 1 if is in
, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
IarcASbasic.tri
, IarcPEtri
, and IarcCStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) P1<-as.numeric(runif.tri(1,Tr)$g) P2<-as.numeric(runif.tri(1,Tr)$g) IarcAStri(P1,P2,Tr,M) P1<-c(1.3,1.2) P2<-c(1.8,.5) IarcAStri(P1,P2,Tr,M) IarcAStri(P1,P1,Tr,M) #or try Rv<-rel.vert.triCC(P1,Tr)$rv IarcAStri(P1,P2,Tr,M,Rv) P3<-c(1.6,1.4) IarcAStri(P1,P3,Tr,M) P4<-c(1.5,1.0) IarcAStri(P1,P4,Tr,M) P5<-c(.5,1.0) IarcAStri(P1,P5,Tr,M) IarcAStri(P5,P5,Tr,M) #or try Rv<-rel.vert.triCC(P5,Tr)$rv IarcAStri(P5,P5,Tr,M,Rv) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) P1<-as.numeric(runif.tri(1,Tr)$g) P2<-as.numeric(runif.tri(1,Tr)$g) IarcAStri(P1,P2,Tr,M) P1<-c(1.3,1.2) P2<-c(1.8,.5) IarcAStri(P1,P2,Tr,M) IarcAStri(P1,P1,Tr,M) #or try Rv<-rel.vert.triCC(P1,Tr)$rv IarcAStri(P1,P2,Tr,M,Rv) P3<-c(1.6,1.4) IarcAStri(P1,P3,Tr,M) P4<-c(1.5,1.0) IarcAStri(P1,P4,Tr,M) P5<-c(.5,1.0) IarcAStri(P1,P5,Tr,M) IarcAStri(P5,P5,Tr,M) #or try Rv<-rel.vert.triCC(P5,Tr)$rv IarcAStri(P5,P5,Tr,M,Rv) ## End(Not run)
Returns p2
is in for points
p1
and p2
,
that is, returns 1 if p2
is in ,
returns 0 otherwise, where
is the CS proximity region for point
with expansion parameter
.
CS proximity region is defined with respect to the standard equilateral triangle
and edge regions are based on the center of mass
.
Here
p1
must lie in the first one-sixth of , which is the triangle with vertices
.
If
p1
and p2
are distinct and p1
is outside of or
p2
is outside , it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
IarcCS.Te.onesixth(p1, p2)
IarcCS.Te.onesixth(p1, p2)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
p2
is in for
p1
in the first one-sixth of ,
, that is, returns 1 if
p2
is in , returns 0 otherwise
Elvan Ceyhan
Returns p2
is in for points
p1
and p2
,
that is, returns 1 if p2
is in ,
returns 0 otherwise, where
is the CS proximity region for point
with expansion parameter
.
CS proximity region is defined with respect to the standard basic triangle
where
is in
,
and
.
Edge regions are based on the center, in Cartesian coordinates or
in
barycentric coordinates in the interior of the standard basic triangle
;
default is
i.e., the center of mass of
.
re
is the index of the edge region p1
resides, with default=NULL
.
If p1
and p2
are distinct and either of them are outside , it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation, and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence standard basic triangle is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
IarcCSbasic.tri(p1, p2, t, c1, c2, M = c(1, 1, 1), re = NULL)
IarcCSbasic.tri(p1, p2, t, c1, c2, M = c(1, 1, 1), re = NULL)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
t |
A positive real number which serves as the expansion parameter in CS proximity region; must be |
c1 , c2
|
Positive real numbers which constitute the vertex of the standard basic triangle
adjacent to the shorter edges; |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates
which serves as a center in the interior of the standard basic triangle or circumcenter of |
re |
The index of the edge region in |
p2
is in for points
p1
and p2
,
that is, returns 1 if p2
is in ,
returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) tau<-2 P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) P2<-as.numeric(runif.basic.tri(1,c1,c2)$g) IarcCSbasic.tri(P1,P2,tau,c1,c2,M) P1<-c(.4,.2) P2<-c(.5,.26) IarcCSbasic.tri(P1,P2,tau,c1,c2,M) IarcCSbasic.tri(P1,P1,tau,c1,c2,M) #or try Re<-rel.edge.basic.tri(P1,c1,c2,M)$re IarcCSbasic.tri(P1,P2,tau,c1,c2,M,Re) IarcCSbasic.tri(P1,P1,tau,c1,c2,M,Re) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) tau<-2 P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) P2<-as.numeric(runif.basic.tri(1,c1,c2)$g) IarcCSbasic.tri(P1,P2,tau,c1,c2,M) P1<-c(.4,.2) P2<-c(.5,.26) IarcCSbasic.tri(P1,P2,tau,c1,c2,M) IarcCSbasic.tri(P1,P1,tau,c1,c2,M) #or try Re<-rel.edge.basic.tri(P1,c1,c2,M)$re IarcCSbasic.tri(P1,P2,tau,c1,c2,M,Re) IarcCSbasic.tri(P1,P1,tau,c1,c2,M,Re) ## End(Not run)
Returns p2
is in for points
p1
and p2
,
that is, returns 1 if p2
is in ,
returns 0 otherwise, where
is the CS proximity region for point
with expansion parameter
.
This function is equivalent to
IarcCSstd.tri
, except that it computes the indicator using the functions
IarcCSstd.triRAB
, IarcCSstd.triRBC
and IarcCSstd.triRAC
which are edge-region specific indicator functions.
For example,
IarcCSstd.triRAB
computes p2
is in for points
p1
and p2
when p1
resides in the edge region of edge .
CS proximity region is defined with respect to the standard equilateral triangle
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
i.e., the center of mass of
.
re
is the index of the edge region p1
resides, with default=NULL
.
If p1
and p2
are distinct and either of them are outside , it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
IarcCSedge.reg.std.tri(p1, p2, t, M = c(1, 1, 1), re = NULL)
IarcCSedge.reg.std.tri(p1, p2, t, M = c(1, 1, 1), re = NULL)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates
which serves as a center in the interior of the standard equilateral triangle |
re |
The index of the edge region in |
p2
is in for
p1
,
that is, returns 1 if p2
is in , returns 0 otherwise
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSedge.reg.std.tri(Xp[1,],Xp[2,],t,M) IarcCSstd.tri(Xp[1,],Xp[2,],t,M) #or try re<-rel.edge.std.triCM(Xp[1,])$re IarcCSedge.reg.std.tri(Xp[1,],Xp[2,],t,M,re=re) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-1 IarcCSedge.reg.std.tri(Xp[1,],Xp[2,],t,M) IarcCSstd.tri(Xp[1,],Xp[2,],t,M) #or try re<-rel.edge.std.triCM(Xp[1,])$re IarcCSedge.reg.std.tri(Xp[1,],Xp[2,],t,M,re=re) ## End(Not run)
Returns in
for points
and
, that is, returns 1 if
is in
, returns 0
otherwise, where
is the CS proximity region for point
with expansion parameter
for the region outside the interval
.
rv
is the index of the end vertex region resides, with default=
NULL
,
and rv=1
for left end interval and rv=2
for the right end interval.
If and
are distinct and either of them are inside interval
int
, it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2016)).
IarcCSend.int(p1, p2, int, t, rv = NULL)
IarcCSend.int(p1, p2, int, t, rv = NULL)
p1 |
A 1D point for which the CS proximity region is constructed. |
p2 |
A 1D point to check whether it is inside the proximity region or not. |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
rv |
Index of the end interval containing the point, either |
in
for points
and
, that is, returns 1 if
is in
(i.e., if there is an arc from
to
), returns 0 otherwise
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
IarcCSmid.int
, IarcPEmid.int
, and IarcPEend.int
a<-0; b<-10; int<-c(a,b) t<-2 IarcCSend.int(15,17,int,t) IarcCSend.int(15,15,int,t) IarcCSend.int(1.5,17,int,t) IarcCSend.int(1.5,1.5,int,t) IarcCSend.int(-15,17,int,t) IarcCSend.int(-15,-17,int,t) a<-0; b<-10; int<-c(a,b) t<-.5 IarcCSend.int(15,17,int,t)
a<-0; b<-10; int<-c(a,b) t<-2 IarcCSend.int(15,17,int,t) IarcCSend.int(15,15,int,t) IarcCSend.int(1.5,17,int,t) IarcCSend.int(1.5,1.5,int,t) IarcCSend.int(-15,17,int,t) IarcCSend.int(-15,-17,int,t) a<-0; b<-10; int<-c(a,b) t<-.5 IarcCSend.int(15,17,int,t)
Returns in
for points
and
, that is, returns 1 if
is in
,
returns 0 otherwise, where
is the CS proximity region for point
with expansion parameter
and centrality parameter
.
CS proximity region is constructed with respect to the
interval . This function works whether
and
are inside or outside the interval
int
.
Vertex regions for middle intervals are based on the center associated with the centrality parameter
. If
and
are identical, then it returns 1 regardless of their locations
(i.e., loops are allowed in the digraph).
See also (Ceyhan (2016)).
IarcCSint(p1, p2, int, t, c = 0.5)
IarcCSint(p1, p2, int, t, c = 0.5)
p1 |
A 1D point for which the proximity region is constructed. |
p2 |
A 1D point for which it is checked whether it resides in the proximity region
of |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
in
for p2, that is, returns 1 if
in
, returns 0 otherwise
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
IarcCSmid.int
, IarcCSend.int
and IarcPEint
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) IarcCSint(7,5,int,t,c) IarcCSint(17,17,int,t,c) IarcCSint(15,17,int,t,c) IarcCSint(1,3,int,t,c) IarcCSint(-17,17,int,t,c) IarcCSint(3,5,int,t,c) IarcCSint(3,3,int,t,c) IarcCSint(4,5,int,t,c) IarcCSint(a,5,int,t,c) c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) IarcCSint(7,5,int,t,c)
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) IarcCSint(7,5,int,t,c) IarcCSint(17,17,int,t,c) IarcCSint(15,17,int,t,c) IarcCSint(1,3,int,t,c) IarcCSint(-17,17,int,t,c) IarcCSint(3,5,int,t,c) IarcCSint(3,3,int,t,c) IarcCSint(4,5,int,t,c) IarcCSint(a,5,int,t,c) c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) IarcCSint(7,5,int,t,c)
Returns in
for points
and
, that is, returns 1 if
is in
, returns 0
otherwise, where
is the CS proximity region for point
and is constructed with expansion
parameter
and centrality parameter
for the interval
.
CS proximity regions are defined with respect to the middle interval int
and vertex regions are based
on the center associated with the centrality parameter . For the interval,
int
, the
parameterized center is
.
rv
is the index of the vertex region resides, with default=
NULL
.
If and
are distinct and either of them are outside interval
int
, it returns 0,
but if they are identical, then it returns 1 regardless of their locations
(i.e., loops are allowed in the digraph).
See also (Ceyhan (2016)).
IarcCSmid.int(p1, p2, int, t, c = 0.5, rv = NULL)
IarcCSmid.int(p1, p2, int, t, c = 0.5, rv = NULL)
p1 , p2
|
1D points; |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
rv |
Index of the end interval containing the point, either |
in
for points
and
that is, returns 1 if
is in
,
returns 0 otherwise
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
IarcCSend.int
, IarcPEmid.int
, and IarcPEend.int
c<-.5 t<-2 a<-0; b<-10; int<-c(a,b) IarcCSmid.int(7,5,int,t,c) IarcCSmid.int(7,7,int,t,c) IarcCSmid.int(7,5,int,t,c=.4) IarcCSmid.int(1,3,int,t,c) IarcCSmid.int(9,11,int,t,c) IarcCSmid.int(19,1,int,t,c) IarcCSmid.int(19,19,int,t,c) IarcCSmid.int(3,5,int,t,c) #or try Rv<-rel.vert.mid.int(3,int,c)$rv IarcCSmid.int(3,5,int,t,c,rv=Rv) IarcCSmid.int(7,5,int,t,c)
c<-.5 t<-2 a<-0; b<-10; int<-c(a,b) IarcCSmid.int(7,5,int,t,c) IarcCSmid.int(7,7,int,t,c) IarcCSmid.int(7,5,int,t,c=.4) IarcCSmid.int(1,3,int,t,c) IarcCSmid.int(9,11,int,t,c) IarcCSmid.int(19,1,int,t,c) IarcCSmid.int(19,19,int,t,c) IarcCSmid.int(3,5,int,t,c) #or try Rv<-rel.vert.mid.int(3,int,c)$rv IarcCSmid.int(3,5,int,t,c,rv=Rv) IarcCSmid.int(7,5,int,t,c)
S
to the point p
for Central Similarity
Proximity Catch Digraphs (CS-PCDs) - standard equilateral triangle caseReturns p
in for some
in
S
, that is, returns 1 if
p
is in ,
returns 0 otherwise, CS proximity region is constructed with respect to the standard equilateral triangle
with the expansion parameter
and edge regions are based
on center
in Cartesian coordinates or
in barycentric coordinates in the
interior of
; default is
i.e., the center of mass of
(which is equivalent to circumcenter of
).
Edges of ,
,
,
, are also labeled as edges 3, 1, and 2, respectively.
If
p
is not in S
and either p
or all points in S
are outside , it returns 0,
but if
p
is in S
, then it always returns 1 regardless of its location (i.e., loops are allowed).
See also (Ceyhan (2012)).
IarcCSset2pnt.std.tri(S, p, t, M = c(1, 1, 1))
IarcCSset2pnt.std.tri(S, p, t, M = c(1, 1, 1))
S |
A set of 2D points. Presence of an arc from a point in |
p |
A 2D point. Presence of an arc from a point in |
t |
A positive real number which serves as the expansion parameter in CS proximity region in the
standard equilateral triangle |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates
which serves as a center in the interior of the standard equilateral triangle |
p
is in , that is, returns 1 if
p
is in S
or inside for at least
one
in
S
, returns 0 otherwise. CS proximity region is constructed with respect to the standard
equilateral triangle with
M
-edge regions.
Elvan Ceyhan
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.
IarcCSset2pnt.tri
, IarcCSstd.tri
, IarcCStri
, and IarcPEset2pnt.std.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-.5 S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(.5,.5) IarcCSset2pnt.std.tri(S,Xp[3,],t,M) IarcCSset2pnt.std.tri(S,Xp[3,],t=1,M) IarcCSset2pnt.std.tri(S,Xp[3,],t=1.5,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcCSset2pnt.std.tri(S,Xp[3,],t,M) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-.5 S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(.5,.5) IarcCSset2pnt.std.tri(S,Xp[3,],t,M) IarcCSset2pnt.std.tri(S,Xp[3,],t=1,M) IarcCSset2pnt.std.tri(S,Xp[3,],t=1.5,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcCSset2pnt.std.tri(S,Xp[3,],t,M) ## End(Not run)
S
to the point p
for
Central Similarity Proximity Catch Digraphs (CS-PCDs) - one triangle caseReturns I(p
in for some
in
S
),
that is, returns 1 if p
in ,
returns 0 otherwise.
CS proximity region is constructed with respect to the triangle tri
with
the expansion parameter and edge regions are based on the center,
in Cartesian coordinates
or
in barycentric coordinates in the interior of the triangle
tri
;
default is i.e., the center of mass of
tri
.
Edges of tri
,
,
,
, are also labeled as edges 3, 1, and 2, respectively.
If
p
is not in S
and either p
or all points in S
are outside tri
, it returns 0,
but if p
is in S
, then it always returns 1 regardless of its location (i.e., loops are allowed).
IarcCSset2pnt.tri(S, p, tri, t, M = c(1, 1, 1))
IarcCSset2pnt.tri(S, p, tri, t, M = c(1, 1, 1))
S |
A set of 2D points. Presence of an arc from a point in |
p |
A 2D point. Presence of an arc from a point in |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region
constructed in the triangle |
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 |
I(p
is in ), that is, returns 1 if
p
is in S
or inside for at least
one
in
S
, returns 0 otherwise where CS proximity region is constructed with respect to the triangle tri
Elvan Ceyhan
IarcCSset2pnt.std.tri
, IarcCStri
, IarcCSstd.tri
,
IarcASset2pnt.tri
, and IarcPEset2pnt.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(1.5,1) M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) tau<-.5 IarcCSset2pnt.tri(S,Xp[3,],Tr,tau,M) IarcCSset2pnt.tri(S,Xp[3,],Tr,t=1,M) IarcCSset2pnt.tri(S,Xp[3,],Tr,t=1.5,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcCSset2pnt.tri(S,Xp[3,],Tr,tau,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(1.5,1) M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) tau<-.5 IarcCSset2pnt.tri(S,Xp[3,],Tr,tau,M) IarcCSset2pnt.tri(S,Xp[3,],Tr,t=1,M) IarcCSset2pnt.tri(S,Xp[3,],Tr,t=1.5,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcCSset2pnt.tri(S,Xp[3,],Tr,tau,M) ## End(Not run)
Returns p2
is in for points
p1
and p2
,
that is, returns 1 if p2
is in ,
returns 0 otherwise, where
is the CS proximity region for point
with expansion parameter
.
CS proximity region is defined with respect to the standard equilateral triangle
and vertex regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
i.e., the center of mass of
.
rv
is the index of the vertex region p1
resides, with default=NULL
.
If p1
and p2
are distinct and either of them are outside , it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
IarcCSstd.tri(p1, p2, t, M = c(1, 1, 1), re = NULL)
IarcCSstd.tri(p1, p2, t, M = c(1, 1, 1), re = NULL)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates
which serves as a center in the interior of the standard equilateral triangle |
re |
The index of the edge region in |
p2
is in for points
p1
and p2
, that is, returns 1 if p2
is in ,
returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
IarcCStri
, IarcCSbasic.tri
, and IarcPEstd.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) or M=(A+B+C)/3 IarcCSstd.tri(Xp[1,],Xp[3,],t=2,M) IarcCSstd.tri(c(0,1),Xp[3,],t=2,M) #or try Re<-rel.edge.tri(Xp[1,],Te,M) $re IarcCSstd.tri(Xp[1,],Xp[3,],t=2,M,Re) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) or M=(A+B+C)/3 IarcCSstd.tri(Xp[1,],Xp[3,],t=2,M) IarcCSstd.tri(c(0,1),Xp[3,],t=2,M) #or try Re<-rel.edge.tri(Xp[1,],Te,M) $re IarcCSstd.tri(Xp[1,],Xp[3,],t=2,M,Re) ## End(Not run)
Returns p2
is in for points
p1
and p2
, that is, returns 1 if p2
is in ,
returns 0 otherwise, where
is the CS proximity region for point
with expansion parameter
.
CS proximity region is defined with respect to the standard equilateral triangle
and edge regions are based on the center of mass
.
If p1
and p2
are distinct and either are outside , it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
IarcCSt1.std.tri(p1, p2)
IarcCSt1.std.tri(p1, p2)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
p2
is in for
p1
in that is, returns 1 if
p2
is in , returns 0 otherwise
Elvan Ceyhan
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points IarcCSt1.std.tri(Xp[1,],Xp[2,]) IarcCSt1.std.tri(c(.2,.5),Xp[2,]) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points IarcCSt1.std.tri(Xp[1,],Xp[2,]) IarcCSt1.std.tri(c(.2,.5),Xp[2,]) ## End(Not run)
Returns p2
is in for points
p1
and p2
, that is,
returns 1 if p2
is in ,
returns 0 otherwise, where
is the CS proximity region for point
with the expansion parameter
.
CS proximity region is constructed with respect to the triangle tri
and
edge regions are based on the center, in Cartesian coordinates or
in barycentric coordinates in the interior of
tri
or based on the circumcenter of tri
.
re
is the index of the edge region p
resides, with default=NULL
If p1
and p2
are distinct and either of them are outside tri
, it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
IarcCStri(p1, p2, tri, t, M, re = NULL)
IarcCStri(p1, p2, tri, t, M, re = NULL)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
re |
Index of the |
I(p2
is in ) for
p1
, that is, returns 1 if p2
is in , returns 0 otherwise
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
IarcAStri
, IarcPEtri
, IarcCStri
, and IarcCSstd.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); tau<-1.5 M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g IarcCStri(Xp[1,],Xp[2,],Tr,tau,M) P1<-as.numeric(runif.tri(1,Tr)$g) P2<-as.numeric(runif.tri(1,Tr)$g) IarcCStri(P1,P2,Tr,tau,M) #or try re<-rel.edges.tri(P1,Tr,M)$re IarcCStri(P1,P2,Tr,tau,M,re) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); tau<-1.5 M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g IarcCStri(Xp[1,],Xp[2,],Tr,tau,M) P1<-as.numeric(runif.tri(1,Tr)$g) P2<-as.numeric(runif.tri(1,Tr)$g) IarcCStri(P1,P2,Tr,tau,M) #or try re<-rel.edges.tri(P1,Tr,M)$re IarcCStri(P1,P2,Tr,tau,M,re) ## End(Not run)
IarcCStri
which yields the indicator
for the presence of an arc from one point to another
for Central Similarity Proximity Catch Digraphs (CS-PCDs)Returns p2
is in for points
p1
and p2
, that is, returns 1 if p2
is in ,
returns 0 otherwise, where
is the CS proximity region for point
with the expansion parameter
.
CS proximity region is constructed with respect to the triangle tri
and edge regions are based on the
center of mass, .
re
is the index of the -edge region
p
resides, with default=NULL
but must be provided as
vertices for
as rbind(y2,y3,y1) for
and as rbind(y1,y3,y2) for
for triangle
.
If p1
and p2
are distinct and either of them are outside tri
, it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
IarcCStri.alt(p1, p2, tri, t, re = NULL)
IarcCStri.alt(p1, p2, tri, t, re = NULL)
p1 |
A 2D point whose CS proximity region is constructed. |
p2 |
A 2D point. The function determines whether |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
re |
Index of the |
p2
is in for
p1
, that is,
returns 1 if p2
is in , returns 0 otherwise.
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
IarcAStri
, IarcPEtri
, IarcCStri
, and IarcCSstd.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.6,2); Tr<-rbind(A,B,C); t<-1.5 P1<-c(.4,.2) P2<-c(1.8,.5) IarcCStri(P1,P2,Tr,t,M=c(1,1,1)) IarcCStri.alt(P1,P2,Tr,t) IarcCStri(P2,P1,Tr,t,M=c(1,1,1)) IarcCStri.alt(P2,P1,Tr,t) #or try re<-rel.edges.triCM(P1,Tr)$re IarcCStri(P1,P2,Tr,t,M=c(1,1,1),re) IarcCStri.alt(P1,P2,Tr,t,re) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.6,2); Tr<-rbind(A,B,C); t<-1.5 P1<-c(.4,.2) P2<-c(1.8,.5) IarcCStri(P1,P2,Tr,t,M=c(1,1,1)) IarcCStri.alt(P1,P2,Tr,t) IarcCStri(P2,P1,Tr,t,M=c(1,1,1)) IarcCStri.alt(P2,P1,Tr,t) #or try re<-rel.edges.triCM(P1,Tr)$re IarcCStri(P1,P2,Tr,t,M=c(1,1,1),re) IarcCStri.alt(P1,P2,Tr,t,re) ## End(Not run)
Returns p2
is in
for points
p1
and p2
in the standard basic triangle,
that is, returns 1 if p2
is in ,
and returns 0 otherwise,
where
is the PE proximity region
for point
with expansion parameter
.
PE proximity region is defined
with respect to the standard basic triangle
where
is in
,
and
.
Vertex regions are based on the center,
in Cartesian coordinates
or
in
barycentric coordinates
in the interior of the standard basic triangle
or based on circumcenter of
;
default is
, i.e.,
the center of mass of
.
rv
is the index of the vertex region p1
resides,
with default=NULL
.
If p1
and p2
are distinct and either of them are
outside , it returns 0,
but if they are identical,
then it returns 1 regardless of their locations
(i.e., it allows loops).
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2006)).
IarcPEbasic.tri(p1, p2, r, c1, c2, M = c(1, 1, 1), rv = NULL)
IarcPEbasic.tri(p1, p2, r, c1, c2, M = c(1, 1, 1), rv = NULL)
p1 |
A 2D point whose PE proximity region is constructed. |
p2 |
A 2D point.
The function determines whether |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle
adjacent to the shorter edges;
|
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard basic triangle
or circumcenter of |
rv |
The index of the vertex region in |
p2
is in
for points
p1
and p2
in the standard basic triangle,
that is, returns 1 if p2
is in ,
and returns 0 otherwise.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) r<-2 P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) P2<-as.numeric(runif.basic.tri(1,c1,c2)$g) IarcPEbasic.tri(P1,P2,r,c1,c2,M) P1<-c(.4,.2) P2<-c(.5,.26) IarcPEbasic.tri(P1,P2,r,c1,c2,M) IarcPEbasic.tri(P2,P1,r,c1,c2,M) #or try Rv<-rel.vert.basic.tri(P1,c1,c2,M)$rv IarcPEbasic.tri(P1,P2,r,c1,c2,M,Rv) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) r<-2 P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) P2<-as.numeric(runif.basic.tri(1,c1,c2)$g) IarcPEbasic.tri(P1,P2,r,c1,c2,M) P1<-c(.4,.2) P2<-c(.5,.26) IarcPEbasic.tri(P1,P2,r,c1,c2,M) IarcPEbasic.tri(P2,P1,r,c1,c2,M) #or try Rv<-rel.vert.basic.tri(P1,c1,c2,M)$rv IarcPEbasic.tri(P1,P2,r,c1,c2,M,Rv) ## End(Not run)
Returns for points
and
, that is, returns 1 if
is in
, returns 0
otherwise, where
is the PE proximity region for point
with expansion parameter
for the region outside the interval
.
rv
is the index of the end vertex region resides, with default=
NULL
,
and rv=1
for left end interval and rv=2
for the right end interval.
If and
are distinct and either of them are inside interval
int
, it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2012)).
IarcPEend.int(p1, p2, int, r, rv = NULL)
IarcPEend.int(p1, p2, int, r, rv = NULL)
p1 |
A 1D point whose PE proximity region is constructed. |
p2 |
A 1D point. The function determines whether |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
rv |
Index of the end interval containing the point, either |
for points
and
, that is, returns 1 if
is in
(i.e., if there is an arc from
to
), returns 0 otherwise
Elvan Ceyhan
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.
IarcPEmid.int
, IarcCSmid.int
, and IarcCSend.int
a<-0; b<-10; int<-c(a,b) r<-2 IarcPEend.int(15,17,int,r) IarcPEend.int(1.5,17,int,r) IarcPEend.int(-15,17,int,r)
a<-0; b<-10; int<-c(a,b) r<-2 IarcPEend.int(15,17,int,r) IarcPEend.int(1.5,17,int,r) IarcPEend.int(-15,17,int,r)
Returns for points
and
, that is, returns 1 if
is in
,
returns 0 otherwise, where
is the PE proximity region for point
with expansion parameter
and centrality parameter
.
PE proximity region is constructed with respect to the
interval . This function works whether
and
are inside or outside the interval
int
.
Vertex regions for middle intervals are based on the center associated with the centrality parameter .
If
and
are identical, then it returns 1 regardless of their locations
(i.e., loops are allowed in the digraph).
See also (Ceyhan (2012)).
IarcPEint(p1, p2, int, r, c = 0.5)
IarcPEint(p1, p2, int, r, c = 0.5)
p1 |
A 1D point for which the proximity region is constructed. |
p2 |
A 1D point for which it is checked whether it resides in the proximity region
of |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region
must be |
c |
A positive real number in |
, that is, returns 1 if
in
, returns 0 otherwise
Elvan Ceyhan
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.
IarcPEmid.int
, IarcPEend.int
and IarcCSint
c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) IarcPEint(7,5,int,r,c) IarcPEint(15,17,int,r,c) IarcPEint(1,3,int,r,c)
c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) IarcPEint(7,5,int,r,c) IarcPEint(15,17,int,r,c) IarcPEint(1,3,int,r,c)
Returns for points
and
, that is, returns 1 if
is in
, returns 0
otherwise, where
is the PE proximity region for point
and is constructed with expansion
parameter
and centrality parameter
for the interval
.
PE proximity regions are defined with respect to the middle interval int
and vertex regions are based
on the center associated with the centrality parameter . For the interval,
int
, the
parameterized center is
.
rv
is the index of the vertex region resides, with default=
NULL
.
If and
are distinct and either of them are outside interval
int
, it returns 0,
but if they are identical, then it returns 1 regardless of their locations
(i.e., loops are allowed in the digraph).
See also (Ceyhan (2012, 2016)).
IarcPEmid.int(p1, x2, int, r, c = 0.5, rv = NULL)
IarcPEmid.int(p1, x2, int, r, c = 0.5, rv = NULL)
p1 , x2
|
1D points; |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
rv |
The index of the vertex region |
for points
and
that is, returns 1 if
is in
,
returns 0 otherwise
Elvan Ceyhan
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.
IarcPEend.int
, IarcCSmid.int
, and IarcCSend.int
c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) IarcPEmid.int(7,5,int,r,c) IarcPEmid.int(1,3,int,r,c)
c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) IarcPEmid.int(7,5,int,r,c) IarcPEmid.int(1,3,int,r,c)
S
to the point p
or
Proportional Edge Proximity Catch Digraphs (PE-PCDs) -
standard equilateral triangle caseReturns p
in
for some
in
S
for
S
, in the standard equilateral triangle,
that is, returns 1 if p
is in ,
and returns 0 otherwise.
PE proximity region is constructed
with respect to the standard equilateral triangle
with the expansion parameter
and vertex regions are based
on center
in Cartesian coordinates
or
in barycentric coordinates in the interior of
;
default is
,
i.e., the center of mass of
(which is equivalent to the circumcenter for
).
Vertices of are also labeled as 1, 2, and 3,
respectively.
If
p
is not in S
and either p
or all points in S
are outside , it returns 0,
but if
p
is in S
,
then it always returns 1 regardless of its location
(i.e., loops are allowed).
IarcPEset2pnt.std.tri(S, p, r, M = c(1, 1, 1))
IarcPEset2pnt.std.tri(S, p, r, M = c(1, 1, 1))
S |
A set of 2D points.
Presence of an arc from a point in |
p |
A 2D point.
Presence of an arc from a point in |
r |
A positive real number
which serves as the expansion parameter in PE proximity region in the
standard equilateral triangle |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard equilateral triangle |
p
is in U_x in S
for
S
in the standard equilateral triangle,
that is, returns 1 if p
is in S
or inside for at least
one
in
S
, and returns 0 otherwise.
PE proximity region is constructed with respect to the standard
equilateral triangle
with
M
-vertex regions
Elvan Ceyhan
IarcPEset2pnt.tri
, IarcPEstd.tri
,
IarcPEtri
, and IarcCSset2pnt.std.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(.5,.5) IarcPEset2pnt.std.tri(S,Xp[3,],r,M) IarcPEset2pnt.std.tri(S,Xp[3,],r=1,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) IarcPEset2pnt.std.tri(S,Xp[3,],r,M) IarcPEset2pnt.std.tri(S,Xp[6,],r,M) IarcPEset2pnt.std.tri(S,Xp[6,],r=1.25,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] IarcPEset2pnt.std.tri(Xp,P,r,M) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(.5,.5) IarcPEset2pnt.std.tri(S,Xp[3,],r,M) IarcPEset2pnt.std.tri(S,Xp[3,],r=1,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) IarcPEset2pnt.std.tri(S,Xp[3,],r,M) IarcPEset2pnt.std.tri(S,Xp[6,],r,M) IarcPEset2pnt.std.tri(S,Xp[6,],r=1.25,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] IarcPEset2pnt.std.tri(Xp,P,r,M) ## End(Not run)
S
to the point p
for Proportional Edge Proximity Catch Digraphs
(PE-PCDs) - one triangle caseReturns p
in
for some
in
S
,
that is, returns 1 if
p
is in ,
and returns 0 otherwise.
PE proximity region is constructed
with respect to the triangle tri
with
the expansion parameter
and vertex regions are based on the 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
.
Vertices of tri
are also labeled as 1, 2, and 3,
respectively.
If p
is not in S
and either p
or all points in S
are outside tri
, it returns 0,
but if p
is in S
,
then it always returns 1 regardless of its location
(i.e., loops are allowed).
IarcPEset2pnt.tri(S, p, tri, r, M = c(1, 1, 1))
IarcPEset2pnt.tri(S, p, tri, r, M = c(1, 1, 1))
S |
A set of 2D points.
Presence of an arc from a point in |
p |
A 2D point.
Presence of an arc from a point in |
tri |
A |
r |
A positive real number
which serves as the expansion parameter in PE proximity region
constructed in the triangle |
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 |
I(p
is in U_x in S
N_PE(x,r)),
that is, returns 1 if p
is in S
or inside for at least
one
in
S
, and returns 0 otherwise,
where PE proximity region is constructed
with respect to the triangle tri
Elvan Ceyhan
IarcPEset2pnt.std.tri
, IarcPEtri
,
IarcPEstd.tri
, IarcASset2pnt.tri
,
and IarcCSset2pnt.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(1.5,1) IarcPEset2pnt.tri(S,Xp[3,],Tr,r,M) IarcPEset2pnt.tri(S,Xp[3,],r=1,Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) IarcPEset2pnt.tri(S,Xp[3,],Tr,r,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcPEset2pnt.tri(S,Xp[3,],Tr,r,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] IarcPEset2pnt.tri(Xp,P,Tr,r,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) #try also S<-c(1.5,1) IarcPEset2pnt.tri(S,Xp[3,],Tr,r,M) IarcPEset2pnt.tri(S,Xp[3,],r=1,Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) IarcPEset2pnt.tri(S,Xp[3,],Tr,r,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) IarcPEset2pnt.tri(S,Xp[3,],Tr,r,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] IarcPEset2pnt.tri(Xp,P,Tr,r,M) ## End(Not run)
Returns p2
is in for points
p1
and p2
, that is, returns 1 if p2
is in ,
returns 0 otherwise, where
is the PE proximity region for point
with expansion parameter
.
PE proximity region is defined with respect to the standard regular tetrahedron
and vertex regions
are based on the circumcenter (which is equivalent to the center of mass for standard regular tetrahedron)
of
.
rv
is the index of the vertex region p1
resides, with default=NULL
.
If p1
and p2
are distinct and either of them are outside , it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2005, 2010)).
IarcPEstd.tetra(p1, p2, r, rv = NULL)
IarcPEstd.tetra(p1, p2, r, rv = NULL)
p1 |
A 3D point whose PE proximity region is constructed. |
p2 |
A 3D point. The function determines whether |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
rv |
Index of the vertex region containing the point, either |
p2
is in for points
p1
and p2
, that is, returns 1 if p2
is in ,
returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
IarcPEtetra
, IarcPEtri
and IarcPEint
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-3 #try also n<-20 Xp<-runif.std.tetra(n)$g r<-1.5 IarcPEstd.tetra(Xp[1,],Xp[3,],r) IarcPEstd.tetra(c(.4,.4,.4),c(.5,.5,.5),r) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv IarcPEstd.tetra(Xp[1,],Xp[3,],r,rv=RV) P1<-c(.1,.1,.1) P2<-c(.5,.5,.5) IarcPEstd.tetra(P1,P2,r) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-3 #try also n<-20 Xp<-runif.std.tetra(n)$g r<-1.5 IarcPEstd.tetra(Xp[1,],Xp[3,],r) IarcPEstd.tetra(c(.4,.4,.4),c(.5,.5,.5),r) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv IarcPEstd.tetra(Xp[1,],Xp[3,],r,rv=RV) P1<-c(.1,.1,.1) P2<-c(.5,.5,.5) IarcPEstd.tetra(P1,P2,r) ## End(Not run)
Returns p2
is in
for points
p1
and p2
in the standard equilateral triangle,
that is, returns 1 if p2
is in ,
and returns 0 otherwise,
where
is the PE proximity region
for point
with expansion parameter
.
PE proximity region is defined
with respect to the standard equilateral triangle
and vertex regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
, i.e., the center of mass of
.
rv
is the index of the vertex region p1
resides,
with default=NULL
.
If p1
and p2
are distinct
and either of them are outside , it returns 0,
but if they are identical,
then it returns 1 regardless of their locations
(i.e., it allows loops).
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
IarcPEstd.tri(p1, p2, r, M = c(1, 1, 1), rv = NULL)
IarcPEstd.tri(p1, p2, r, M = c(1, 1, 1), rv = NULL)
p1 |
A 2D point whose PE proximity region is constructed. |
p2 |
A 2D point. The function determines
whether |
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 standard equilateral triangle |
rv |
The index of the vertex region in |
p2
is in
for points
p1
and p2
in the standard equilateral triangle,
that is, returns 1 if p2
is in ,
and returns 0 otherwise.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
IarcPEtri
, IarcPEbasic.tri
,
and IarcCSstd.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) IarcPEstd.tri(Xp[1,],Xp[3,],r=1.5,M) IarcPEstd.tri(Xp[1,],Xp[3,],r=2,M) #or try Rv<-rel.vert.std.triCM(Xp[1,])$rv IarcPEstd.tri(Xp[1,],Xp[3,],r=2,rv=Rv) P1<-c(.4,.2) P2<-c(.5,.26) r<-2 IarcPEstd.tri(P1,P2,r,M) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-3 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) IarcPEstd.tri(Xp[1,],Xp[3,],r=1.5,M) IarcPEstd.tri(Xp[1,],Xp[3,],r=2,M) #or try Rv<-rel.vert.std.triCM(Xp[1,])$rv IarcPEstd.tri(Xp[1,],Xp[3,],r=2,rv=Rv) P1<-c(.4,.2) P2<-c(.5,.26) r<-2 IarcPEstd.tri(P1,P2,r,M) ## End(Not run)
Returns p2
is in for 3D points
p1
and p2
, that is, returns 1 if p2
is in ,
returns 0 otherwise, where N_PE(x,r) is the PE proximity region for point
with the expansion parameter
.
PE proximity region is constructed with respect to the tetrahedron th
and
vertex regions are based on the center M
which is circumcenter ("CC"
) or
center of mass ("CM"
) of th
with default="CM"
.
rv
is the index of the vertex region p1
resides, with default=NULL
.
If p1
and p2
are distinct and either of them are outside th
, it returns 0,
but if they are identical, then it returns 1 regardless of their locations (i.e., it allows loops).
See also (Ceyhan (2005, 2010)).
IarcPEtetra(p1, p2, th, r, M = "CM", rv = NULL)
IarcPEtetra(p1, p2, th, r, M = "CM", rv = NULL)
p1 |
A 3D point whose PE proximity region is constructed. |
p2 |
A 3D point. The function determines whether |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
rv |
Index of the |
p2
is in for
p1
, that is, returns 1 if p2
is in , returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
IarcPEstd.tetra
, IarcPEtri
and IarcPEint
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-3 #try also n<-20 Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.5 IarcPEtetra(Xp[1,],Xp[2,],tetra,r) #uses the default M="CM" IarcPEtetra(Xp[1,],Xp[2,],tetra,r,M) IarcPEtetra(c(.4,.4,.4),c(.5,.5,.5),tetra,r,M) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv IarcPEtetra(Xp[1,],Xp[3,],tetra,r,M,rv=RV) P1<-c(.1,.1,.1) P2<-c(.5,.5,.5) IarcPEtetra(P1,P2,tetra,r,M) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-3 #try also n<-20 Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.5 IarcPEtetra(Xp[1,],Xp[2,],tetra,r) #uses the default M="CM" IarcPEtetra(Xp[1,],Xp[2,],tetra,r,M) IarcPEtetra(c(.4,.4,.4),c(.5,.5,.5),tetra,r,M) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv IarcPEtetra(Xp[1,],Xp[3,],tetra,r,M,rv=RV) P1<-c(.1,.1,.1) P2<-c(.5,.5,.5) IarcPEtetra(P1,P2,tetra,r,M) ## End(Not run)
Returns p2
is in
for points
p1
and p2
,
that is, returns 1 if p2
is in ,
and returns 0 otherwise,
where
is the PE proximity region for point
with the expansion parameter
.
PE proximity region is constructed
with respect to the triangle tri
and
vertex regions are based on the center,
in Cartesian coordinates or
in barycentric coordinates
in the interior of
tri
or based on the circumcenter of tri
;
default is , i.e.,
the center of mass of
tri
.
rv
is the index of the vertex region p1
resides,
with default=NULL
.
If p1
and p2
are distinct
and either of them are outside tri
, it returns 0,
but if they are identical,
then it returns 1 regardless of their locations
(i.e., it allows loops).
See also (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)).
IarcPEtri(p1, p2, tri, r, M = c(1, 1, 1), rv = NULL)
IarcPEtri(p1, p2, tri, r, M = c(1, 1, 1), rv = NULL)
p1 |
A 2D point whose PE proximity region is constructed. |
p2 |
A 2D point.
The function determines whether |
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 |
p2
is in
for points
p1
and p2
,
that is, returns 1 if p2
is in ,
and returns 0 otherwise.
Elvan Ceyhan
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
IarcPEbasic.tri
, IarcPEstd.tri
,
IarcAStri
, and IarcCStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0); r<-1.5 n<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g IarcPEtri(Xp[1,],Xp[2,],Tr,r,M) P1<-as.numeric(runif.tri(1,Tr)$g) P2<-as.numeric(runif.tri(1,Tr)$g) IarcPEtri(P1,P2,Tr,r,M) P1<-c(.4,.2) P2<-c(1.8,.5) IarcPEtri(P1,P2,Tr,r,M) IarcPEtri(P2,P1,Tr,r,M) M<-c(1.3,1.3) r<-2 #or try Rv<-rel.vert.tri(P1,Tr,M)$rv IarcPEtri(P1,P2,Tr,r,M,Rv) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0); r<-1.5 n<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g IarcPEtri(Xp[1,],Xp[2,],Tr,r,M) P1<-as.numeric(runif.tri(1,Tr)$g) P2<-as.numeric(runif.tri(1,Tr)$g) IarcPEtri(P1,P2,Tr,r,M) P1<-c(.4,.2) P2<-c(1.8,.5) IarcPEtri(P1,P2,Tr,r,M) IarcPEtri(P2,P1,Tr,r,M) M<-c(1.3,1.3) r<-2 #or try Rv<-rel.vert.tri(P1,Tr,M)$rv IarcPEtri(P1,P2,Tr,r,M,Rv) ## End(Not run)
Returns 1 if the domination number is
less than or equal to the prespecified value k
and also the indices
(i.e., row numbers) of a dominating set of size k
based on the incidence matrix Inc.Mat
of a graph or
a digraph. Here the row number
in the incidence matrix corresponds to the index of the vertex
(i.e., index of the data point).
The function works whether loops are allowed or not
(i.e., whether the first diagonal is all 1 or all 0).
It takes a rather long time for large number of vertices
(i.e., large number of row numbers).
Idom.num.up.bnd(Inc.Mat, k)
Idom.num.up.bnd(Inc.Mat, k)
Inc.Mat |
A square matrix consisting of 0's and 1's which represents the incidence matrix of a graph or digraph. |
k |
A positive integer for the upper bound (to be checked) for the domination number. |
A list
with two elements
dom.up.bnd |
The upper bound (to be checked) for the domination number.
It is prespecified as |
Idom.num.up.bnd |
The indicator for the upper bound for
domination number of the graph or digraph being
the specified value |
ind.dom.set |
Indices of the rows
in the incidence matrix |
Elvan Ceyhan
dom.num.exact
and dom.num.greedy
## Not run: n<-10 M<-matrix(sample(c(0,1),n^2,replace=TRUE),nrow=n) diag(M)<-1 dom.num.greedy(M) Idom.num.up.bnd(M,2) for (k in 1:n) print(c(k,Idom.num.up.bnd(M,k))) ## End(Not run)
## Not run: n<-10 M<-matrix(sample(c(0,1),n^2,replace=TRUE),nrow=n) diag(M)<-1 dom.num.greedy(M) Idom.num.up.bnd(M,2) for (k in 1:n) print(c(k,Idom.num.up.bnd(M,k))) ## End(Not run)
Returns I(p
is a dominating point of the AS-PCD) where the vertices of the AS-PCD are the 2D data set Xp
, that is, returns 1 if p
is a dominating
point of AS-PCD, returns 0 otherwise. AS proximity regions are defined with respect to the standard basic triangle,
,
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence standard basic triangle is useful for simulation studies under the uniformity hypothesis.
Vertex regions are based on the center M="CC"
for circumcenter
of ; or
in Cartesian coordinates or
in barycentric coordinates in the
interior of
; default is
M="CC"
.
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.
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, 2010)).
Idom.num1ASbasic.tri(p, Xp, c1, c2, M = "CC", rv = NULL, ch.data.pnt = FALSE)
Idom.num1ASbasic.tri(p, Xp, c1, c2, M = "CC", rv = NULL, ch.data.pnt = FALSE)
p |
A 2D point that is to be tested for being a dominating point or not of the AS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the AS-PCD. |
c1 , c2
|
Positive real numbers which constitute the vertex of the standard basic triangle
adjacent to the shorter edges; |
M |
The center of the triangle. |
rv |
Index of the vertex whose region contains point |
ch.data.pnt |
A logical argument for checking whether point |
I(p
is a dominating point of the AS-PCD) where the vertices of the AS-PCD are the 2D data set Xp
,
that is, returns 1 if p
is a dominating point, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Idom.num1AStri
and Idom.num1PEbasic.tri
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Idom.num1ASbasic.tri(Xp[1,],Xp,c1,c2,M) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1ASbasic.tri(Xp[i,],Xp,c1,c2,M))} ind.gam1<-which(gam.vec==1) ind.gam1 #or try Rv<-rel.vert.basic.triCC(Xp[1,],c1,c2)$rv Idom.num1ASbasic.tri(Xp[1,],Xp,c1,c2,M,Rv) Idom.num1ASbasic.tri(c(.2,.4),Xp,c1,c2,M) Idom.num1ASbasic.tri(c(.2,.4),c(.2,.4),c1,c2,M) Xp2<-rbind(Xp,c(.2,.4)) Idom.num1ASbasic.tri(Xp[1,],Xp2,c1,c2,M) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges.basic.tri(c1,c2,M) } Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(rbind(Xp[ind.gam1,]),pch=4,col=2) txt<-rbind(Tb,cent,Ds) xc<-txt[,1]+c(-.03,.03,.02,.06,.06,-0.05,.01) yc<-txt[,2]+c(.02,.02,.03,.0,.03,.03,-.03) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) Idom.num1ASbasic.tri(c(.4,.2),Xp,c1,c2,M) Idom.num1ASbasic.tri(c(.5,.11),Xp,c1,c2,M) Idom.num1ASbasic.tri(c(.5,.11),Xp,c1,c2,M,ch.data.pnt=FALSE) #gives an error message if ch.data.pnt=TRUE since the point is not in the standard basic triangle ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Idom.num1ASbasic.tri(Xp[1,],Xp,c1,c2,M) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1ASbasic.tri(Xp[i,],Xp,c1,c2,M))} ind.gam1<-which(gam.vec==1) ind.gam1 #or try Rv<-rel.vert.basic.triCC(Xp[1,],c1,c2)$rv Idom.num1ASbasic.tri(Xp[1,],Xp,c1,c2,M,Rv) Idom.num1ASbasic.tri(c(.2,.4),Xp,c1,c2,M) Idom.num1ASbasic.tri(c(.2,.4),c(.2,.4),c1,c2,M) Xp2<-rbind(Xp,c(.2,.4)) Idom.num1ASbasic.tri(Xp[1,],Xp2,c1,c2,M) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges.basic.tri(c1,c2,M) } Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(rbind(Xp[ind.gam1,]),pch=4,col=2) txt<-rbind(Tb,cent,Ds) xc<-txt[,1]+c(-.03,.03,.02,.06,.06,-0.05,.01) yc<-txt[,2]+c(.02,.02,.03,.0,.03,.03,-.03) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) Idom.num1ASbasic.tri(c(.4,.2),Xp,c1,c2,M) Idom.num1ASbasic.tri(c(.5,.11),Xp,c1,c2,M) Idom.num1ASbasic.tri(c(.5,.11),Xp,c1,c2,M,ch.data.pnt=FALSE) #gives an error message if ch.data.pnt=TRUE since the point is not in the standard basic triangle ## End(Not run)
Returns I(p
is a dominating point of the AS-PCD whose vertices are the 2D data set Xp
),
that is, returns 1 if p
is a dominating point of AS-PCD, returns 0 otherwise.
Point, p
, is in the region of vertex rv
(default is NULL
); vertices are labeled as
in the order they are stacked row-wise in
tri
.
AS proximity regions are defined with respect to the
triangle tri
and vertex regions are based on the center M="CC"
for circumcenter of tri
; or in Cartesian coordinates
or
in barycentric coordinates in the interior of the triangle
tri
;
default is M="CC"
the circumcenter 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, 2010)).
Idom.num1AStri(p, Xp, tri, M = "CC", rv = NULL, ch.data.pnt = FALSE)
Idom.num1AStri(p, Xp, tri, M = "CC", rv = NULL, ch.data.pnt = FALSE)
p |
A 2D point that is to be tested for being a dominating point or not of the AS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the AS-PCD. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
rv |
Index of the vertex whose region contains point |
ch.data.pnt |
A logical argument for checking whether point |
I(p
is a dominating point of the AS-PCD whose vertices are the 2D data set Xp
),
that is, returns 1 if p
is a dominating point of the AS-PCD, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) Idom.num1AStri(Xp[1,],Xp,Tr,M) Idom.num1AStri(Xp[1,],Xp[1,],Tr,M) Idom.num1AStri(c(1.5,1.5),c(1.6,1),Tr,M) Idom.num1AStri(c(1.6,1),c(1.5,1.5),Tr,M) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1AStri(Xp[i,],Xp,Tr,M))} ind.gam1<-which(gam.vec==1) ind.gam1 #or try Rv<-rel.vert.triCC(Xp[1,],Tr)$rv Idom.num1AStri(Xp[1,],Xp,Tr,M,Rv) Idom.num1AStri(c(.2,.4),Xp,Tr,M) Idom.num1AStri(c(.2,.4),c(.2,.4),Tr,M) Xp2<-rbind(Xp,c(.2,.4)) Idom.num1AStri(Xp[1,],Xp2,Tr,M) if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates CC<-circumcenter.tri(Tr) #the circumcenter if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(rbind(Xp[ind.gam1,]),pch=4,col=2) txt<-rbind(Tr,cent,Ds) xc<-txt[,1] yc<-txt[,2] txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) Idom.num1AStri(c(1.5,1.1),Xp,Tr,M) Idom.num1AStri(c(1.5,1.1),Xp,Tr,M) Idom.num1AStri(c(1.5,1.1),Xp,Tr,M,ch.data.pnt=FALSE) #gives an error message if ch.data.pnt=TRUE since point p is not a data point in Xp ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) Idom.num1AStri(Xp[1,],Xp,Tr,M) Idom.num1AStri(Xp[1,],Xp[1,],Tr,M) Idom.num1AStri(c(1.5,1.5),c(1.6,1),Tr,M) Idom.num1AStri(c(1.6,1),c(1.5,1.5),Tr,M) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1AStri(Xp[i,],Xp,Tr,M))} ind.gam1<-which(gam.vec==1) ind.gam1 #or try Rv<-rel.vert.triCC(Xp[1,],Tr)$rv Idom.num1AStri(Xp[1,],Xp,Tr,M,Rv) Idom.num1AStri(c(.2,.4),Xp,Tr,M) Idom.num1AStri(c(.2,.4),c(.2,.4),Tr,M) Xp2<-rbind(Xp,c(.2,.4)) Idom.num1AStri(Xp[1,],Xp2,Tr,M) if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates CC<-circumcenter.tri(Tr) #the circumcenter if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(rbind(Xp[ind.gam1,]),pch=4,col=2) txt<-rbind(Tr,cent,Ds) xc<-txt[,1] yc<-txt[,2] txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) Idom.num1AStri(c(1.5,1.1),Xp,Tr,M) Idom.num1AStri(c(1.5,1.1),Xp,Tr,M) Idom.num1AStri(c(1.5,1.1),Xp,Tr,M,ch.data.pnt=FALSE) #gives an error message if ch.data.pnt=TRUE since point p is not a data point in Xp ## End(Not run)
Returns p
is a dominating point of the 2D data set Xp
of CS-PCD in the standard equilateral
triangle
, that is, returns 1 if
p
is a dominating point of CS-PCD,
returns 0 otherwise.
Point, p
, must lie in the first one-sixth of , which is the triangle with vertices
.
CS proximity region is constructed with respect to with expansion parameter
.
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)).
Idom.num1CS.Te.onesixth(p, Xp, ch.data.pnt = FALSE)
Idom.num1CS.Te.onesixth(p, Xp, ch.data.pnt = FALSE)
p |
A 2D point that is to be tested for being a dominating point or not of the CS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the CS-PCD. |
ch.data.pnt |
A logical argument for checking whether point |
p
is a dominating point of the CS-PCD where the vertices of the CS-PCD are the 2D data set
Xp
,
that is, returns 1 if p
is a dominating point, returns 0 otherwise
Elvan Ceyhan
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.
Idom.num1CSstd.tri
and Idom.num1CSt1std.tri
Returns p
is a dominating point of CS-PCD where the vertices of the CS-PCD are the 1D data set
Xp
).
CS proximity region is defined with respect to the interval int
with an expansion parameter, ,
and a centrality parameter,
, so arcs may exist for
Xp
points inside the interval int
.
Vertex regions are based on the center associated with the centrality parameter .
rv
is the index of the vertex region p
resides, with default=NULL
.
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.
Idom.num1CSint(p, Xp, int, t, c = 0.5, rv = NULL, ch.data.pnt = FALSE)
Idom.num1CSint(p, Xp, int, t, c = 0.5, rv = NULL, ch.data.pnt = FALSE)
p |
A 1D point that is to be tested for being a dominating point or not of the CS-PCD. |
Xp |
A set of 1D points which constitutes the vertices of the CS-PCD. |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
rv |
Index of the vertex region in which the point resides, either |
ch.data.pnt |
A logical argument for checking whether point |
p
is a dominating point of CS-PCD where the vertices of the CS-PCD are the 1D data set
Xp
),
that is, returns 1 if p
is a dominating point, returns 0 otherwise
Elvan Ceyhan
t<-2 c<-.4 a<-0; b<-10; int<-c(a,b) Mc<-centerMc(int,c) n<-10 set.seed(1) Xp<-runif(n,a,b) Idom.num1CSint(Xp[5],Xp,int,t,c) Idom.num1CSint(2,Xp,int,t,c,ch.data.pnt = FALSE) #gives an error if ch.data.pnt = TRUE since p is not a data point in Xp gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1CSint(Xp[i],Xp,int,t,c))} ind.gam1<-which(gam.vec==1) ind.gam1 domset<-Xp[ind.gam1] if (length(ind.gam1)==0) {domset<-NA} #or try Rv<-rel.vert.mid.int(Xp[5],int,c)$rv Idom.num1CSint(Xp[5],Xp,int,t,c,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,Mc),col=c(1,1,2),lty=2) points(cbind(Xp,0)) points(cbind(domset,0),pch=4,col=2) text(cbind(c(a,b,Mc),-0.1),c("a","b","Mc")) Idom.num1CSint(Xp[5],Xp,int,t,c) n<-10 Xp2<-runif(n,a+b,b+10) Idom.num1CSint(5,Xp2,int,t,c)
t<-2 c<-.4 a<-0; b<-10; int<-c(a,b) Mc<-centerMc(int,c) n<-10 set.seed(1) Xp<-runif(n,a,b) Idom.num1CSint(Xp[5],Xp,int,t,c) Idom.num1CSint(2,Xp,int,t,c,ch.data.pnt = FALSE) #gives an error if ch.data.pnt = TRUE since p is not a data point in Xp gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1CSint(Xp[i],Xp,int,t,c))} ind.gam1<-which(gam.vec==1) ind.gam1 domset<-Xp[ind.gam1] if (length(ind.gam1)==0) {domset<-NA} #or try Rv<-rel.vert.mid.int(Xp[5],int,c)$rv Idom.num1CSint(Xp[5],Xp,int,t,c,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,Mc),col=c(1,1,2),lty=2) points(cbind(Xp,0)) points(cbind(domset,0),pch=4,col=2) text(cbind(c(a,b,Mc),-0.1),c("a","b","Mc")) Idom.num1CSint(Xp[5],Xp,int,t,c) n<-10 Xp2<-runif(n,a+b,b+10) Idom.num1CSint(5,Xp2,int,t,c)
Returns p
is a dominating point of the CS-PCD where the vertices of the CS-PCD are the 2D data set
Xp
in the standard equilateral
triangle , that is, returns 1 if
p
is a dominating point of CS-PCD,
returns 0 otherwise.
CS proximity region is constructed with respect to with expansion parameter
and edge regions are based on center of mass
.
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, 2010)).
Idom.num1CSstd.tri(p, Xp, t, ch.data.pnt = FALSE)
Idom.num1CSstd.tri(p, Xp, t, ch.data.pnt = FALSE)
p |
A 2D point that is to be tested for being a dominating point or not of the CS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the CS-PCD. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
ch.data.pnt |
A logical argument for checking whether point |
p
is a dominating point of the CS-PCD where the vertices of the CS-PCD are the 2D data set
Xp
,
that is, returns 1 if p
is a dominating point, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 Te<-rbind(A,B,C); t<-1.5 n<-10 #try also n<-20 set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num1CSstd.tri(Xp[3,],Xp,t) Idom.num1CSstd.tri(c(1,2),c(1,2),t) Idom.num1CSstd.tri(c(1,2),c(1,2),t,ch.data.pnt = TRUE) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1CSstd.tri(Xp[i,],Xp,t))} ind.gam1<-which(gam.vec==1) ind.gam1 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE); 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(Te,CM) xc<-txt[,1]+c(-.02,.02,.01,.05) yc<-txt[,2]+c(.02,.02,.03,.02) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) Idom.num1CSstd.tri(c(1,2),Xp,t,ch.data.pnt = FALSE) #gives an error if ch.data.pnt = TRUE message since p is not a data point ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 Te<-rbind(A,B,C); t<-1.5 n<-10 #try also n<-20 set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num1CSstd.tri(Xp[3,],Xp,t) Idom.num1CSstd.tri(c(1,2),c(1,2),t) Idom.num1CSstd.tri(c(1,2),c(1,2),t,ch.data.pnt = TRUE) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1CSstd.tri(Xp[i,],Xp,t))} ind.gam1<-which(gam.vec==1) ind.gam1 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE); 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(Te,CM) xc<-txt[,1]+c(-.02,.02,.01,.05) yc<-txt[,2]+c(.02,.02,.03,.02) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) Idom.num1CSstd.tri(c(1,2),Xp,t,ch.data.pnt = FALSE) #gives an error if ch.data.pnt = TRUE message since p is not a data point ## End(Not run)
Returns p
is a dominating point of the CS-PCD where the vertices of the CS-PCD are the 2D data set
Xp
in the standard equilateral
triangle , that is, returns 1 if
p
is a dominating point of CS-PCD,
returns 0 otherwise.
Point, p
, is in the edge region of edge re (default is NULL
); vertices are labeled as
in the order they are stacked row-wise in
, and the opposite edges are labeled with label of the vertices
(that is, edge numbering is
1,2
, and 3
for edges ,
, and
).
CS proximity region is constructed with respect to with expansion parameter
and edge regions are based on center of mass
.
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, 2010)).
Idom.num1CSt1std.tri(p, Xp, re = NULL, ch.data.pnt = FALSE)
Idom.num1CSt1std.tri(p, Xp, re = NULL, ch.data.pnt = FALSE)
p |
A 2D point that is to be tested for being a dominating point or not of the CS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the CS-PCD. |
re |
The index of the edge region in |
ch.data.pnt |
A logical argument for checking whether point |
p
is a dominating point of the CS-PCD where the vertices of the CS-PCD are the 2D data set
Xp
,
that is, returns 1 if p
is a dominating point, returns 0 otherwise.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num1CSt1std.tri(Xp[3,],Xp) Idom.num1CSt1std.tri(c(1,2),c(1,2)) Idom.num1CSt1std.tri(c(1,2),c(1,2),ch.data.pnt = TRUE) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1CSt1std.tri(Xp[i,],Xp))} ind.gam1<-which(gam.vec==1) ind.gam1 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE); 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(Te,CM) xc<-txt[,1]+c(-.02,.02,.01,.05) yc<-txt[,2]+c(.02,.02,.03,.02) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); CM<-(A+B+C)/3 Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points Idom.num1CSt1std.tri(Xp[3,],Xp) Idom.num1CSt1std.tri(c(1,2),c(1,2)) Idom.num1CSt1std.tri(c(1,2),c(1,2),ch.data.pnt = TRUE) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1CSt1std.tri(Xp[i,],Xp))} ind.gam1<-which(gam.vec==1) ind.gam1 Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE); 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(Te,CM) xc<-txt[,1]+c(-.02,.02,.01,.05) yc<-txt[,2]+c(.02,.02,.03,.02) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) ## End(Not run)
Returns p
is a dominating point
of the PE-PCD
where the vertices of the PE-PCD are the 2D data set
Xp
for data in the standard basic triangle
,
that is, returns 1 if
p
is a dominating point of PE-PCD,
and returns 0 otherwise.
PE proximity regions are defined
with respect to the standard basic triangle .
In the standard basic triangle,
,
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.
Vertex regions are based on center in Cartesian
coordinates or
in barycentric coordinates
in the interior of a standard basic triangle
to the edges on the extension of the lines joining
M
to the vertices or based on the circumcenter of ;
default is
, i.e., the center of mass of
.
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.
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, 2011)).
Idom.num1PEbasic.tri( p, Xp, r, c1, c2, M = c(1, 1, 1), rv = NULL, ch.data.pnt = FALSE )
Idom.num1PEbasic.tri( p, Xp, r, c1, c2, M = c(1, 1, 1), rv = NULL, ch.data.pnt = FALSE )
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. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle
adjacent to the shorter edges; |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard basic triangle |
rv |
Index of the vertex whose region contains point |
ch.data.pnt |
A logical argument for checking
whether point |
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.
Elvan Ceyhan
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.
Idom.num1ASbasic.tri
and Idom.num1AStri
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 #try also n<-20 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.3) r<-2 P<-c(.4,.2) Idom.num1PEbasic.tri(P,Xp,r,c1,c2,M) Idom.num1PEbasic.tri(Xp[1,],Xp,r,c1,c2,M) Idom.num1PEbasic.tri(c(1,1),Xp,r,c1,c2,M,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE since point p=c(1,1) is not a data point in Xp #or try Rv<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv Idom.num1PEbasic.tri(Xp[1,],Xp,r,c1,c2,M,Rv) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEbasic.tri(Xp[i,],Xp,r,c1,c2,M))} ind.gam1<-which(gam.vec==1) ind.gam1 Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates if (identical(M,circumcenter.tri(Tb))) { plot(Tb,pch=".",asp=1,xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(Xp,pch=1,col=1) Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2) } else {plot(Tb,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(Xp,pch=1,col=1) Ds<-prj.cent2edges.basic.tri(c1,c2,M)} 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) txt<-rbind(Tb,M,Ds) xc<-txt[,1]+c(-.02,.02,.02,-.02,.03,-.03,.01) yc<-txt[,2]+c(.02,.02,.02,-.02,.02,.02,-.03) txt.str<-c("A","B","C","M","D1","D2","D3") text(xc,yc,txt.str) Idom.num1PEbasic.tri(c(.2,.1),Xp,r,c1,c2,M,ch.data.pnt=FALSE) #gives an error message if ch.data.pnt=TRUE since point p is not a data point in Xp ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 #try also n<-20 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.3) r<-2 P<-c(.4,.2) Idom.num1PEbasic.tri(P,Xp,r,c1,c2,M) Idom.num1PEbasic.tri(Xp[1,],Xp,r,c1,c2,M) Idom.num1PEbasic.tri(c(1,1),Xp,r,c1,c2,M,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE since point p=c(1,1) is not a data point in Xp #or try Rv<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv Idom.num1PEbasic.tri(Xp[1,],Xp,r,c1,c2,M,Rv) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEbasic.tri(Xp[i,],Xp,r,c1,c2,M))} ind.gam1<-which(gam.vec==1) ind.gam1 Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates if (identical(M,circumcenter.tri(Tb))) { plot(Tb,pch=".",asp=1,xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(Xp,pch=1,col=1) Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2) } else {plot(Tb,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(Xp,pch=1,col=1) Ds<-prj.cent2edges.basic.tri(c1,c2,M)} 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) txt<-rbind(Tb,M,Ds) xc<-txt[,1]+c(-.02,.02,.02,-.02,.03,-.03,.01) yc<-txt[,2]+c(.02,.02,.02,-.02,.02,.02,-.03) txt.str<-c("A","B","C","M","D1","D2","D3") text(xc,yc,txt.str) Idom.num1PEbasic.tri(c(.2,.1),Xp,r,c1,c2,M,ch.data.pnt=FALSE) #gives an error message if ch.data.pnt=TRUE since point p is not a data point in Xp ## End(Not run)
Returns p
is a dominating point of the PE-PCD where the vertices of the PE-PCD are the 1D data set
Xp
.
PE proximity region is defined with respect to the interval int
with an expansion parameter, ,
and a centrality parameter,
, so arcs may exist for
Xp
points inside the interval int
.
Vertex regions are based on the center associated with the centrality parameter .
rv
is the index of the vertex region p
resides, with default=NULL
.
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.
Idom.num1PEint(p, Xp, int, r, c = 0.5, rv = NULL, ch.data.pnt = FALSE)
Idom.num1PEint(p, Xp, int, r, c = 0.5, rv = NULL, ch.data.pnt = FALSE)
p |
A 1D point that is to be tested for being a dominating point or not of the PE-PCD. |
Xp |
A set of 1D points which constitutes the vertices of the PE-PCD. |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
rv |
Index of the vertex region in which the point resides, either |
ch.data.pnt |
A logical argument for checking whether point |
p
is a dominating point of the PE-PCD where the vertices of the PE-PCD are the 1D data set
Xp
,
that is, returns 1 if p
is a dominating point, returns 0 otherwise
Elvan Ceyhan
## Not run: r<-2 c<-.4 a<-0; b<-10 int=c(a,b) Mc<-centerMc(int,c) n<-10 set.seed(1) Xp<-runif(n,a,b) Idom.num1PEint(Xp[5],Xp,int,r,c) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEint(Xp[i],Xp,int,r,c))} ind.gam1<-which(gam.vec==1) ind.gam1 domset<-Xp[ind.gam1] if (length(ind.gam1)==0) {domset<-NA} #or try Rv<-rel.vert.mid.int(Xp[5],int,c)$rv Idom.num1PEint(Xp[5],Xp,int,r,c,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) points(cbind(Xp,0)) abline(v=c(a,b,Mc),col=c(1,1,2),lty=2) points(cbind(domset,0),pch=4,col=2) text(cbind(c(a,b,Mc),-0.1),c("a","b","Mc")) Idom.num1PEint(2,Xp,int,r,c,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE since point p is not a data point in Xp ## End(Not run)
## Not run: r<-2 c<-.4 a<-0; b<-10 int=c(a,b) Mc<-centerMc(int,c) n<-10 set.seed(1) Xp<-runif(n,a,b) Idom.num1PEint(Xp[5],Xp,int,r,c) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEint(Xp[i],Xp,int,r,c))} ind.gam1<-which(gam.vec==1) ind.gam1 domset<-Xp[ind.gam1] if (length(ind.gam1)==0) {domset<-NA} #or try Rv<-rel.vert.mid.int(Xp[5],int,c)$rv Idom.num1PEint(Xp[5],Xp,int,r,c,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) points(cbind(Xp,0)) abline(v=c(a,b,Mc),col=c(1,1,2),lty=2) points(cbind(domset,0),pch=4,col=2) text(cbind(c(a,b,Mc),-0.1),c("a","b","Mc")) Idom.num1PEint(2,Xp,int,r,c,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE since point p is not a data point in Xp ## End(Not run)
Returns p
is a dominating point of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
in the
standard regular tetrahedron , that is,
returns 1 if
p
is a dominating point of PE-PCD, returns 0 otherwise.
Point, p
, is in the vertex region of vertex rv
(default is NULL
); vertices are labeled as 1,2,3,4
in the order they are stacked row-wise in .
PE proximity region is constructed with respect to the tetrahedron with expansion parameter
and vertex regions are based on center of mass
(equivalent to circumcenter in this case).
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, 2010)).
Idom.num1PEstd.tetra(p, Xp, r, rv = NULL, ch.data.pnt = FALSE)
Idom.num1PEstd.tetra(p, Xp, r, rv = NULL, ch.data.pnt = FALSE)
p |
A 3D point that is to be tested for being a dominating point or not of the PE-PCD. |
Xp |
A set of 3D points which constitutes the vertices of the PE-PCD. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
rv |
Index of the vertex whose region contains point |
ch.data.pnt |
A logical argument for checking whether point |
p
is a dominating point of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
,
that is, returns 1 if p
is a dominating point, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Idom.num1PEtetra
, Idom.num1PEtri
and Idom.num1PEbasic.tri
## Not run: set.seed(123) A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try also n<-20 Xp<-runif.std.tetra(n)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) r<-1.5 P<-c(.4,.1,.2) Idom.num1PEstd.tetra(Xp[1,],Xp,r) Idom.num1PEstd.tetra(P,Xp,r) Idom.num1PEstd.tetra(Xp[1,],Xp,r) Idom.num1PEstd.tetra(Xp[1,],Xp[1,],r) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv Idom.num1PEstd.tetra(Xp[1,],Xp,r,rv=RV) Idom.num1PEstd.tetra(c(-1,-1,-1),Xp,r) Idom.num1PEstd.tetra(c(-1,-1,-1),c(-1,-1,-1),r) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEstd.tetra(Xp[i,],Xp,r))} ind.gam1<-which(gam.vec==1) ind.gam1 g1.pts<-Xp[ind.gam1,] Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =0,theta=40, bty = "g", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) if (length(g1.pts)!=0) { if (length(g1.pts)==3) g1.pts<-matrix(g1.pts,nrow=1) plot3D::points3D(g1.pts[,1],g1.pts[,2],g1.pts[,3], pch=4,col="red", add=TRUE)} plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) CM<-apply(tetra,2,mean) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CM,6),ncol=3,byrow=TRUE) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty=2) P<-c(.4,.1,.2) Idom.num1PEstd.tetra(P,Xp,r) Idom.num1PEstd.tetra(c(-1,-1,-1),Xp,r,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE ## End(Not run)
## Not run: set.seed(123) A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try also n<-20 Xp<-runif.std.tetra(n)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) r<-1.5 P<-c(.4,.1,.2) Idom.num1PEstd.tetra(Xp[1,],Xp,r) Idom.num1PEstd.tetra(P,Xp,r) Idom.num1PEstd.tetra(Xp[1,],Xp,r) Idom.num1PEstd.tetra(Xp[1,],Xp[1,],r) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv Idom.num1PEstd.tetra(Xp[1,],Xp,r,rv=RV) Idom.num1PEstd.tetra(c(-1,-1,-1),Xp,r) Idom.num1PEstd.tetra(c(-1,-1,-1),c(-1,-1,-1),r) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEstd.tetra(Xp[i,],Xp,r))} ind.gam1<-which(gam.vec==1) ind.gam1 g1.pts<-Xp[ind.gam1,] Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =0,theta=40, bty = "g", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) if (length(g1.pts)!=0) { if (length(g1.pts)==3) g1.pts<-matrix(g1.pts,nrow=1) plot3D::points3D(g1.pts[,1],g1.pts[,2],g1.pts[,3], pch=4,col="red", add=TRUE)} plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) CM<-apply(tetra,2,mean) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CM,6),ncol=3,byrow=TRUE) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty=2) P<-c(.4,.1,.2) Idom.num1PEstd.tetra(P,Xp,r) Idom.num1PEstd.tetra(c(-1,-1,-1),Xp,r,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE ## End(Not run)
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 tetrahedron th
, that is,
returns 1 if p
is a dominating point of PE-PCD, returns 0 otherwise.
Point, p
, is in the vertex region of vertex rv
(default is NULL
); vertices are labeled as 1,2,3,4
in the order they are stacked row-wise in th
.
PE proximity region is constructed with respect to the tetrahedron th
with expansion parameter
and vertex regions are based on center of mass (
M="CM"
) or circumcenter (M="CC"
) only.
and vertex regions are based on center of mass (equivalent to circumcenter in this case).
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, 2010)).
Idom.num1PEtetra(p, Xp, th, r, M = "CM", rv = NULL, ch.data.pnt = FALSE)
Idom.num1PEtetra(p, Xp, th, r, M = "CM", rv = NULL, ch.data.pnt = FALSE)
p |
A 3D point that is to be tested for being a dominating point or not of the PE-PCD. |
Xp |
A set of 3D points which constitutes the vertices of the PE-PCD. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
rv |
Index of the vertex whose region contains point |
ch.data.pnt |
A logical argument for checking whether point |
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, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Idom.num1PEstd.tetra
, Idom.num1PEtri
and Idom.num1PEbasic.tri
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try also n<-20 Xp<-runif.tetra(n,tetra)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) M<-"CM"; cent<-apply(tetra,2,mean) #center of mass #try also M<-"CC"; cent<-circumcenter.tetra(tetra) #circumcenter r<-2 P<-c(.4,.1,.2) Idom.num1PEtetra(Xp[1,],Xp,tetra,r,M) Idom.num1PEtetra(P,Xp,tetra,r,M) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv Idom.num1PEtetra(Xp[1,],Xp,tetra,r,M,rv=RV) Idom.num1PEtetra(c(-1,-1,-1),Xp,tetra,r,M) Idom.num1PEtetra(c(-1,-1,-1),c(-1,-1,-1),tetra,r,M) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEtetra(Xp[i,],Xp,tetra,r,M))} ind.gam1<-which(gam.vec==1) ind.gam1 g1.pts<-Xp[ind.gam1,] Xlim<-range(tetra[,1],Xp[,1],cent[1]) Ylim<-range(tetra[,2],Xp[,2],cent[2]) Zlim<-range(tetra[,3],Xp[,3],cent[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =0,theta=40, bty = "g", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) if (length(g1.pts)!=0) {plot3D::points3D(g1.pts[,1],g1.pts[,2],g1.pts[,3], pch=4,col="red", add=TRUE)} plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-rbind(cent,cent,cent,cent,cent,cent) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty=2) P<-c(.4,.1,.2) Idom.num1PEtetra(P,Xp,tetra,r,M) Idom.num1PEtetra(c(-1,-1,-1),Xp,tetra,r,M,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE since p is not a data point ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try also n<-20 Xp<-runif.tetra(n,tetra)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) M<-"CM"; cent<-apply(tetra,2,mean) #center of mass #try also M<-"CC"; cent<-circumcenter.tetra(tetra) #circumcenter r<-2 P<-c(.4,.1,.2) Idom.num1PEtetra(Xp[1,],Xp,tetra,r,M) Idom.num1PEtetra(P,Xp,tetra,r,M) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv Idom.num1PEtetra(Xp[1,],Xp,tetra,r,M,rv=RV) Idom.num1PEtetra(c(-1,-1,-1),Xp,tetra,r,M) Idom.num1PEtetra(c(-1,-1,-1),c(-1,-1,-1),tetra,r,M) gam.vec<-vector() for (i in 1:n) {gam.vec<-c(gam.vec,Idom.num1PEtetra(Xp[i,],Xp,tetra,r,M))} ind.gam1<-which(gam.vec==1) ind.gam1 g1.pts<-Xp[ind.gam1,] Xlim<-range(tetra[,1],Xp[,1],cent[1]) Ylim<-range(tetra[,2],Xp[,2],cent[2]) Zlim<-range(tetra[,3],Xp[,3],cent[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =0,theta=40, bty = "g", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) if (length(g1.pts)!=0) {plot3D::points3D(g1.pts[,1],g1.pts[,2],g1.pts[,3], pch=4,col="red", add=TRUE)} plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-rbind(cent,cent,cent,cent,cent,cent) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty=2) P<-c(.4,.1,.2) Idom.num1PEtetra(P,Xp,tetra,r,M) Idom.num1PEtetra(c(-1,-1,-1),Xp,tetra,r,M,ch.data.pnt = FALSE) #gives an error message if ch.data.pnt = TRUE since p is not a data point ## End(Not run)
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)).
Idom.num1PEtri(p, Xp, tri, r, M = c(1, 1, 1), rv = NULL, ch.data.pnt = FALSE)
Idom.num1PEtri(p, Xp, tri, r, M = c(1, 1, 1), rv = NULL, ch.data.pnt = FALSE)
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 |
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.
Elvan Ceyhan
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.
Idom.num1PEbasic.tri
and Idom.num1AStri
## Not run: 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 ## End(Not run)
## Not run: 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 ## End(Not run)
Returns {
p1,p2
} is a dominating set of AS-PCD where vertices of AS-PCD are the 2D
data set
Xp
), that is, returns 1 if {p1,p2
} is a dominating set of AS-PCD, returns 0 otherwise.
AS proximity regions are defined with respect to the standard basic triangle ,
In the standard basic triangle,
,
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence standard basic triangle is useful for simulation studies under the uniformity hypothesis.
Point, p1
, is in the vertex region of vertex rv1
(default is NULL
)
and point, p2
, is in the vertex region of vertex rv2
(default is NULL
); vertices are labeled as
in the order they are stacked row-wise.
Vertex regions are based on the center M="CC"
for circumcenter
of ; or
in Cartesian coordinates or
in barycentric coordinates in the
interior of
; default is
M="CC"
.
ch.data.pnts
is for checking whether points p1
and p2
are data points in Xp
or not
(default is FALSE
), so by default this function checks whether the points p1
and p2
would be a
dominating set if they actually were in the data set.
See also (Ceyhan (2005, 2010)).
Idom.num2ASbasic.tri( p1, p2, Xp, c1, c2, M = "CC", rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
Idom.num2ASbasic.tri( p1, p2, Xp, c1, c2, M = "CC", rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
p1 , p2
|
Two 2D points to be tested for constituting a dominating set of the AS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the AS-PCD. |
c1 , c2
|
Positive real numbers which constitute the vertex of the standard basic triangle
adjacent to the shorter edges; |
M |
The center of the triangle. |
rv1 , rv2
|
The indices of the vertices whose regions contains |
ch.data.pnts |
A logical argument for checking whether points |
{
p1,p2
} is a dominating set of the AS-PCD where the vertices of AS-PCD are the 2D data set
Xp
),
that is, returns 1 if {p1,p2
} is a dominating set of AS-PCD, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M) Idom.num2ASbasic.tri(Xp[1,],Xp[1,],Xp,c1,c2,M) #one point can not a dominating set of size two Idom.num2ASbasic.tri(c(.2,.4),c(.2,.5),rbind(c(.2,.4),c(.2,.5)),c1,c2,M) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2ASbasic.tri(Xp[i,],Xp[j,],Xp,c1,c2,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.basic.triCC(Xp[1,],c1,c2)$rv rv2<-rel.vert.basic.triCC(Xp[2,],c1,c2)$rv Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M,rv1,rv2) Idom.num2ASbasic.tri(c(.2,.4),Xp[2,],Xp,c1,c2,M,rv1,rv2) #or try rv1<-rel.vert.basic.triCC(Xp[1,],c1,c2)$rv Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M,rv1) #or try Rv2<-rel.vert.basic.triCC(Xp[2,],c1,c2)$rv Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M,rv2=Rv2) Idom.num2ASbasic.tri(c(.3,.2),c(.35,.25),Xp,c1,c2,M) ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M) Idom.num2ASbasic.tri(Xp[1,],Xp[1,],Xp,c1,c2,M) #one point can not a dominating set of size two Idom.num2ASbasic.tri(c(.2,.4),c(.2,.5),rbind(c(.2,.4),c(.2,.5)),c1,c2,M) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2ASbasic.tri(Xp[i,],Xp[j,],Xp,c1,c2,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.basic.triCC(Xp[1,],c1,c2)$rv rv2<-rel.vert.basic.triCC(Xp[2,],c1,c2)$rv Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M,rv1,rv2) Idom.num2ASbasic.tri(c(.2,.4),Xp[2,],Xp,c1,c2,M,rv1,rv2) #or try rv1<-rel.vert.basic.triCC(Xp[1,],c1,c2)$rv Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M,rv1) #or try Rv2<-rel.vert.basic.triCC(Xp[2,],c1,c2)$rv Idom.num2ASbasic.tri(Xp[1,],Xp[2,],Xp,c1,c2,M,rv2=Rv2) Idom.num2ASbasic.tri(c(.3,.2),c(.35,.25),Xp,c1,c2,M) ## End(Not run)
Returns {
p1,p2
} is a dominating set of the AS-PCD where vertices of the AS-PCD are
the 2D data set
Xp
), that is, returns 1 if {p1,p2
} is a dominating set of AS-PCD, returns 0 otherwise.
AS proximity regions are defined with respect to the triangle tri
.
Point, p1
, is in the region of vertex rv1
(default is NULL
)
and point, p2
, is in the region of vertex rv2
(default is NULL
); vertices (and hence rv1
and rv2
)
are labeled as in the order they are stacked row-wise in
tri
.
Vertex regions are based on
the center M="CC"
for circumcenter of tri
; or in Cartesian coordinates
or
in barycentric coordinates in the interior of the triangle
tri
;
default is M="CC"
the circumcenter of tri
.
ch.data.pnts
is for checking whether points p1
and p2
are data
points in Xp
or not (default is FALSE
), so by default this function checks whether the points p1
and p2
would constitute dominating set if they actually were in the data set.
See also (Ceyhan (2005, 2010)).
Idom.num2AStri( p1, p2, Xp, tri, M = "CC", rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
Idom.num2AStri( p1, p2, Xp, tri, M = "CC", rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
p1 , p2
|
Two 2D points to be tested for constituting a dominating set of the AS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the AS-PCD. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
rv1 , rv2
|
The indices of the vertices whose regions contains |
ch.data.pnts |
A logical argument for checking whether points |
{
p1,p2
} is a dominating set of the AS-PCD where vertices of the AS-PCD are the 2D data set
Xp
),
that is, returns 1 if {p1,p2
} is a dominating set of AS-PCD, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M) Idom.num2AStri(Xp[1,],Xp[1,],Xp,Tr,M) #same two points cannot be a dominating set of size 2 Idom.num2AStri(c(.2,.4),Xp[2,],Xp,Tr,M) Idom.num2AStri(c(.2,.4),c(.2,.5),Xp,Tr,M) Idom.num2AStri(c(.2,.4),c(.2,.5),rbind(c(.2,.4),c(.2,.5)),Tr,M) #or try rv1<-rel.vert.triCC(c(.2,.4),Tr)$rv rv2<-rel.vert.triCC(c(.2,.5),Tr)$rv Idom.num2AStri(c(.2,.4),c(.2,.5),rbind(c(.2,.4),c(.2,.5)),Tr,M,rv1,rv2) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2AStri(Xp[i,],Xp[j,],Xp,Tr,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.triCC(Xp[1,],Tr)$rv rv2<-rel.vert.triCC(Xp[2,],Tr)$rv Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M,rv1,rv2) #or try rv1<-rel.vert.triCC(Xp[1,],Tr)$rv Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M,rv1) #or try Rv2<-rel.vert.triCC(Xp[2,],Tr)$rv Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M,rv2=Rv2) Idom.num2AStri(c(1.3,1.2),c(1.35,1.25),Xp,Tr,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M) Idom.num2AStri(Xp[1,],Xp[1,],Xp,Tr,M) #same two points cannot be a dominating set of size 2 Idom.num2AStri(c(.2,.4),Xp[2,],Xp,Tr,M) Idom.num2AStri(c(.2,.4),c(.2,.5),Xp,Tr,M) Idom.num2AStri(c(.2,.4),c(.2,.5),rbind(c(.2,.4),c(.2,.5)),Tr,M) #or try rv1<-rel.vert.triCC(c(.2,.4),Tr)$rv rv2<-rel.vert.triCC(c(.2,.5),Tr)$rv Idom.num2AStri(c(.2,.4),c(.2,.5),rbind(c(.2,.4),c(.2,.5)),Tr,M,rv1,rv2) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2AStri(Xp[i,],Xp[j,],Xp,Tr,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.triCC(Xp[1,],Tr)$rv rv2<-rel.vert.triCC(Xp[2,],Tr)$rv Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M,rv1,rv2) #or try rv1<-rel.vert.triCC(Xp[1,],Tr)$rv Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M,rv1) #or try Rv2<-rel.vert.triCC(Xp[2,],Tr)$rv Idom.num2AStri(Xp[1,],Xp[2,],Xp,Tr,M,rv2=Rv2) Idom.num2AStri(c(1.3,1.2),c(1.35,1.25),Xp,Tr,M) ## End(Not run)
Returns {
p1,p2
} is a dominating set of the CS-PCD where the vertices of the CS-PCD are the 2D data set
Xp
),
that is, returns 1 if p
is a dominating point of CS-PCD, returns 0 otherwise.
CS proximity region is
constructed with respect to the standard equilateral triangle and
with expansion parameter
. Point,
p1
, must lie in the first one-sixth of , which is the triangle with
vertices
.
ch.data.pnts
is for checking whether points p1
and p2
are data points in Xp
or not
(default is FALSE
), so by default this function checks whether the points p1
and p2
would be a
dominating set if they actually were in the data set.
See also (Ceyhan (2005)).
Idom.num2CS.Te.onesixth(p1, p2, Xp, ch.data.pnts = FALSE)
Idom.num2CS.Te.onesixth(p1, p2, Xp, ch.data.pnts = FALSE)
p1 , p2
|
Two 2D points to be tested for constituting a dominating set of the CS-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the CS-PCD. |
ch.data.pnts |
A logical argument for checking whether points |
{
p1,p2
} is a dominating set of the CS-PCD where the vertices of the CS-PCD are the 2D data set
Xp
),
that is, returns 1 if {p1,p2
} is a dominating set of CS-PCD, returns 0 otherwise
Elvan Ceyhan
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.
Returns {
p1,p2
} is
a dominating set of the PE-PCD
where the vertices of the PE-PCD are the 2D data set
Xp
in the standard basic triangle
,
that is, returns 1 if {
p1,p2
} is a dominating set of PE-PCD,
and returns 0 otherwise.
PE proximity regions are defined with respect to .
In the standard basic triangle,
,
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.
Vertex regions are based on center in Cartesian
coordinates or
in barycentric coordinates
in the interior of a standard basic triangle
;
default is
, i.e., the center of mass of
.
Point,
p1
,
is in the vertex region of vertex rv1
(default is NULL
);
and point, p2
,
is in the vertex region of vertex rv2
(default is NULL
);
vertices are labeled as
in the order they are stacked row-wise.
ch.data.pnts
is for checking
whether points p1
and p2
are both data points
in Xp
or not (default is FALSE
),
so by default this function checks
whether the points p1
and p2
would constitute
a dominating set
if they both were actually in the data set.
See also (Ceyhan (2005, 2011)).
Idom.num2PEbasic.tri( p1, p2, Xp, r, c1, c2, M = c(1, 1, 1), rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
Idom.num2PEbasic.tri( p1, p2, Xp, r, c1, c2, M = c(1, 1, 1), rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
p1 , p2
|
Two 2D points to be tested for constituting a dominating set of the PE-PCD. |
Xp |
A set of 2D points which constitutes the vertices of the PE-PCD. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle.
adjacent to the shorter edges; |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard basic triangle |
rv1 , rv2
|
The indices of the vertices
whose regions contains |
ch.data.pnts |
A logical argument for
checking whether points |
{
p1,p2
} is a dominating set of the PE-PCD
where the vertices of the PE-PCD are the 2D data set
Xp
,
that is, returns 1 if {p1,p2
} is a dominating set of PE-PCD,
and returns 0 otherwise.
Elvan Ceyhan
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.
Idom.num2PEtri
, Idom.num2ASbasic.tri
,
and Idom.num2AStri
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 #try also n<-20 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.3) r<-2 Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M) Idom.num2PEbasic.tri(c(1,2),c(1,3),rbind(c(1,2),c(1,3)),r,c1,c2,M) Idom.num2PEbasic.tri(c(1,2),c(1,3),rbind(c(1,2),c(1,3)),r,c1,c2,M, ch.data.pnts = TRUE) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEbasic.tri(Xp[i,],Xp[j,],Xp,r,c1,c2,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv; rv2<-rel.vert.basic.tri(Xp[2,],c1,c2,M)$rv; Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv1,rv2) #or try rv1<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv; Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv1) #or try rv2<-rel.vert.basic.tri(Xp[2,],c1,c2,M)$rv; Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv2=rv2) Idom.num2PEbasic.tri(c(1,2),Xp[2,],Xp,r,c1,c2,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not both points are data points in Xp ## End(Not run)
## Not run: c1<-.4; c2<-.6; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) n<-10 #try also n<-20 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.3) r<-2 Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M) Idom.num2PEbasic.tri(c(1,2),c(1,3),rbind(c(1,2),c(1,3)),r,c1,c2,M) Idom.num2PEbasic.tri(c(1,2),c(1,3),rbind(c(1,2),c(1,3)),r,c1,c2,M, ch.data.pnts = TRUE) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEbasic.tri(Xp[i,],Xp[j,],Xp,r,c1,c2,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv; rv2<-rel.vert.basic.tri(Xp[2,],c1,c2,M)$rv; Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv1,rv2) #or try rv1<-rel.vert.basic.tri(Xp[1,],c1,c2,M)$rv; Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv1) #or try rv2<-rel.vert.basic.tri(Xp[2,],c1,c2,M)$rv; Idom.num2PEbasic.tri(Xp[1,],Xp[2,],Xp,r,c1,c2,M,rv2=rv2) Idom.num2PEbasic.tri(c(1,2),Xp[2,],Xp,r,c1,c2,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not both points are data points in Xp ## End(Not run)
Returns {
p1,p2
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
in the standard regular
tetrahedron , that is,
returns 1 if {
p1,p2
} is a dominating set of PE-PCD, returns 0 otherwise.
Point, p1
, is in the region of vertex rv1
(default is NULL
) and point, p2
, is in the region of vertex rv2
(default is NULL
); vertices (and hence rv1
and rv2
) are labeled as 1,2,3,4
in the order they are stacked
row-wise in .
PE proximity region is constructed with respect to the tetrahedron with expansion parameter
and vertex regions are based on center of mass
(equivalent to circumcenter in this case).
ch.data.pnts
is for checking whether points p1
and p2
are data points in Xp
or not (default is FALSE
),
so by default this function checks whether the points p1
and p2
would constitute a dominating set
if they actually were both in the data set.
See also (Ceyhan (2005, 2010)).
Idom.num2PEstd.tetra( p1, p2, Xp, r, rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
Idom.num2PEstd.tetra( p1, p2, Xp, r, rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
p1 , p2
|
Two 3D points to be tested for constituting a dominating set of the PE-PCD. |
Xp |
A set of 3D points which constitutes the vertices of the PE-PCD. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
rv1 , rv2
|
The indices of the vertices whose regions contains |
ch.data.pnts |
A logical argument for checking whether points |
{
p1,p2
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
),
that is, returns 1 if {p1,p2
} is a dominating set of PE-PCD, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Idom.num2PEtetra
, Idom.num2PEtri
and Idom.num2PEbasic.tri
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try also n<-20 Xp<-runif.std.tetra(n)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) r<-1.5 Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEstd.tetra(Xp[i,],Xp[j,],Xp,r)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv;rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r,rv1,rv2) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.4,.1,.2) Idom.num2PEstd.tetra(P1,P2,Xp,r) Idom.num2PEstd.tetra(c(-1,-1,-1),Xp[2,],Xp,r,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE #since not both points, p1 and p2, are data points in Xp ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try also n<-20 Xp<-runif.std.tetra(n)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) r<-1.5 Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEstd.tetra(Xp[i,],Xp[j,],Xp,r)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv;rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r,rv1,rv2) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEstd.tetra(Xp[1,],Xp[2,],Xp,r,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.4,.1,.2) Idom.num2PEstd.tetra(P1,P2,Xp,r) Idom.num2PEstd.tetra(c(-1,-1,-1),Xp[2,],Xp,r,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE #since not both points, p1 and p2, are data points in Xp ## End(Not run)
Returns {
p1,p2
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
in the tetrahedron th
, that is,
returns 1 if {p1,p2
} is a dominating set of PE-PCD, returns 0 otherwise.
Point, p1
, is in the region of vertex rv1
(default is NULL
) and point, p2
, is in the region of vertex rv2
(default is NULL
); vertices (and hence rv1
and rv2
) are labeled as 1,2,3,4
in the order they are stacked
row-wise in th
.
PE proximity region is constructed with respect to the tetrahedron th
with expansion parameter
and vertex regions are based on center of mass (
M="CM"
) or circumcenter (M="CC"
) only.
ch.data.pnts
is for checking whether points p1
and p2
are both data points in Xp
or not (default is FALSE
),
so by default this function checks whether the points p1
and p2
would constitute a dominating set
if they actually were both in the data set.
See also (Ceyhan (2005, 2010)).
Idom.num2PEtetra( p1, p2, Xp, th, r, M = "CM", rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
Idom.num2PEtetra( p1, p2, Xp, th, r, M = "CM", rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
p1 , p2
|
Two 3D points to be tested for constituting a dominating set of the PE-PCD. |
Xp |
A set of 3D points which constitutes the vertices of the PE-PCD. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
rv1 , rv2
|
The indices of the vertices whose regions contains |
ch.data.pnts |
A logical argument for checking whether both points |
{
p1,p2
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
),
that is, returns 1 if {p1,p2
} is a dominating set of PE-PCD, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Idom.num2PEstd.tetra
, Idom.num2PEtri
and Idom.num2PEbasic.tri
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 set.seed(1) Xp<-runif.tetra(n,tetra)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) M<-"CM"; #try also M<-"CC"; r<-1.5 Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M) Idom.num2PEtetra(c(-1,-1,-1),Xp[2,],Xp,tetra,r,M) ind.gam2<-ind.gamn2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEtetra(Xp[i,],Xp[j,],Xp,tetra,r,M)==1) {ind.gam2<-rbind(ind.gam2,c(i,j)) } } ind.gam2 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv;rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M,rv1,rv2) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.4,.1,.2) Idom.num2PEtetra(P1,P2,Xp,tetra,r,M) Idom.num2PEtetra(c(-1,-1,-1),Xp[2,],Xp,tetra,r,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE #since not both points, p1 and p2, are data points in Xp ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 set.seed(1) Xp<-runif.tetra(n,tetra)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) M<-"CM"; #try also M<-"CC"; r<-1.5 Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M) Idom.num2PEtetra(c(-1,-1,-1),Xp[2,],Xp,tetra,r,M) ind.gam2<-ind.gamn2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEtetra(Xp[i,],Xp[j,],Xp,tetra,r,M)==1) {ind.gam2<-rbind(ind.gam2,c(i,j)) } } ind.gam2 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv;rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M,rv1,rv2) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num2PEtetra(Xp[1,],Xp[2,],Xp,tetra,r,M,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.4,.1,.2) Idom.num2PEtetra(P1,P2,Xp,tetra,r,M) Idom.num2PEtetra(c(-1,-1,-1),Xp[2,],Xp,tetra,r,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE #since not both points, p1 and p2, are data points in Xp ## End(Not run)
Returns {
p1,p2
} is
a dominating set of the PE-PCD
where the vertices of the PE-PCD are the 2D data set
Xp
,
that is, returns 1 if {p1,p2
} is a dominating set of PE-PCD,
and returns 0 otherwise.
Point, p1
, is in the region of vertex rv1
(default is NULL
) and point, p2
, is
in the region of vertex rv2
(default is NULL
); vertices (and hence rv1
and rv2
)
are labeled as in the order they are stacked
row-wise in
tri
.
PE proximity regions are defined
with respect to the triangle tri
and vertex regions
are based on center in Cartesian coordinates
or
in barycentric coordinates
in the interior of the triangle
tri
or circumcenter of tri
;
default is , i.e., the center of mass of
tri
.
ch.data.pnts
is
for checking whether points p1
and p2
are data points
in Xp
or not
(default is FALSE
),
so by default this function checks
whether the points p1
and p2
would be a
dominating set if they actually were in the data set.
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)).
Idom.num2PEtri( p1, p2, Xp, tri, r, M = c(1, 1, 1), rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
Idom.num2PEtri( p1, p2, Xp, tri, r, M = c(1, 1, 1), rv1 = NULL, rv2 = NULL, ch.data.pnts = FALSE )
p1 , p2
|
Two 2D points to be tested for constituting a dominating set 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 |
rv1 , rv2
|
The indices of the vertices
whose regions contains |
ch.data.pnts |
A logical argument for
checking whether points |
{
p1,p2
} is a dominating set of the PE-PCD
where the vertices of the PE-PCD are the 2D data set
Xp
,
that is, returns 1 if {p1,p2
} is a dominating set of PE-PCD,
and returns 0 otherwise.
Elvan Ceyhan
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.
Idom.num2PEbasic.tri
, Idom.num2AStri
,
and Idom.num2PEtetra
## Not run: 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.num2PEtri(Xp[1,],Xp[2,],Xp,Tr,r,M) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEtri(Xp[i,],Xp[j,],Xp,Tr,r,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.tri(Xp[1,],Tr,M)$rv; rv2<-rel.vert.tri(Xp[2,],Tr,M)$rv Idom.num2PEtri(Xp[1,],Xp[2,],Xp,Tr,r,M,rv1,rv2) Idom.num2PEtri(Xp[1,],c(1,2),Xp,Tr,r,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE #since not both points, p1 and p2, are data points in Xp ## End(Not run)
## Not run: 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.num2PEtri(Xp[1,],Xp[2,],Xp,Tr,r,M) ind.gam2<-vector() for (i in 1:(n-1)) for (j in (i+1):n) {if (Idom.num2PEtri(Xp[i,],Xp[j,],Xp,Tr,r,M)==1) ind.gam2<-rbind(ind.gam2,c(i,j))} ind.gam2 #or try rv1<-rel.vert.tri(Xp[1,],Tr,M)$rv; rv2<-rel.vert.tri(Xp[2,],Tr,M)$rv Idom.num2PEtri(Xp[1,],Xp[2,],Xp,Tr,r,M,rv1,rv2) Idom.num2PEtri(Xp[1,],c(1,2),Xp,Tr,r,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE #since not both points, p1 and p2, are data points in Xp ## End(Not run)
Returns p1,p2,pt3
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
in the standard regular
tetrahedron , that is,
returns 1 if {
p1,p2,pt3
} is a dominating set of PE-PCD, returns 0 otherwise.
Point, p1
, is in the region of vertex rv1
(default is NULL
), point, p2
, is in the region of vertex rv2
(default is NULL
); point, pt3
), is in the region of vertex rv3
) (default is NULL
); vertices (and hence rv1, rv2
and
rv3
) are labeled as 1,2,3,4
in the order they are stacked row-wise in .
PE proximity region is constructed with
respect to the tetrahedron with expansion parameter
and vertex regions are based on center of mass
(equivalent to circumcenter in this case).
ch.data.pnts
is for checking whether points p1
, p2
and pt3
are all data points in Xp
or not (default is FALSE
),
so by default this function checks whether the points p1
, p2
and pt3
would constitute a dominating set
if they actually were all in the data set.
See also (Ceyhan (2005, 2010)).
Idom.num3PEstd.tetra( p1, p2, pt3, Xp, r, rv1 = NULL, rv2 = NULL, rv3 = NULL, ch.data.pnts = FALSE )
Idom.num3PEstd.tetra( p1, p2, pt3, Xp, r, rv1 = NULL, rv2 = NULL, rv3 = NULL, ch.data.pnts = FALSE )
p1 , p2 , pt3
|
Three 3D points to be tested for constituting a dominating set of the PE-PCD. |
Xp |
A set of 3D points which constitutes the vertices of the PE-PCD. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
rv1 , rv2 , rv3
|
The indices of the vertices whose regions contains |
ch.data.pnts |
A logical argument for checking whether points |
p1,p2,pt3
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
),
that is, returns 1 if {p1,p2,pt3
} is a dominating set of PE-PCD, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
## Not run: set.seed(123) A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try 20, 40, 100 (larger n may take a long time) Xp<-runif.std.tetra(n)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) r<-1.25 Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r) ind.gam3<-vector() for (i in 1:(n-2)) for (j in (i+1):(n-1)) for (k in (j+1):n) {if (Idom.num3PEstd.tetra(Xp[i,],Xp[j,],Xp[k,],Xp,r)==1) ind.gam3<-rbind(ind.gam3,c(i,j,k))} ind.gam3 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv; rv3<-rel.vert.tetraCC(Xp[3,],tetra)$rv Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r,rv1,rv2,rv3) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.3,.3,.3) P3<-c(.4,.1,.2) Idom.num3PEstd.tetra(P1,P2,P3,Xp,r) Idom.num3PEstd.tetra(Xp[1,],c(1,1,1),Xp[3,],Xp,r,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run)
## Not run: set.seed(123) A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try 20, 40, 100 (larger n may take a long time) Xp<-runif.std.tetra(n)$g #try also Xp<-cbind(runif(n),runif(n),runif(n)) r<-1.25 Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r) ind.gam3<-vector() for (i in 1:(n-2)) for (j in (i+1):(n-1)) for (k in (j+1):n) {if (Idom.num3PEstd.tetra(Xp[i,],Xp[j,],Xp[k,],Xp,r)==1) ind.gam3<-rbind(ind.gam3,c(i,j,k))} ind.gam3 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv; rv3<-rel.vert.tetraCC(Xp[3,],tetra)$rv Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r,rv1,rv2,rv3) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num3PEstd.tetra(Xp[1,],Xp[2,],Xp[3,],Xp,r,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.3,.3,.3) P3<-c(.4,.1,.2) Idom.num3PEstd.tetra(P1,P2,P3,Xp,r) Idom.num3PEstd.tetra(Xp[1,],c(1,1,1),Xp[3,],Xp,r,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run)
Returns p1,p2,pt3
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
in the tetrahedron th
, that is,
returns 1 if {p1,p2,pt3
} is a dominating set of PE-PCD, returns 0 otherwise.
Point, p1
, is in the region of vertex rv1
(default is NULL
), point, p2
, is in the region of vertex rv2
(default is NULL
); point, pt3
), is in the region of vertex rv3
) (default is NULL
); vertices (and hence rv1, rv2
and
rv3
) are labeled as 1,2,3,4
in the order they are stacked row-wise in th
.
PE proximity region is constructed with
respect to the tetrahedron th
with expansion parameter
and vertex regions are based on center of mass
(equivalent to circumcenter in this case).
ch.data.pnts
is for checking whether points p1
, p2
and pt3
are all data points in Xp
or not (default is FALSE
),
so by default this function checks whether the points p1
, p2
and pt3
would constitute a dominating set
if they actually were all in the data set.
See also (Ceyhan (2005, 2010)).
Idom.num3PEtetra( p1, p2, pt3, Xp, th, r, M = "CM", rv1 = NULL, rv2 = NULL, rv3 = NULL, ch.data.pnts = FALSE )
Idom.num3PEtetra( p1, p2, pt3, Xp, th, r, M = "CM", rv1 = NULL, rv2 = NULL, rv3 = NULL, ch.data.pnts = FALSE )
p1 , p2 , pt3
|
Three 3D points to be tested for constituting a dominating set of the PE-PCD. |
Xp |
A set of 3D points which constitutes the vertices of the PE-PCD. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
rv1 , rv2 , rv3
|
The indices of the vertices whose regions contains |
ch.data.pnts |
A logical argument for checking whether points |
p1,p2,pt3
} is a dominating set of the PE-PCD where the vertices of the PE-PCD are the 3D data set
Xp
),
that is, returns 1 if {p1,p2,pt3
} is a dominating set of PE-PCD, returns 0 otherwise
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
## Not run: set.seed(123) A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try 20, 40, 100 (larger n may take a long time) Xp<-runif.tetra(n,tetra)$g M<-"CM"; #try also M<-"CC"; r<-1.25 Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M) ind.gam3<-vector() for (i in 1:(n-2)) for (j in (i+1):(n-1)) for (k in (j+1):n) {if (Idom.num3PEtetra(Xp[i,],Xp[j,],Xp[k,],Xp,tetra,r,M)==1) ind.gam3<-rbind(ind.gam3,c(i,j,k))} ind.gam3 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv; rv3<-rel.vert.tetraCC(Xp[3,],tetra)$rv Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M,rv1,rv2,rv3) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.3,.3,.3) P3<-c(.4,.1,.2) Idom.num3PEtetra(P1,P2,P3,Xp,tetra,r,M) Idom.num3PEtetra(Xp[1,],c(1,1,1),Xp[3,],Xp,tetra,r,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run)
## Not run: set.seed(123) A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 #try 20, 40, 100 (larger n may take a long time) Xp<-runif.tetra(n,tetra)$g M<-"CM"; #try also M<-"CC"; r<-1.25 Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M) ind.gam3<-vector() for (i in 1:(n-2)) for (j in (i+1):(n-1)) for (k in (j+1):n) {if (Idom.num3PEtetra(Xp[i,],Xp[j,],Xp[k,],Xp,tetra,r,M)==1) ind.gam3<-rbind(ind.gam3,c(i,j,k))} ind.gam3 #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv; rv3<-rel.vert.tetraCC(Xp[3,],tetra)$rv Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M,rv1,rv2,rv3) #or try rv1<-rel.vert.tetraCC(Xp[1,],tetra)$rv; Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M,rv1) #or try rv2<-rel.vert.tetraCC(Xp[2,],tetra)$rv Idom.num3PEtetra(Xp[1,],Xp[2,],Xp[3,],Xp,tetra,r,M,rv2=rv2) P1<-c(.1,.1,.1) P2<-c(.3,.3,.3) P3<-c(.4,.1,.2) Idom.num3PEtetra(P1,P2,P3,Xp,tetra,r,M) Idom.num3PEtetra(Xp[1,],c(1,1,1),Xp[3,],Xp,tetra,r,M,ch.data.pnts = FALSE) #gives an error message if ch.data.pnts = TRUE since not all points are data points in Xp ## End(Not run)
Returns domination number of AS-PCD whose vertices are the data points
Xp
is less than or equal to k
,
that is, returns 1 if the domination number of AS-PCD is less than the prespecified value
k
, returns 0
otherwise. It also provides the vertices (i.e., data points) in a dominating set of size k
of AS-PCD.
AS proximity regions are constructed with respect to the triangle tri
and
vertex regions are based on the center M="CC"
for circumcenter of tri
;
or in Cartesian coordinates or
in barycentric coordinates in the
interior of the triangle
tri
; default is M="CC"
i.e., circumcenter of tri
.
The vertices of tri
angle, tri
,
are labeled as according to the row number the vertex is recorded in
tri
.
Loops are allowed in the digraph.
It takes a long time for large number of vertices (i.e., large number of row numbers).
Idom.numASup.bnd.tri(Xp, k, tri, M = "CC")
Idom.numASup.bnd.tri(Xp, k, tri, M = "CC")
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
k |
A positive integer to be tested for an upper bound for the domination number of AS-PCDs. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
A list
with the elements
domUB |
The suggested upper bound (to be checked) for the domination number of AS-PCD.
It is prespecified as |
Idom.num.up.bnd |
The indicator for the upper bound for domination number of AS-PCD being the
specified value |
ind.dom.set |
The vertices (i.e., data points) in the dominating set of size |
Elvan Ceyhan
Idom.numCSup.bnd.tri
, Idom.numCSup.bnd.std.tri
, Idom.num.up.bnd
,
and dom.num.exact
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) Idom.numASup.bnd.tri(Xp,1,Tr) for (k in 1:n) print(c(k,Idom.numASup.bnd.tri(Xp,k,Tr,M))) Idom.numASup.bnd.tri(Xp,k=4,Tr,M) P<-c(.4,.2) Idom.numASup.bnd.tri(P,1,Tr,M) Idom.numASup.bnd.tri(rbind(Xp,Xp),k=2,Tr,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) Idom.numASup.bnd.tri(Xp,1,Tr) for (k in 1:n) print(c(k,Idom.numASup.bnd.tri(Xp,k,Tr,M))) Idom.numASup.bnd.tri(Xp,k=4,Tr,M) P<-c(.4,.2) Idom.numASup.bnd.tri(P,1,Tr,M) Idom.numASup.bnd.tri(rbind(Xp,Xp),k=2,Tr,M) ## End(Not run)
k
being an upper bound for the domination number of Central Similarity Proximity
Catch Digraph (CS-PCD) by the exact algorithm - standard equilateral triangle caseReturns domination number of CS-PCD is less than or equal to
k
where the vertices of the CS-PCD are the data points
Xp
,
that is, returns 1 if the domination number of CS-PCD is less than the prespecified value k
, returns 0
otherwise. It also provides the vertices (i.e., data points) in a dominating set of size k
of CS-PCD.
CS proximity region is constructed with respect to the standard equilateral triangle with
expansion parameter
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
i.e., the center of mass of
(which is equivalent to the circumcenter of
).
Edges of ,
,
,
, are also labeled as 3, 1, and 2, respectively.
Loops are allowed in the digraph.
It takes a long time for large number of vertices (i.e., large number of row numbers).
See also (Ceyhan (2012)).
Idom.numCSup.bnd.std.tri(Xp, k, t, M = c(1, 1, 1))
Idom.numCSup.bnd.std.tri(Xp, k, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of CS-PCD. |
k |
A positive integer representing an upper bound for the domination number of CS-PCD. |
t |
A positive real number which serves as the expansion parameter in CS proximity region in the
standard equilateral triangle |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates
which serves as a center in the interior of the standard equilateral triangle |
A list
with two elements
domUB |
The upper bound |
Idom.num.up.bnd |
The indicator for the upper bound for domination number of CS-PCD being the
specified value |
ind.domset |
The vertices (i.e., data points) in the dominating set of size |
Elvan Ceyhan
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.
Idom.numCSup.bnd.tri
, Idom.num.up.bnd
, Idom.numASup.bnd.tri
,
and dom.num.exact
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-.5 Idom.numCSup.bnd.std.tri(Xp,1,t,M) for (k in 1:n) print(c(k,Idom.numCSup.bnd.std.tri(Xp,k,t,M)$Idom.num.up.bnd)) print(c(k,Idom.numCSup.bnd.std.tri(Xp,k,t,M)$domUB)) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-.5 Idom.numCSup.bnd.std.tri(Xp,1,t,M) for (k in 1:n) print(c(k,Idom.numCSup.bnd.std.tri(Xp,k,t,M)$Idom.num.up.bnd)) print(c(k,Idom.numCSup.bnd.std.tri(Xp,k,t,M)$domUB)) ## End(Not run)
Returns domination number of CS-PCD is less than or equal to
k
where the vertices of the CS-PCD are the data points
Xp
,
that is, returns 1 if the domination number of CS-PCD is less than the prespecified value k
, returns 0
otherwise. It also provides the vertices (i.e., data points) in a dominating set of size k
of CS-PCD.
CS proximity region is constructed with respect to the triangle tri
with
expansion parameter
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
tri
;
default is i.e., the center of mass of
tri
.
Edges of tri
, ,
,
, are also labeled as 3, 1, and 2, respectively.
Loops are allowed in the digraph.
See also (Ceyhan (2012)).
Caveat: It takes a long time for large number of vertices (i.e., large number of row numbers).
Idom.numCSup.bnd.tri(Xp, k, tri, t, M = c(1, 1, 1))
Idom.numCSup.bnd.tri(Xp, k, tri, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of CS-PCD. |
k |
A positive integer to be tested for an upper bound for the domination number of CS-PCDs. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region in the
triangle |
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 |
A list
with two elements
domUB |
The upper bound |
Idom.num.up.bnd |
The indicator for the upper bound for domination number of CS-PCD being the
specified value |
ind.domset |
The vertices (i.e., data points) in the dominating set of size |
Elvan Ceyhan
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.
Idom.numCSup.bnd.std.tri
, Idom.num.up.bnd
, Idom.numASup.bnd.tri
,
and dom.num.exact
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) t<-.5 Idom.numCSup.bnd.tri(Xp,1,Tr,t,M) for (k in 1:n) print(c(k,Idom.numCSup.bnd.tri(Xp,k,Tr,t,M))) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) t<-.5 Idom.numCSup.bnd.tri(Xp,1,Tr,t,M) for (k in 1:n) print(c(k,Idom.numCSup.bnd.tri(Xp,k,Tr,t,M))) ## End(Not run)
S
being a dominating set or not for Arc Slice Proximity
Catch Digraphs (AS-PCDs) - one triangle caseReturns S
a dominating set of AS-PCD, that is, returns 1 if
S
is a dominating set of AS-PCD,
returns 0 otherwise.
AS-PCD has vertex set Xp
and AS proximity region is constructed with vertex
regions based on the center M="CC"
for circumcenter of tri
;
or in Cartesian coordinates or
in barycentric coordinates in the
interior of the triangle
tri
; default is M="CC"
i.e., circumcenter of tri
whose vertices are also labeled as edges 1, 2, and 3, respectively.
See also (Ceyhan (2005, 2010)).
Idom.setAStri(S, Xp, tri, M = "CC")
Idom.setAStri(S, Xp, tri, M = "CC")
S |
A set of 2D points which is to be tested for being a dominating set for the AS-PCDs. |
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
S
a dominating set of AS-PCD, that is, returns 1 if
S
is a dominating set of AS-PCD whose
vertices are the data points in Xp
; returns 0 otherwise, where AS proximity region is constructed in
the triangle tri
.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
IarcASset2pnt.tri
, Idom.setPEtri
and Idom.setCStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) S<-rbind(Xp[1,],Xp[2,]) Idom.setAStri(S,Xp,Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setAStri(S,Xp,Tr,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) Idom.setAStri(S,Xp,Tr,M) Idom.setAStri(c(.2,.5),Xp,Tr,M) Idom.setAStri(c(.2,.5),c(.2,.5),Tr,M) Idom.setAStri(Xp[5,],Xp[2,],Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,],c(.2,.5)) Idom.setAStri(S,Xp[3,],Tr,M) Idom.setAStri(Xp,Xp,Tr,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] Idom.setAStri(Xp,P,Tr,M) Idom.setAStri(S,P,Tr,M) Idom.setAStri(S,Xp,Tr,M) Idom.setAStri(rbind(S,S),Xp,Tr,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) S<-rbind(Xp[1,],Xp[2,]) Idom.setAStri(S,Xp,Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setAStri(S,Xp,Tr,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) Idom.setAStri(S,Xp,Tr,M) Idom.setAStri(c(.2,.5),Xp,Tr,M) Idom.setAStri(c(.2,.5),c(.2,.5),Tr,M) Idom.setAStri(Xp[5,],Xp[2,],Tr,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,],c(.2,.5)) Idom.setAStri(S,Xp[3,],Tr,M) Idom.setAStri(Xp,Xp,Tr,M) P<-c(.4,.2) S<-Xp[c(1,3,4),] Idom.setAStri(Xp,P,Tr,M) Idom.setAStri(S,P,Tr,M) Idom.setAStri(S,Xp,Tr,M) Idom.setAStri(rbind(S,S),Xp,Tr,M) ## End(Not run)
S
being a dominating set or not for Central Similarity Proximity
Catch Digraphs (CS-PCDs) - standard equilateral triangle caseReturns S
a dominating set of the CS-PCD where the vertices of the CS-PCD are the data set
Xp
), that is,
returns 1 if S
is a dominating set of CS-PCD, returns 0 otherwise.
CS proximity region is constructed
with respect to the standard equilateral triangle with
expansion parameter
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
i.e., the center of mass of
(which is equivalent to the circumcenter of
).
Edges of ,
,
,
, are also labeled as 3, 1, and 2, respectively.
See also (Ceyhan (2012)).
Idom.setCSstd.tri(S, Xp, t, M = c(1, 1, 1))
Idom.setCSstd.tri(S, Xp, t, M = c(1, 1, 1))
S |
A set of 2D points which is to be tested for being a dominating set for the CS-PCDs. |
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
t |
A positive real number which serves as the expansion parameter in CS proximity region in the
standard equilateral triangle |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates
which serves as a center in the interior of the standard equilateral triangle |
S
a dominating set of the CS-PCD, that is, returns 1 if
S
is a dominating set of CS-PCD,
returns 0 otherwise, where CS proximity region is constructed in the standard equilateral triangle
Elvan Ceyhan
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.
Idom.setCStri
and Idom.setPEstd.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setCSstd.tri(S,Xp,t,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setCSstd.tri(S,Xp,t,M) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) t<-.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setCSstd.tri(S,Xp,t,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setCSstd.tri(S,Xp,t,M) ## End(Not run)
S
being a dominating set or not for Central Similarity Proximity
Catch Digraphs (CS-PCDs) - one triangle caseReturns S
a dominating set of CS-PCD whose vertices are the data set Xp
, that is,
returns 1 if
S
is a dominating set of CS-PCD, returns 0 otherwise.
CS proximity region is constructed with
respect to the triangle tri
with the expansion parameter and edge regions are based
on the center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the triangle
tri
; default is i.e., the center of mass of
tri
.
The triangle tri
has edges
,
,
which are also labeled as edges 3, 1, and 2, respectively.
See also (Ceyhan (2012)).
Idom.setCStri(S, Xp, tri, t, M = c(1, 1, 1))
Idom.setCStri(S, Xp, tri, t, M = c(1, 1, 1))
S |
A set of 2D points which is to be tested for being a dominating set for the CS-PCDs. |
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region
constructed in the triangle |
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 |
S
a dominating set of the CS-PCD, that is, returns 1 if
S
is a dominating set of CS-PCD whose
vertices are the data points in Xp
; returns 0 otherwise, where CS proximity region is constructed in
the triangle tri
Elvan Ceyhan
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.
Idom.setCSstd.tri
, Idom.setPEtri
and Idom.setAStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) tau<-.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setCStri(S,Xp,Tr,tau,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setCStri(S,Xp,Tr,tau,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) tau<-.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setCStri(S,Xp,Tr,tau,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setCStri(S,Xp,Tr,tau,M) ## End(Not run)
S
being a dominating set
or not for Proportional Edge Proximity Catch Digraphs (PE-PCDs) -
standard equilateral triangle caseReturns S
a dominating set of PE-PCD
whose vertices are the data points Xp
for
S
in the standard equilateral triangle,
that is,
returns 1 if S
is a dominating set of PE-PCD,
and returns 0 otherwise.
PE proximity region is constructed
with respect to the standard equilateral triangle
with
expansion parameter
and vertex regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
, i.e., the center of mass of
(which is also equivalent to the circumcenter of
).
Vertices of
are also labeled as 1, 2, and 3,
respectively.
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)).
Idom.setPEstd.tri(S, Xp, r, M = c(1, 1, 1))
Idom.setPEstd.tri(S, Xp, r, M = c(1, 1, 1))
S |
A set of 2D points whose PE proximity regions are considered. |
Xp |
A set of 2D points which constitutes the vertices of the PE-PCD. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region in the
standard equilateral triangle
|
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard equilateral triangle |
S
a dominating set of PE-PCD for
S
in the standard equilateral triangle,
that is, returns 1 if S
is a dominating set of PE-PCD,
and returns 0 otherwise,
where PE proximity region is constructed in the standard equilateral triangle .
Elvan Ceyhan
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.
Idom.setPEtri
and Idom.setCSstd.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setPEstd.tri(S,Xp,r,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,],c(.2,.5)) Idom.setPEstd.tri(S,Xp[3,],r,M) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setPEstd.tri(S,Xp,r,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,],c(.2,.5)) Idom.setPEstd.tri(S,Xp[3,],r,M) ## End(Not run)
S
being a dominating set
or not for Proportional Edge Proximity Catch Digraphs (PE-PCDs) -
one triangle caseReturns S
a dominating set of PE-PCD
whose vertices are the data set Xp
, that is,
returns 1 if
S
is a dominating set of PE-PCD,
and returns 0 otherwise.
PE proximity region is constructed with
respect to the triangle tri
with the expansion parameter and vertex regions are based
on the 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
.
The triangle tri
has edges
,
,
which are also labeled as edges 3, 1, and 2, respectively.
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)).
Idom.setPEtri(S, Xp, tri, r, M = c(1, 1, 1))
Idom.setPEtri(S, Xp, tri, r, M = c(1, 1, 1))
S |
A set of 2D points which is to be tested for being a dominating set for the PE-PCDs. |
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
tri |
A |
r |
A positive real number
which serves as the expansion parameter in PE proximity region
constructed in the triangle |
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 |
S
a dominating set of PE-PCD,
that is, returns 1 if
S
is a dominating set of PE-PCD whose
vertices are the data points in Xp
; and returns 0 otherwise,
where PE proximity region is constructed in
the triangle tri
.
Elvan Ceyhan
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.
Idom.setPEstd.tri
, IarcPEset2pnt.tri
,
Idom.setCStri
, and Idom.setAStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setPEtri(S,Xp,Tr,r,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setPEtri(S,Xp,Tr,r,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) Idom.setPEtri(S,Xp,Tr,r,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$gen.points M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) r<-1.5 S<-rbind(Xp[1,],Xp[2,]) Idom.setPEtri(S,Xp,Tr,r,M) S<-rbind(Xp[1,],Xp[2,],Xp[3,],Xp[5,]) Idom.setPEtri(S,Xp,Tr,r,M) S<-rbind(c(.1,.1),c(.3,.4),c(.5,.3)) Idom.setPEtri(S,Xp,Tr,r,M) ## End(Not run)
Checks if the point p
lies
in the circle with center cent
and radius rad
,
denoted as C(cent,rad)
.
So, it returns 1 or TRUE
if p
is
inside the circle, and 0 otherwise.
boundary
is a logical argument (default=FALSE
)
to include boundary or not, so if it is TRUE
,
the function checks if the point, p
,
lies in the closure of the circle (i.e., interior and
boundary combined) else it checks
if p
lies in the interior of the circle.
in.circle(p, cent, rad, boundary = TRUE)
in.circle(p, cent, rad, boundary = TRUE)
p |
A 2D point to be checked whether it is inside the circle or not. |
cent |
A 2D point in Cartesian coordinates which serves as the center of the circle. |
rad |
A positive real number which serves as the radius of the circle. |
boundary |
A logical parameter (default= |
Indicator for the point p
being
inside the circle or not, i.e., returns 1 or TRUE
if p
is inside the circle, and 0 otherwise.
Elvan Ceyhan
in.triangle
, in.tetrahedron
, and
on.convex.hull
from the interp
package
for documentation for in.convex.hull
## Not run: cent<-c(1,1); rad<-1; p<-c(1.4,1.2) #try also cent<-runif(2); rad<-runif(1); p<-runif(2); in.circle(p,cent,rad) p<-c(.4,-.2) in.circle(p,cent,rad) p<-c(1,0) in.circle(p,cent,rad) in.circle(p,cent,rad,boundary=FALSE) ## End(Not run)
## Not run: cent<-c(1,1); rad<-1; p<-c(1.4,1.2) #try also cent<-runif(2); rad<-runif(1); p<-runif(2); in.circle(p,cent,rad) p<-c(.4,-.2) in.circle(p,cent,rad) p<-c(1,0) in.circle(p,cent,rad) in.circle(p,cent,rad,boundary=FALSE) ## End(Not run)
Checks if the point p
lies
in the tetrahedron, th
,
using the barycentric coordinates, generally denoted as
.
If all (normalized or non-normalized) barycentric coordinates are positive
then the point
p
is inside the tetrahedron,
if all are nonnegative with one or more are zero,
then p
falls on the boundary.
If some of the barycentric coordinates are negative,
then p
falls outside the tetrahedron.
boundary
is a logical argument (default=FALSE
)
to include boundary or not, so if it is TRUE
,
the function checks if the point, p
,
lies in the closure of the tetrahedron (i.e., interior and boundary
combined) else it checks if p
lies
in the interior of the tetrahedron.
in.tetrahedron(p, th, boundary = TRUE)
in.tetrahedron(p, th, boundary = TRUE)
p |
A 3D point to be checked whether it is inside the tetrahedron or not. |
th |
A |
boundary |
A logical parameter (default= |
A list
with two elements
in.tetra |
A logical output, if the point, |
barycentric |
The barycentric coordinates of the point |
Elvan Ceyhan
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3); P<-c(.1,.1,.1) tetra<-rbind(A,B,C,D) in.tetrahedron(P,tetra,boundary = FALSE) in.tetrahedron(C,tetra) in.tetrahedron(C,tetra,boundary = FALSE) n1<-5; n2<-5; n<-n1+n2 Xp<-rbind(cbind(runif(n1),runif(n1,0,sqrt(3)/2),runif(n1,0,sqrt(6)/3)), runif.tetra(n2,tetra)$g) in.tetra<-vector() for (i in 1:n) {in.tetra<-c(in.tetra,in.tetrahedron(Xp[i,],tetra,boundary = TRUE)$in.tetra) } in.tetra dat.tet<-Xp[in.tetra,] if (is.vector(dat.tet)) {dat.tet<-matrix(dat.tet,nrow=1)} Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi=40,theta=40, bty = "g", pch = 20, cex = 1, ticktype="detailed",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05),zlim=Zlim+zd*c(-.05,.05)) #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) plot3D::points3D(dat.tet[,1],dat.tet[,2],dat.tet[,3],pch=4, add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) in.tetrahedron(P,tetra) #this works fine ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3); P<-c(.1,.1,.1) tetra<-rbind(A,B,C,D) in.tetrahedron(P,tetra,boundary = FALSE) in.tetrahedron(C,tetra) in.tetrahedron(C,tetra,boundary = FALSE) n1<-5; n2<-5; n<-n1+n2 Xp<-rbind(cbind(runif(n1),runif(n1,0,sqrt(3)/2),runif(n1,0,sqrt(6)/3)), runif.tetra(n2,tetra)$g) in.tetra<-vector() for (i in 1:n) {in.tetra<-c(in.tetra,in.tetrahedron(Xp[i,],tetra,boundary = TRUE)$in.tetra) } in.tetra dat.tet<-Xp[in.tetra,] if (is.vector(dat.tet)) {dat.tet<-matrix(dat.tet,nrow=1)} Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi=40,theta=40, bty = "g", pch = 20, cex = 1, ticktype="detailed",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05),zlim=Zlim+zd*c(-.05,.05)) #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) plot3D::points3D(dat.tet[,1],dat.tet[,2],dat.tet[,3],pch=4, add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) in.tetrahedron(P,tetra) #this works fine ## End(Not run)
Checks if all the data points in the 2D data set, Xp
,
lie in the triangle, tri
,
using the barycentric coordinates,
generally denoted as .
If all (normalized or non-normalized) barycentric coordinates of a point are positive then the point is inside the triangle, if all are nonnegative with one or more are zero, then the point falls in the boundary. If some of the barycentric coordinates are negative, then the point falls outside the triangle.
boundary
is a logical argument (default=TRUE
)
to include boundary or not, so if it is TRUE
,
the function checks if a point lies in the closure of the triangle
(i.e., interior and boundary combined);
else, it checks if the point lies in the interior of the triangle.
in.tri.all(Xp, tri, boundary = TRUE)
in.tri.all(Xp, tri, boundary = TRUE)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
boundary |
A logical parameter (default= |
A logical output,
if all data points in Xp
are inside the triangle, tri
,
the output is TRUE
,
else it is FALSE
.
Elvan Ceyhan
in.triangle
and on.convex.hull
from the interp
package for documentation for in.convex.hull
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); p<-c(1.4,1.2) Tr<-rbind(A,B,C) in.tri.all(p,Tr) #for the vertex A in.tri.all(A,Tr) in.tri.all(A,Tr,boundary = FALSE) #for a point on the edge AB D3<-(A+B)/2 in.tri.all(D3,Tr) in.tri.all(D3,Tr,boundary = FALSE) #data set n<-10 Xp<-cbind(runif(n),runif(n)) in.tri.all(Xp,Tr,boundary = TRUE) Xp<-runif.std.tri(n)$gen.points in.tri.all(Xp,Tr) in.tri.all(Xp,Tr,boundary = FALSE) Xp<-runif.tri(n,Tr)$g in.tri.all(Xp,Tr) in.tri.all(Xp,Tr,boundary = FALSE) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); p<-c(1.4,1.2) Tr<-rbind(A,B,C) in.tri.all(p,Tr) #for the vertex A in.tri.all(A,Tr) in.tri.all(A,Tr,boundary = FALSE) #for a point on the edge AB D3<-(A+B)/2 in.tri.all(D3,Tr) in.tri.all(D3,Tr,boundary = FALSE) #data set n<-10 Xp<-cbind(runif(n),runif(n)) in.tri.all(Xp,Tr,boundary = TRUE) Xp<-runif.std.tri(n)$gen.points in.tri.all(Xp,Tr) in.tri.all(Xp,Tr,boundary = FALSE) Xp<-runif.tri(n,Tr)$g in.tri.all(Xp,Tr) in.tri.all(Xp,Tr,boundary = FALSE) ## End(Not run)
Checks if the point p
lies in the triangle,
tri
, using the barycentric
coordinates, generally denoted as .
If all (normalized or non-normalized)
barycentric coordinates are positive then the point p
is
inside the triangle,
if all are nonnegative with one or more are zero,
then p
falls in the boundary. If some of the
barycentric coordinates are negative,
then p
falls outside the triangle.
boundary
is a logical argument (default=TRUE
)
to include boundary or not, so if it is TRUE
,
the function checks if the point, p
,
lies in the closure of the triangle (i.e., interior and boundary
combined); else, it checks if p
lies
in the interior of the triangle.
in.triangle(p, tri, boundary = TRUE)
in.triangle(p, tri, boundary = TRUE)
p |
A 2D point to be checked whether it is inside the triangle or not. |
tri |
A |
boundary |
A logical parameter (default= |
A list
with two elements
in.tri |
A logical output, it is |
barycentric |
The barycentric coordinates |
Elvan Ceyhan
in.tri.all
and on.convex.hull
from the interp
package for documentation for in.convex.hull
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); p<-c(1.4,1.2) Tr<-rbind(A,B,C) in.triangle(p,Tr) p<-c(.4,-.2) in.triangle(p,Tr) #for the vertex A in.triangle(A,Tr) in.triangle(A,Tr,boundary = FALSE) #for a point on the edge AB D3<-(A+B)/2 in.triangle(D3,Tr) in.triangle(D3,Tr,boundary = FALSE) #for a NA entry point p<-c(NA,.2) in.triangle(p,Tr) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); p<-c(1.4,1.2) Tr<-rbind(A,B,C) in.triangle(p,Tr) p<-c(.4,-.2) in.triangle(p,Tr) #for the vertex A in.triangle(A,Tr) in.triangle(A,Tr,boundary = FALSE) #for a point on the edge AB D3<-(A+B)/2 in.triangle(D3,Tr) in.triangle(D3,Tr,boundary = FALSE) #for a NA entry point p<-c(NA,.2) in.triangle(p,Tr) ## End(Not run)
Returns the incidence matrix for the AS-PCD whose vertices are a given 2D numerical data set, Xp
,
in the convex hull of Yp
which is partitioned by the Delaunay triangles based on Yp
points.
AS proximity regions are defined with respect to the Delaunay triangles based on Yp
points and vertex
regions are based on the center M="CC"
for circumcenter of each Delaunay triangle or in barycentric coordinates in the
interior of each Delaunay triangle; default is
M="CC"
i.e., circumcenter of each triangle.
Loops are allowed, so the diagonal entries are all equal to 1.
See (Ceyhan (2005, 2010)) for more on AS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
inci.matAS(Xp, Yp, M = "CC")
inci.matAS(Xp, Yp, M = "CC")
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
M |
The center of the triangle. |
Incidence matrix for the AS-PCD whose vertices are the 2D data set, Xp
,
and AS proximity regions are defined in the Delaunay triangles based on Yp
points.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
inci.matAStri
, inci.matPE
, and inci.matCS
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-"CC" #try also M<-c(1,1,1) IM<-inci.matAS(Xp,Yp,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) #this might take a long time for large nx IM<-inci.matAS(Xp,Yp[1:3,],M) inci.matAS(Xp,rbind(Yp,Yp)) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-"CC" #try also M<-c(1,1,1) IM<-inci.matAS(Xp,Yp,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) #this might take a long time for large nx IM<-inci.matAS(Xp,Yp[1:3,],M) inci.matAS(Xp,rbind(Yp,Yp)) ## End(Not run)
Returns the incidence matrix for the AS-PCD whose vertices are the given 2D numerical data set, Xp
.
AS proximity regions are defined with respect to the triangle tri
and
vertex regions based on the center
M="CC"
for circumcenter of tri
;
or in Cartesian coordinates or
in barycentric coordinates in the
interior of the triangle
tri
; default is M="CC"
i.e., circumcenter of tri
.
Loops are allowed, so the diagonal entries are all equal to 1.
See also (Ceyhan (2005, 2010)).
inci.matAStri(Xp, tri, M = "CC")
inci.matAStri(Xp, tri, M = "CC")
Xp |
A set of 2D points which constitute the vertices of AS-PCD. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
Incidence matrix for the AS-PCD whose vertices are 2D data set, Xp
,
and AS proximity regions are defined with respect to the triangle tri
and
vertex regions based on circumcenter.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
inci.matAS
, inci.matPEtri
, and inci.matCStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) IM<-IncMatAStri(Xp,Tr,M) IM dom.num.greedy(IM) dom.num.exact(IM) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) IM<-IncMatAStri(Xp,Tr,M) IM dom.num.greedy(IM) dom.num.exact(IM) ## End(Not run)
Returns the incidence matrix of Central Similarity Proximity Catch Digraph (CS-PCD) whose vertices are the
data points in Xp
in the multiple triangle case.
CS proximity regions are defined with respect to the
Delaunay triangles based on Yp
points with expansion parameter and edge regions in each triangle are
based on the center
in barycentric coordinates in the interior of each Delaunay
triangle (default for
which is the center of mass of the triangle).
Each Delaunay triangle is first converted to an (nonscaled) basic triangle so that
M
will be the same
type of center for each Delaunay triangle (this conversion is not necessary when M
is ).
Convex hull of Yp
is partitioned by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles whose union constitutes the
convex hull of Yp
points). For the incidence matrix loops are allowed,
so the diagonal entries are all equal to 1.
See (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)) for more on CS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
inci.matCS(Xp, Yp, t, M = c(1, 1, 1))
inci.matCS(Xp, Yp, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 3D point in barycentric coordinates which serves as a center in the interior of each Delaunay
triangle, default for |
Incidence matrix for the CS-PCD with vertices being 2D data set, Xp
.
CS proximity regions are constructed with respect to the Delaunay triangles and M
-edge regions.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
inci.matCStri
, inci.matCSstd.tri
, inci.matAS
,
and inci.matPE
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) t<-1.5 #try also t<-2 IM<-inci.matCS(Xp,Yp,t,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) #takes a very long time for large nx, try smaller nx Idom.num.up.bnd(IM,3) #takes a very long time for large nx, try smaller nx ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) t<-1.5 #try also t<-2 IM<-inci.matCS(Xp,Yp,t,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) #takes a very long time for large nx, try smaller nx Idom.num.up.bnd(IM,3) #takes a very long time for large nx, try smaller nx ## End(Not run)
Returns the incidence matrix for the CS-PCD for a given 1D numerical data set, Xp
,
as the vertices of the digraph and Yp
determines the end points of the intervals (in the multi-interval case).
Loops are allowed, so the diagonal entries are all equal to 1.
CS proximity region is constructed
with an expansion parameter and a centrality parameter
.
See also (Ceyhan (2016)).
inci.matCS1D(Xp, Yp, t, c = 0.5)
inci.matCS1D(Xp, Yp, t, c = 0.5)
Xp |
a set of 1D points which constitutes the vertices of the digraph. |
Yp |
a set of 1D points which constitutes the end points of the intervals that partition the real line. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
Incidence matrix for the CS-PCD with vertices being 1D data set, Xp
,
and Yp
determines the end points of the intervals (the multi-interval case)
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
inci.matCS1D
, inci.matPEtri
, and inci.matPE
t<-2 c<-.4 a<-0; b<-10; nx<-10; ny<-4 set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) IM<-inci.matCS1D(Xp,Yp,t,c) IM dom.num.greedy(IM) dom.num.exact(IM) #might take a long time depending on nx Idom.num.up.bnd(IM,5) Arcs<-arcsCS1D(Xp,Yp,t,c) Arcs summary(Arcs) plot(Arcs) inci.matCS1D(Xp,Yp+10,t,c) t<-2 c<-.4 a<-0; b<-10; #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; Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) inci.matCS1D(Xp,Yp,t,c)
t<-2 c<-.4 a<-0; b<-10; nx<-10; ny<-4 set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) IM<-inci.matCS1D(Xp,Yp,t,c) IM dom.num.greedy(IM) dom.num.exact(IM) #might take a long time depending on nx Idom.num.up.bnd(IM,5) Arcs<-arcsCS1D(Xp,Yp,t,c) Arcs summary(Arcs) plot(Arcs) inci.matCS1D(Xp,Yp+10,t,c) t<-2 c<-.4 a<-0; b<-10; #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; Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) inci.matCS1D(Xp,Yp,t,c)
Returns the incidence matrix for the CS-PCD for a given 1D numerical data set, Xp
,
as the vertices of the digraph and int
determines the end points of the interval (in the one interval case).
Loops are allowed, so the diagonal entries are all equal to 1.
CS proximity region is constructed
with an expansion parameter and a centrality parameter
.
See also (Ceyhan (2016)).
inci.matCSint(Xp, int, t, c = 0.5)
inci.matCSint(Xp, int, t, c = 0.5)
Xp |
a set of 1D points which constitutes the vertices of the digraph. |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
Incidence matrix for the CS-PCD with vertices being 1D data set, Xp
,
and int
determines the end points of the intervals (in the one interval case)
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
inci.matCS1D
, inci.matPE1D
,
inci.matPEtri
, and inci.matPE
## Not run: c<-.4 t<-1 a<-0; b<-10; int<-c(a,b) xf<-(int[2]-int[1])*.1 set.seed(123) n<-10 Xp<-runif(n,a-xf,b+xf) IM<-inci.matCSint(Xp,int,t,c) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,3) dom.num.exact(IM) inci.matCSint(Xp,int+10,t,c) ## End(Not run)
## Not run: c<-.4 t<-1 a<-0; b<-10; int<-c(a,b) xf<-(int[2]-int[1])*.1 set.seed(123) n<-10 Xp<-runif(n,a-xf,b+xf) IM<-inci.matCSint(Xp,int,t,c) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,3) dom.num.exact(IM) inci.matCSint(Xp,int+10,t,c) ## End(Not run)
Returns the incidence matrix for the CS-PCD whose vertices are the given 2D numerical data set, Xp
,
in the standard equilateral triangle .
CS proximity region is defined with respect to the standard equilateral triangle
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
i.e., the center of mass of
.
Loops are allowed, so the diagonal entries are all equal to 1.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
inci.matCSstd.tri(Xp, t, M = c(1, 1, 1))
inci.matCSstd.tri(Xp, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates.
which serves as a center in the interior of the standard equilateral triangle |
Incidence matrix for the CS-PCD with vertices being 2D data set, Xp
and CS proximity
regions are defined in the standard equilateral triangle with
M
-edge regions.
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
inci.matCStri
, inci.matCS
and inci.matPEstd.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) inc.mat<-inci.matCSstd.tri(Xp,t=1.25,M) inc.mat sum(inc.mat)-n num.arcsCSstd.tri(Xp,t=1.25) dom.num.greedy(inc.mat) #try also dom.num.exact(inc.mat) #might take a long time for large n Idom.num.up.bnd(inc.mat,1) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) inc.mat<-inci.matCSstd.tri(Xp,t=1.25,M) inc.mat sum(inc.mat)-n num.arcsCSstd.tri(Xp,t=1.25) dom.num.greedy(inc.mat) #try also dom.num.exact(inc.mat) #might take a long time for large n Idom.num.up.bnd(inc.mat,1) ## End(Not run)
Returns the incidence matrix for the CS-PCD whose vertices are the given 2D numerical data set, Xp
,
in the triangle tri
.
CS proximity regions are constructed with respect to triangle tri
with expansion parameter and edge regions are based on the center
in Cartesian coordinates
or
in barycentric coordinates in the interior of the triangle
tri
;
default is i.e., the center of mass of
tri
.
Loops are allowed, so the diagonal entries are all equal to 1.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
inci.matCStri(Xp, tri, t, M = c(1, 1, 1))
inci.matCStri(Xp, tri, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of CS-PCD. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
Incidence matrix for the CS-PCD with vertices being 2D data set, Xp
,
in the triangle tri
with edge regions based on center M
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
inci.matCS
, inci.matPEtri
, and inci.matAStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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) IM<-inci.matCStri(Xp,Tr,t=1.25,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) Idom.num.up.bnd(IM,3) inci.matCStri(Xp,Tr,t=1.5,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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) IM<-inci.matCStri(Xp,Tr,t=1.25,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) Idom.num.up.bnd(IM,3) inci.matCStri(Xp,Tr,t=1.5,M) ## End(Not run)
Returns the incidence matrix of
Proportional Edge Proximity Catch Digraph (PE-PCD)
whose vertices are the data points in Xp
in the multiple triangle case.
PE proximity regions are
defined with respect to the Delaunay triangles
based on Yp
points with expansion parameter and
vertex regions in each triangle are
based on the center
in barycentric coordinates
in the interior of each Delaunay triangle
or based on circumcenter of each Delaunay triangle
(default for
which is the center of mass of the triangle).
Each Delaunay triangle is first converted to
an (nonscaled) basic triangle so that M
will be the same
type of center for each Delaunay triangle
(this conversion is not necessary when M
is ).
Convex hull of Yp
is partitioned
by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles
whose union constitutes the
convex hull of Yp
points).
For the incidence matrix loops are allowed,
so the diagonal entries are all equal to 1.
See (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)) for more on the PE-PCDs. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
inci.matPE(Xp, Yp, r, M = c(1, 1, 1))
inci.matPE(Xp, Yp, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 3D point in barycentric coordinates
which serves as a center in the interior of each Delaunay
triangle or circumcenter of each Delaunay triangle
(for this, argument should be set as |
Incidence matrix for the PE-PCD
with vertices being 2D data set, Xp
.
PE proximity regions are constructed
with respect to the Delaunay triangles and M
-vertex regions.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
inci.matPEtri
, inci.matPEstd.tri
,
inci.matAS
, and inci.matCS
## Not run: nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 IM<-inci.matPE(Xp,Yp,r,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) #might take a long time in this brute-force fashion ignoring the #disconnected nature of the digraph inherent by the geometric construction of it ## End(Not run)
## Not run: nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 IM<-inci.matPE(Xp,Yp,r,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) #might take a long time in this brute-force fashion ignoring the #disconnected nature of the digraph inherent by the geometric construction of it ## End(Not run)
Returns the incidence matrix for the PE-PCD for a given 1D numerical data set, Xp
,
as the vertices of the digraph and Yp
determines the end points of the intervals (in the multi-interval case).
Loops are allowed, so the diagonal entries are all equal to 1.
PE proximity region is constructed
with an expansion parameter and a centrality parameter
.
See also (Ceyhan (2012)).
inci.matPE1D(Xp, Yp, r, c = 0.5)
inci.matPE1D(Xp, Yp, r, c = 0.5)
Xp |
a set of 1D points which constitutes the vertices of the digraph. |
Yp |
a set of 1D points which constitutes the end points of the intervals that partition the real line. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
Incidence matrix for the PE-PCD with vertices being 1D data set, Xp
,
and Yp
determines the end points of the intervals (in the multi-interval case)
Elvan Ceyhan
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.
inci.matCS1D
, inci.matPEtri
, and inci.matPE
## Not run: r<-2 c<-.4 a<-0; b<-10; nx<-10; ny<-4 set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) IM<-inci.matPE1D(Xp,Yp,r,c) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,6) dom.num.exact(IM) ## End(Not run)
## Not run: r<-2 c<-.4 a<-0; b<-10; nx<-10; ny<-4 set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) IM<-inci.matPE1D(Xp,Yp,r,c) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,6) dom.num.exact(IM) ## End(Not run)
Returns the incidence matrix for the PE-PCD for a given 1D numerical data set, Xp
,
as the vertices of the digraph and int
determines the end points of the interval (in the one interval case).
Loops are allowed, so the diagonal entries are all equal to 1.
PE proximity region is constructed
with an expansion parameter and a centrality parameter
.
See also (Ceyhan (2012)).
inci.matPEint(Xp, int, r, c = 0.5)
inci.matPEint(Xp, int, r, c = 0.5)
Xp |
a set of 1D points which constitutes the vertices of the digraph. |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
Incidence matrix for the PE-PCD with vertices being 1D data set, Xp
,
and int
determines the end points of the intervals (in the one interval case)
Elvan Ceyhan
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.
inci.matCSint
, inci.matPE1D
, inci.matPEtri
, and inci.matPE
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) xf<-(int[2]-int[1])*.1 set.seed(123) n<-10 Xp<-runif(n,a-xf,b+xf) IM<-inci.matPEint(Xp,int,r,c) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,6) dom.num.exact(IM) inci.matPEint(Xp,int+10,r,c) ## End(Not run)
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) xf<-(int[2]-int[1])*.1 set.seed(123) n<-10 Xp<-runif(n,a-xf,b+xf) IM<-inci.matPEint(Xp,int,r,c) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,6) dom.num.exact(IM) inci.matPEint(Xp,int+10,r,c) ## End(Not run)
Returns the incidence matrix for the PE-PCD
whose vertices are the given 2D numerical data set, Xp
,
in the standard equilateral triangle
.
PE proximity region is constructed
with respect to the standard equilateral triangle with
expansion parameter
and vertex regions are based on
the center
in Cartesian coordinates
or
in barycentric coordinates
in the interior of
; default is
,
i.e., the center of mass of
.
Loops are allowed,
so the diagonal entries are all equal to 1.
See also (Ceyhan (2005, 2010)).
inci.matPEstd.tri(Xp, r, M = c(1, 1, 1))
inci.matPEstd.tri(Xp, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
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 standard equilateral triangle |
Incidence matrix for the PE-PCD with vertices
being 2D data set, Xp
in the standard equilateral triangle where PE proximity
regions are defined with M
-vertex regions.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
inci.matPEtri
, inci.matPE
,
and inci.matCSstd.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) inc.mat<-inci.matPEstd.tri(Xp,r=1.25,M) inc.mat sum(inc.mat)-n num.arcsPEstd.tri(Xp,r=1.25) dom.num.greedy(inc.mat) Idom.num.up.bnd(inc.mat,2) #try also dom.num.exact(inc.mat) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-10 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) inc.mat<-inci.matPEstd.tri(Xp,r=1.25,M) inc.mat sum(inc.mat)-n num.arcsPEstd.tri(Xp,r=1.25) dom.num.greedy(inc.mat) Idom.num.up.bnd(inc.mat,2) #try also dom.num.exact(inc.mat) ## End(Not run)
Returns the incidence matrix for the PE-PCD whose vertices are the given 3D numerical data set, Xp
,
in the tetrahedron .
PE proximity regions are constructed with respect to tetrahedron
th
with expansion parameter and vertex regions are based on the center
M
which is circumcenter ("CC"
)
or center of mass ("CM"
) of th
with default="CM"
.
Loops are allowed, so the diagonal entries are all equal to 1.
See also (Ceyhan (2005, 2010)).
inci.matPEtetra(Xp, th, r, M = "CM")
inci.matPEtetra(Xp, th, r, M = "CM")
Xp |
A set of 3D points which constitute the vertices of PE-PCD. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
Incidence matrix for the PE-PCD with vertices being 3D data set, Xp
,
in the tetrahedron th
with vertex regions based on circumcenter or center of mass
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
inci.matPEtri
, inci.matPE1D
, and inci.matPE
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 Xp<-runif.tetra(n,tetra)$g #try also Xp<-c(.5,.5,.5) M<-"CM" #try also M<-"CC" r<-1.5 IM<-inci.matPEtetra(Xp,tetra,r=1.25) #uses the default M="CM" IM<-inci.matPEtetra(Xp,tetra,r=1.25,M) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,3) #try also dom.num.exact(IM) #this might take a long time for large n ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-5 Xp<-runif.tetra(n,tetra)$g #try also Xp<-c(.5,.5,.5) M<-"CM" #try also M<-"CC" r<-1.5 IM<-inci.matPEtetra(Xp,tetra,r=1.25) #uses the default M="CM" IM<-inci.matPEtetra(Xp,tetra,r=1.25,M) IM dom.num.greedy(IM) Idom.num.up.bnd(IM,3) #try also dom.num.exact(IM) #this might take a long time for large n ## End(Not run)
Returns the incidence matrix for the PE-PCD
whose vertices are the given 2D numerical data set, Xp
,
in the triangle tri
.
PE proximity regions are constructed with respect to triangle tri
with expansion parameter
and vertex regions are based on the center
in Cartesian coordinates
or
in barycentric coordinates
in the interior of the triangle
tri
;
default is , i.e., the center of mass of
tri
.
Loops are allowed, so the diagonal entries are all equal to 1.
See also (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)).
inci.matPEtri(Xp, tri, r, M = c(1, 1, 1))
inci.matPEtri(Xp, tri, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of 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 |
Incidence matrix for the PE-PCD
with vertices being 2D data set, Xp
,
in the triangle tri
with vertex regions based on center M
Elvan Ceyhan
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
inci.matPE
, inci.matCStri
,
and inci.matAStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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) IM<-inci.matPEtri(Xp,Tr,r=1.25,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) Idom.num.up.bnd(IM,3) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 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) IM<-inci.matPEtri(Xp,Tr,r=1.25,M) IM dom.num.greedy(IM) #try also dom.num.exact(IM) Idom.num.up.bnd(IM,3) ## End(Not run)
Returns the region index of the point p
for the 6 regions in standard equilateral triangle
,
starting with 1 on the first one-sixth of the triangle,
and numbering follows the counter-clockwise direction
(see the plot in the examples).
These regions are in the inner hexagon
which is the Gamma-1 region for CS-PCD with
if
p
is not in any of the 6 regions the function returns NA
.
index.six.Te(p)
index.six.Te(p)
p |
A 2D point whose index for the 6 regions
in standard equilateral triangle |
rel An integer between 1-6 (inclusive) or NA
Elvan Ceyhan
## Not run: P<-c(.4,.2) index.six.Te(P) A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) h1<-c(1/2,sqrt(3)/18); h2<-c(2/3, sqrt(3)/9); h3<-c(2/3, 2*sqrt(3)/9); h4<-c(1/2, 5*sqrt(3)/18); h5<-c(1/3, 2*sqrt(3)/9); h6<-c(1/3, sqrt(3)/9); r1<-(h1+h6+CM)/3;r2<-(h1+h2+CM)/3;r3<-(h2+h3+CM)/3; r4<-(h3+h4+CM)/3;r5<-(h4+h5+CM)/3;r6<-(h5+h6+CM)/3; Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) polygon(rbind(h1,h2,h3,h4,h5,h6)) txt<-rbind(h1,h2,h3,h4,h5,h6) xc<-txt[,1]+c(-.02,.02,.02,0,0,0) yc<-txt[,2]+c(.02,.02,.02,0,0,0) txt.str<-c("h1","h2","h3","h4","h5","h6") text(xc,yc,txt.str) txt<-rbind(Te,CM,r1,r2,r3,r4,r5,r6) xc<-txt[,1]+c(-.02,.02,.02,0,0,0,0,0,0,0) yc<-txt[,2]+c(.02,.02,.02,0,0,0,0,0,0,0) txt.str<-c("A","B","C","CM","1","2","3","4","5","6") text(xc,yc,txt.str) n<-10 #try also n<-40 Xp<-runif.std.tri(n)$gen.points Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] rsix<-vector() for (i in 1:n) rsix<-c(rsix,index.six.Te(Xp[i,])) rsix plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".") L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) polygon(rbind(h1,h2,h3,h4,h5,h6)) text(Xp,labels=factor(rsix)) txt<-rbind(Te,CM) xc<-txt[,1]+c(-.02,.02,.02,0) yc<-txt[,2]+c(.02,.02,.02,-.05) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) ## End(Not run)
## Not run: P<-c(.4,.2) index.six.Te(P) A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) h1<-c(1/2,sqrt(3)/18); h2<-c(2/3, sqrt(3)/9); h3<-c(2/3, 2*sqrt(3)/9); h4<-c(1/2, 5*sqrt(3)/18); h5<-c(1/3, 2*sqrt(3)/9); h6<-c(1/3, sqrt(3)/9); r1<-(h1+h6+CM)/3;r2<-(h1+h2+CM)/3;r3<-(h2+h3+CM)/3; r4<-(h3+h4+CM)/3;r5<-(h4+h5+CM)/3;r6<-(h5+h6+CM)/3; Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) polygon(rbind(h1,h2,h3,h4,h5,h6)) txt<-rbind(h1,h2,h3,h4,h5,h6) xc<-txt[,1]+c(-.02,.02,.02,0,0,0) yc<-txt[,2]+c(.02,.02,.02,0,0,0) txt.str<-c("h1","h2","h3","h4","h5","h6") text(xc,yc,txt.str) txt<-rbind(Te,CM,r1,r2,r3,r4,r5,r6) xc<-txt[,1]+c(-.02,.02,.02,0,0,0,0,0,0,0) yc<-txt[,2]+c(.02,.02,.02,0,0,0,0,0,0,0) txt.str<-c("A","B","C","CM","1","2","3","4","5","6") text(xc,yc,txt.str) n<-10 #try also n<-40 Xp<-runif.std.tri(n)$gen.points Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] rsix<-vector() for (i in 1:n) rsix<-c(rsix,index.six.Te(Xp[i,])) rsix plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".") L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) polygon(rbind(h1,h2,h3,h4,h5,h6)) text(Xp,labels=factor(rsix)) txt<-rbind(Te,CM) xc<-txt[,1]+c(-.02,.02,.02,0) yc<-txt[,2]+c(.02,.02,.02,-.05) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) ## End(Not run)
Returns the intersection point(s) of a line and a circle. The line is determined by the two points
p1
and p2
and the circle is centered at point cent
and has radius rad
.
If the circle does not intersect the line, the function yields NULL
;
if the circle intersects at only one point, it yields only that point;
otherwise it yields both intersection points as output.
When there are two intersection points, they are listed in the order of the -coordinates of
p1
and p2
;
and if the -coordinates of
p1
and p2
are equal, intersection points are listed in the order of
-coordinates of
p1
and p2
.
intersect.line.circle(p1, p2, cent, rad)
intersect.line.circle(p1, p2, cent, rad)
p1 , p2
|
2D points that determine the straight line (i.e., through which the straight line passes). |
cent |
A 2D point representing the center of the circle. |
rad |
A positive real number representing the radius of the circle. |
point(s) of intersection between the circle and the line (if they do not intersect, the function
yields NULL
as the output)
Elvan Ceyhan
## Not run: P1<-c(.3,.2)*100 P2<-c(.6,.3)*100 cent<-c(1.1,1.1)*100 rad<-2*100 intersect.line.circle(P1,P2,cent,rad) intersect.line.circle(P2,P1,cent,rad) intersect.line.circle(P1,P1+c(0,1),cent,rad) intersect.line.circle(P1+c(0,1),P1,cent,rad) dist.point2line(cent,P1,P2) rad2<-dist.point2line(cent,P1,P2)$d intersect.line.circle(P1,P2,cent,rad2) intersect.line.circle(P1,P2,cent,rad=.8) intersect.line.circle(P1,P2,cent,rad=.78) #plot of the line and the circle A<-c(.3,.2); B<-c(.6,.3); cent<-c(1,1); rad<-2 #check dist.point2line(cent,A,B)$dis, .3 IPs<-intersect.line.circle(A,B,cent,rad) xr<-range(A[1],B[1],cent[1]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-rad-xf,xr[2]+rad+xf,l=20) #try also l=100 lnAB<-Line(A,B,x) y<-lnAB$y Xlim<-range(x,cent[1]) Ylim<-range(y,A[2],B[2],cent[2]-rad,cent[2]+rad) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(A,B,cent),pch=1,asp=1,xlab="x",ylab="y", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) lines(x,y,lty=1) interp::circles(cent[1],cent[2],rad) IP.txt<-c() if (!is.null(IPs)) { for (i in 1:(length(IPs)/2)) IP.txt<-c(IP.txt,paste("I",i, sep = "")) } txt<-rbind(A,B,cent,IPs) text(txt+cbind(rep(xd*.03,nrow(txt)),rep(-yd*.03,nrow(txt))),c("A","B","M",IP.txt)) ## End(Not run)
## Not run: P1<-c(.3,.2)*100 P2<-c(.6,.3)*100 cent<-c(1.1,1.1)*100 rad<-2*100 intersect.line.circle(P1,P2,cent,rad) intersect.line.circle(P2,P1,cent,rad) intersect.line.circle(P1,P1+c(0,1),cent,rad) intersect.line.circle(P1+c(0,1),P1,cent,rad) dist.point2line(cent,P1,P2) rad2<-dist.point2line(cent,P1,P2)$d intersect.line.circle(P1,P2,cent,rad2) intersect.line.circle(P1,P2,cent,rad=.8) intersect.line.circle(P1,P2,cent,rad=.78) #plot of the line and the circle A<-c(.3,.2); B<-c(.6,.3); cent<-c(1,1); rad<-2 #check dist.point2line(cent,A,B)$dis, .3 IPs<-intersect.line.circle(A,B,cent,rad) xr<-range(A[1],B[1],cent[1]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-rad-xf,xr[2]+rad+xf,l=20) #try also l=100 lnAB<-Line(A,B,x) y<-lnAB$y Xlim<-range(x,cent[1]) Ylim<-range(y,A[2],B[2],cent[2]-rad,cent[2]+rad) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(A,B,cent),pch=1,asp=1,xlab="x",ylab="y", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) lines(x,y,lty=1) interp::circles(cent[1],cent[2],rad) IP.txt<-c() if (!is.null(IPs)) { for (i in 1:(length(IPs)/2)) IP.txt<-c(IP.txt,paste("I",i, sep = "")) } txt<-rbind(A,B,cent,IPs) text(txt+cbind(rep(xd*.03,nrow(txt)),rep(-yd*.03,nrow(txt))),c("A","B","M",IP.txt)) ## End(Not run)
Returns the point of the intersection of the line
determined by the 3D points and
and the plane spanned
by 3D points
p3
, p4
, and p5
.
intersect.line.plane(p1, p2, p3, p4, p5)
intersect.line.plane(p1, p2, p3, p4, p5)
p1 , p2
|
3D points that determine the straight line (i.e., through which the straight line passes). |
p3 , p4 , p5
|
3D points that determine the plane (i.e., through which the plane passes). |
The coordinates of the point of intersection the line
determined by the 3D points and
and the
plane determined by 3D points
p3
, p4
, and p5
.
Elvan Ceyhan
intersect2lines
and intersect.line.circle
## Not run: L1<-c(2,4,6); L2<-c(1,3,5); A<-c(1,10,3); B<-c(1,1,3); C<-c(3,9,12) Pint<-intersect.line.plane(L1,L2,A,B,C) Pint pts<-rbind(L1,L2,A,B,C,Pint) tr<-max(Dist(L1,L2),Dist(L1,Pint),Dist(L2,Pint)) tf<-tr*1.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf,tf,l=5) #try also l=10, 20, or 100 lnAB3D<-Line3D(L1,L2,tsq) xl<-lnAB3D$x yl<-lnAB3D$y zl<-lnAB3D$z xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate xp<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 yp<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plABC<-Plane(A,B,C,xp,yp) z.grid<-plABC$z res<-persp(xp,yp,z.grid, xlab="x",ylab="y",zlab="z",theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") lines (trans3d(xl, yl, zl, pmat = res), col = 3) Xlim<-range(xl,pts[,1]) Ylim<-range(yl,pts[,2]) Zlim<-range(zl,pts[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::persp3D(z = z.grid, x = xp, y = yp, theta =225, phi = 30, ticktype = "detailed" ,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),zlim=Zlim+zd*c(-.1,.1), expand = 0.7, facets = FALSE, scale = TRUE) #plane spanned by points A, B, C #add the defining points plot3D::points3D(pts[,1],pts[,2],pts[,3], pch = ".", col = "black", bty = "f", cex = 5,add=TRUE) plot3D::points3D(Pint[1],Pint[2],Pint[3], pch = "*", col = "red", bty = "f", cex = 5,add=TRUE) plot3D::lines3D(xl, yl, zl, bty = "g", cex = 2, ticktype = "detailed",add=TRUE) ## End(Not run)
## Not run: L1<-c(2,4,6); L2<-c(1,3,5); A<-c(1,10,3); B<-c(1,1,3); C<-c(3,9,12) Pint<-intersect.line.plane(L1,L2,A,B,C) Pint pts<-rbind(L1,L2,A,B,C,Pint) tr<-max(Dist(L1,L2),Dist(L1,Pint),Dist(L2,Pint)) tf<-tr*1.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf,tf,l=5) #try also l=10, 20, or 100 lnAB3D<-Line3D(L1,L2,tsq) xl<-lnAB3D$x yl<-lnAB3D$y zl<-lnAB3D$z xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate xp<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 yp<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plABC<-Plane(A,B,C,xp,yp) z.grid<-plABC$z res<-persp(xp,yp,z.grid, xlab="x",ylab="y",zlab="z",theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") lines (trans3d(xl, yl, zl, pmat = res), col = 3) Xlim<-range(xl,pts[,1]) Ylim<-range(yl,pts[,2]) Zlim<-range(zl,pts[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::persp3D(z = z.grid, x = xp, y = yp, theta =225, phi = 30, ticktype = "detailed" ,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),zlim=Zlim+zd*c(-.1,.1), expand = 0.7, facets = FALSE, scale = TRUE) #plane spanned by points A, B, C #add the defining points plot3D::points3D(pts[,1],pts[,2],pts[,3], pch = ".", col = "black", bty = "f", cex = 5,add=TRUE) plot3D::points3D(Pint[1],Pint[2],Pint[3], pch = "*", col = "red", bty = "f", cex = 5,add=TRUE) plot3D::lines3D(xl, yl, zl, bty = "g", cex = 2, ticktype = "detailed",add=TRUE) ## End(Not run)
Returns the intersection of two lines,
first line passing through points p1
and q1
and second line passing through points p2
and q2
.
The points are chosen so that lines are well
defined.
intersect2lines(p1, q1, p2, q2)
intersect2lines(p1, q1, p2, q2)
p1 , q1
|
2D points that determine the first straight line (i.e., through which the first straight line passes). |
p2 , q2
|
2D points that determine the second straight line (i.e., through which the second straight line passes). |
The coordinates of the point of intersection of the two lines,
first passing through points p1
and q1
and second passing through points p2
and q2
.
Elvan Ceyhan
intersect.line.circle
and dist.point2line
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75); C<-c(0,6); D<-c(3,-2) ip<-intersect2lines(A,B,C,D) ip pts<-rbind(A,B,C,D,ip) xr<-range(pts[,1]) xf<-abs(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 lnAB<-Line(A,B,x) lnCD<-Line(C,D,x) y1<-lnAB$y y2<-lnCD$y Xlim<-range(x,pts) Ylim<-range(y1,y2,pts) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 #plot of the line joining A and B plot(rbind(A,B,C,D),pch=1,xlab="x",ylab="y", main="Point of Intersection of Two Lines", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) lines(x,y1,lty=1,col=1) lines(x,y2,lty=1,col=2) text(rbind(A+pf,B+pf),c("A","B")) text(rbind(C+pf,D+pf),c("C","D")) text(rbind(ip+pf),c("intersection\n point")) ## End(Not run)
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75); C<-c(0,6); D<-c(3,-2) ip<-intersect2lines(A,B,C,D) ip pts<-rbind(A,B,C,D,ip) xr<-range(pts[,1]) xf<-abs(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 lnAB<-Line(A,B,x) lnCD<-Line(C,D,x) y1<-lnAB$y y2<-lnCD$y Xlim<-range(x,pts) Ylim<-range(y1,y2,pts) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 #plot of the line joining A and B plot(rbind(A,B,C,D),pch=1,xlab="x",ylab="y", main="Point of Intersection of Two Lines", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) lines(x,y1,lty=1,col=1) lines(x,y2,lty=1,col=2) text(rbind(A+pf,B+pf),c("A","B")) text(rbind(C+pf,D+pf),c("C","D")) text(rbind(ip+pf),c("intersection\n point")) ## End(Not run)
Returns the indices of intervals for all the points in 1D data set, Xp
, as a vector.
Intervals are based on Yp
and left end interval is labeled as 1, the next interval as 2, and so on.
interval.indices.set(Xp, Yp)
interval.indices.set(Xp, Yp)
Xp |
A set of 1D points for which the indices of intervals are to be determined. |
Yp |
A set of 1D points from which intervals are constructed. |
The vector
of indices of the intervals in which points in the 1D data set, Xp
, reside
Elvan Ceyhan
## Not run: a<-0; b<-10; int<-c(a,b) #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; 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) #try also Yp<-runif(ny,a+1,b-1) ind<-interval.indices.set(Xp,Yp) ind jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) text(Xp,yjit,labels=factor(ind)) ## End(Not run)
## Not run: a<-0; b<-10; int<-c(a,b) #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; 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) #try also Yp<-runif(ny,a+1,b-1) ind<-interval.indices.set(Xp,Yp) ind jit<-.1 yjit<-runif(nx,-jit,jit) Xlim<-range(a,b,Xp,Yp) xd<-Xlim[2]-Xlim[1] plot(cbind(a,0), xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".") abline(h=0) points(Xp, yjit,pch=".",cex=3) abline(v=Yp,lty=2) text(Xp,yjit,labels=factor(ind)) ## End(Not run)
returns TRUE
if the point p
of any dimension is inside the data set Xp
of the same dimension as p
;
otherwise returns FALSE
.
is.in.data(p, Xp)
is.in.data(p, Xp)
p |
A 2D point for which the function checks membership to the data set |
Xp |
A set of 2D points representing the set of data points. |
TRUE
if p
belongs to the data set Xp
.
Elvan Ceyhan
## Not run: n<-10 Xp<-cbind(runif(n),runif(n)) P<-Xp[7,] is.in.data(P,Xp) is.in.data(P,Xp[7,]) P<-Xp[7,]+10^(-7) is.in.data(P,Xp) P<-Xp[7,]+10^(-9) is.in.data(P,Xp) is.in.data(P,P) is.in.data(c(2,2),c(2,2)) #for 1D data n<-10 Xp<-runif(n) P<-Xp[7] is.in.data(P,Xp[7]) #this works because both entries are treated as 1D vectors but #is.in.data(P,Xp) does not work since entries are treated as vectors of different dimensions Xp<-as.matrix(Xp) is.in.data(P,Xp) #this works, because P is a 1D point, and Xp is treated as a set of 10 1D points P<-Xp[7]+10^(-7) is.in.data(P,Xp) P<-Xp[7]+10^(-9) is.in.data(P,Xp) is.in.data(P,P) #for 3D data n<-10 Xp<-cbind(runif(n),runif(n),runif(n)) P<-Xp[7,] is.in.data(P,Xp) is.in.data(P,Xp[7,]) P<-Xp[7,]+10^(-7) is.in.data(P,Xp) P<-Xp[7,]+10^(-9) is.in.data(P,Xp) is.in.data(P,P) n<-10 Xp<-cbind(runif(n),runif(n)) P<-Xp[7,] is.in.data(P,Xp) ## End(Not run)
## Not run: n<-10 Xp<-cbind(runif(n),runif(n)) P<-Xp[7,] is.in.data(P,Xp) is.in.data(P,Xp[7,]) P<-Xp[7,]+10^(-7) is.in.data(P,Xp) P<-Xp[7,]+10^(-9) is.in.data(P,Xp) is.in.data(P,P) is.in.data(c(2,2),c(2,2)) #for 1D data n<-10 Xp<-runif(n) P<-Xp[7] is.in.data(P,Xp[7]) #this works because both entries are treated as 1D vectors but #is.in.data(P,Xp) does not work since entries are treated as vectors of different dimensions Xp<-as.matrix(Xp) is.in.data(P,Xp) #this works, because P is a 1D point, and Xp is treated as a set of 10 1D points P<-Xp[7]+10^(-7) is.in.data(P,Xp) P<-Xp[7]+10^(-9) is.in.data(P,Xp) is.in.data(P,P) #for 3D data n<-10 Xp<-cbind(runif(n),runif(n),runif(n)) P<-Xp[7,] is.in.data(P,Xp) is.in.data(P,Xp[7,]) P<-Xp[7,]+10^(-7) is.in.data(P,Xp) P<-Xp[7,]+10^(-9) is.in.data(P,Xp) is.in.data(P,P) n<-10 Xp<-cbind(runif(n),runif(n)) P<-Xp[7,] is.in.data(P,Xp) ## End(Not run)
Returns TRUE
if the argument p
is a numeric
point of dimension dim
(default is dim=2
); otherwise returns FALSE
.
is.point(p, dim = 2)
is.point(p, dim = 2)
p |
A |
dim |
A positive integer
representing the dimension of the argument |
TRUE
if p
is a vector
of dimension dim
.
Elvan Ceyhan
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75,4) is.point(A) is.point(A,1) is.point(B) is.point(B,3) ## End(Not run)
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75,4) is.point(A) is.point(A,1) is.point(B) is.point(B,3) ## End(Not run)
Checks whether the triangle, tri
,
is the standard equilateral triangle
or not.
is.std.eq.tri(tri)
is.std.eq.tri(tri)
tri |
A |
TRUE
if tri
is a standard equilateral triangle,
else FALSE
.
Elvan Ceyhan
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) #try adding +10^(-16) to each vertex is.std.eq.tri(Te) is.std.eq.tri(rbind(B,C,A)) Tr<-rbind(A,B,-C) is.std.eq.tri(Tr) A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); is.std.eq.tri(Tr) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) #try adding +10^(-16) to each vertex is.std.eq.tri(Te) is.std.eq.tri(rbind(B,C,A)) Tr<-rbind(A,B,-C) is.std.eq.tri(Tr) A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); is.std.eq.tri(Tr) ## End(Not run)
k
furthest points in a data set from vertices
in each
-vertex region in a triangleAn object of class "Extrema"
.
Returns the k
furthest data points among the data set, Xp
,
in each -vertex region from the vertex in the
triangle,
tri
, vertices are stacked row-wise.
Vertex region labels/numbers correspond to the
row number of the vertex in
tri
.
ch.all.intri
is for checking
whether all data points are inside tri
(default is FALSE
).
If some of the data points are not inside tri
and ch.all.intri=TRUE
, then the function yields
an error message.
If some of the data points are not inside tri
and ch.all.intri=FALSE
, then the function yields
the closest points to edges
among the data points inside tri
(yields NA
if there are no data points
inside tri
).
In the extrema, , in the output,
the first
k
entries are the k
furthest points from vertex 1,
second k
entries are k
furthest points are from vertex 2, and
last k
entries are the k
furthest points from vertex 3.
If data size does not allow, NA
's are inserted
for some or all of the k
furthest points for each vertex.
kfr2vertsCCvert.reg(Xp, tri, k, ch.all.intri = FALSE)
kfr2vertsCCvert.reg(Xp, tri, k, ch.all.intri = FALSE)
Xp |
A set of 2D points representing the set of data points. |
tri |
A |
k |
A positive integer. |
ch.all.intri |
A logical argument (default= |
A list
with the elements
txt1 |
Vertex labels are |
txt2 |
A shorter description of the distances
as |
type |
Type of the extrema points |
desc |
A short description of the extrema points |
mtitle |
The |
ext |
The extrema points, here, |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, it is |
cent |
The center point used for construction of vertex regions |
ncent |
Name of the center, |
regions |
Vertex regions inside the triangle, |
region.names |
Names of the vertex regions
as |
region.centers |
Centers of mass of the vertex regions
inside |
dist2ref |
Distances from |
Elvan Ceyhan
fr2vertsCCvert.reg.basic.tri
, fr2vertsCCvert.reg.basic.tri
,
fr2vertsCCvert.reg
, and fr2edgesCMedge.reg.std.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 #try also n<-20 k<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g Ext<-kfr2vertsCCvert.reg(Xp,Tr,k) Ext summary(Ext) plot(Ext) Xp2<-rbind(Xp,c(.2,.4)) kfr2vertsCCvert.reg(Xp2,Tr,k) #try also kfr2vertsCCvert.reg(Xp2,Tr,k,ch.all.intri = TRUE) kf2v<-Ext CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main=paste(k," Furthest Points in CC-Vertex Regions \n from the Vertices",sep=""), xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(kf2v$ext,pch=4,col=2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.06,.08,.05,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.04,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 #try also n<-20 k<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g Ext<-kfr2vertsCCvert.reg(Xp,Tr,k) Ext summary(Ext) plot(Ext) Xp2<-rbind(Xp,c(.2,.4)) kfr2vertsCCvert.reg(Xp2,Tr,k) #try also kfr2vertsCCvert.reg(Xp2,Tr,k,ch.all.intri = TRUE) kf2v<-Ext CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="", main=paste(k," Furthest Points in CC-Vertex Regions \n from the Vertices",sep=""), xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) points(Xp) points(kf2v$ext,pch=4,col=2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.06,.08,.05,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.04,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
a
and b
An object of class "Lines"
.
Returns the equation, slope, intercept
,
and -coordinates of the line crossing two
distinct 2D points
a
and b
with -coordinates provided in
vector
x
.
This function is different from the line
function
in the standard stats
package
in R
in the sense that Line(a,b,x)
fits the line passing
through points a
and b
and returns various quantities (see below) for this line and x
is
the -coordinates of the points
we want to find on the
Line(a,b,x)
while line(a,b)
fits the line robustly
whose -coordinates are in
a
and -coordinates are in
b
.
Line(a,b,x)
and line(x,Line(A,B,x)$y)
would yield the same straight line
(i.e., the line with the same coefficients.)
Line(a, b, x)
Line(a, b, x)
a , b
|
2D points that determine the straight line (i.e., through which the straight line passes). |
x |
A scalar or a |
A list
with the elements
desc |
A description of the line |
mtitle |
The |
points |
The input points |
x |
The input scalar or |
y |
The output scalar or |
slope |
Slope of the line, |
intercept |
Intercept of the line
passing through points |
equation |
Equation of the line
passing through points |
Elvan Ceyhan
slope
, paraline
,
perpline
, line
in the generic stats
package and and Line3D
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 lnAB<-Line(A,B,x) lnAB summary(lnAB) plot(lnAB) line(A,B) #this takes vector A as the x points and vector B as the y points and fits the line #for example, try x=runif(100); y=x+(runif(100,-.05,.05)) plot(x,y) line(x,y) x<-lnAB$x y<-lnAB$y Xlim<-range(x,A,B) if (!is.na(y[1])) {Ylim<-range(y,A,B)} else {Ylim<-range(A,B)} xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 #plot of the line joining A and B plot(rbind(A,B),pch=1,xlab="x",ylab="y", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) if (!is.na(y[1])) {lines(x,y,lty=1)} else {abline(v=A[1])} text(rbind(A+pf,B+pf),c("A","B")) int<-round(lnAB$intercep,2) #intercept sl<-round(lnAB$slope,2) #slope text(rbind((A+B)/2+pf*3),ifelse(is.na(int),paste("x=",A[1]), ifelse(sl==0,paste("y=",int), ifelse(sl==1,ifelse(sign(int)<0,paste("y=x",int),paste("y=x+",int)), ifelse(sign(int)<0,paste("y=",sl,"x",int),paste("y=",sl,"x+",int)))))) ## End(Not run)
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 lnAB<-Line(A,B,x) lnAB summary(lnAB) plot(lnAB) line(A,B) #this takes vector A as the x points and vector B as the y points and fits the line #for example, try x=runif(100); y=x+(runif(100,-.05,.05)) plot(x,y) line(x,y) x<-lnAB$x y<-lnAB$y Xlim<-range(x,A,B) if (!is.na(y[1])) {Ylim<-range(y,A,B)} else {Ylim<-range(A,B)} xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 #plot of the line joining A and B plot(rbind(A,B),pch=1,xlab="x",ylab="y", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) if (!is.na(y[1])) {lines(x,y,lty=1)} else {abline(v=A[1])} text(rbind(A+pf,B+pf),c("A","B")) int<-round(lnAB$intercep,2) #intercept sl<-round(lnAB$slope,2) #slope text(rbind((A+B)/2+pf*3),ifelse(is.na(int),paste("x=",A[1]), ifelse(sl==0,paste("y=",int), ifelse(sl==1,ifelse(sign(int)<0,paste("y=x",int),paste("y=x+",int)), ifelse(sign(int)<0,paste("y=",sl,"x",int),paste("y=",sl,"x+",int)))))) ## End(Not run)
p
in the direction of vector
v
(or if v
is a point,
in direction of
)An object of class "Lines3D"
.
Returns the equation, -,
-,
and
-coordinates of the line crossing 3D point
in the direction of
vector
v
(of if v
is a point, in the direction of )
with the parameter
t
being provided in vector
t
.
Line3D(p, v, t, dir.vec = TRUE)
Line3D(p, v, t, dir.vec = TRUE)
p |
A 3D point through which the straight line passes. |
v |
A 3D |
t |
A scalar or a |
dir.vec |
A logical argument about |
A list
with the elements
desc |
A description of the line |
mtitle |
The |
pts |
The input points that determine a line and/or a plane,
|
pnames |
The names of the input points
that determine a line and/or a plane,
|
vecs |
The point |
vec.names |
The names of the point |
x , y , z
|
The |
tsq |
The scalar or the |
equation |
Equation of the line passing through point |
Elvan Ceyhan
line
, paraline3D
,
and Plane
## Not run: A<-c(1,10,3); B<-c(1,1,3); vecs<-rbind(A,B) Line3D(A,B,.1) Line3D(A,B,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=5) #try also l=10, 20, or 100 lnAB3D<-Line3D(A,B,tsq) #try also lnAB3D<-Line3D(A,B,tsq,dir.vec=FALSE) lnAB3D summary(lnAB3D) plot(lnAB3D) x<-lnAB3D$x y<-lnAB3D$y z<-lnAB3D$z zr<-range(z) zf<-(zr[2]-zr[1])*.2 Bv<-B*tf*5 Xlim<-range(x) Ylim<-range(y) Zlim<-range(z) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] Dr<-A+min(tsq)*B plot3D::lines3D(x, y, z, phi = 0, bty = "g", main="Line Crossing A \n in the Direction of OB", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.1,.1), pch = 20, cex = 2, ticktype = "detailed") plot3D::arrows3D(Dr[1],Dr[2],Dr[3]+zf,Dr[1]+Bv[1], Dr[2]+Bv[2],Dr[3]+zf+Bv[3], add=TRUE) plot3D::points3D(A[1],A[2],A[3],add=TRUE) plot3D::arrows3D(A[1],A[2],A[3]-2*zf,A[1],A[2],A[3],lty=2, add=TRUE) plot3D::text3D(A[1],A[2],A[3]-2*zf,labels="initial point",add=TRUE) plot3D::text3D(A[1],A[2],A[3]+zf/2,labels=expression(r[0]),add=TRUE) plot3D::arrows3D(Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2,Dr[3]+3*zf+Bv[3]/2, Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2,Dr[3]+zf+Bv[3]/2,lty=2, add=TRUE) plot3D::text3D(Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2,Dr[3]+3*zf+Bv[3]/2, labels="direction vector",add=TRUE) plot3D::text3D(Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2, Dr[3]+zf+Bv[3]/2,labels="v",add=TRUE) plot3D::text3D(0,0,0,labels="O",add=TRUE) ## End(Not run)
## Not run: A<-c(1,10,3); B<-c(1,1,3); vecs<-rbind(A,B) Line3D(A,B,.1) Line3D(A,B,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=5) #try also l=10, 20, or 100 lnAB3D<-Line3D(A,B,tsq) #try also lnAB3D<-Line3D(A,B,tsq,dir.vec=FALSE) lnAB3D summary(lnAB3D) plot(lnAB3D) x<-lnAB3D$x y<-lnAB3D$y z<-lnAB3D$z zr<-range(z) zf<-(zr[2]-zr[1])*.2 Bv<-B*tf*5 Xlim<-range(x) Ylim<-range(y) Zlim<-range(z) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] Dr<-A+min(tsq)*B plot3D::lines3D(x, y, z, phi = 0, bty = "g", main="Line Crossing A \n in the Direction of OB", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.1,.1), pch = 20, cex = 2, ticktype = "detailed") plot3D::arrows3D(Dr[1],Dr[2],Dr[3]+zf,Dr[1]+Bv[1], Dr[2]+Bv[2],Dr[3]+zf+Bv[3], add=TRUE) plot3D::points3D(A[1],A[2],A[3],add=TRUE) plot3D::arrows3D(A[1],A[2],A[3]-2*zf,A[1],A[2],A[3],lty=2, add=TRUE) plot3D::text3D(A[1],A[2],A[3]-2*zf,labels="initial point",add=TRUE) plot3D::text3D(A[1],A[2],A[3]+zf/2,labels=expression(r[0]),add=TRUE) plot3D::arrows3D(Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2,Dr[3]+3*zf+Bv[3]/2, Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2,Dr[3]+zf+Bv[3]/2,lty=2, add=TRUE) plot3D::text3D(Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2,Dr[3]+3*zf+Bv[3]/2, labels="direction vector",add=TRUE) plot3D::text3D(Dr[1]+Bv[1]/2,Dr[2]+Bv[2]/2, Dr[3]+zf+Bv[3]/2,labels="v",add=TRUE) plot3D::text3D(0,0,0,labels="O",add=TRUE) ## End(Not run)
Returns the end points of the line segments and arc-slices that constitute the boundary of
AS proximity region for a point in the standard basic triangle
where
is in
,
and
.
Vertex regions are based on the center M="CC"
for circumcenter of ; or
in Cartesian
coordinates or
in barycentric coordinates in the interior of
;
default is
M="CC"
the circumcenter of .
rv
is the index of the vertex region p
resides, with default=NULL
.
If p
is outside , it returns
NULL
for the proximity region.
dec
is the number of decimals (default is 4) to round the barycentric coordinates when checking whether
the end points fall on the boundary of the triangle or not (so as not to miss the intersection points
due to precision in the decimals).
Any given triangle can be mapped to the standard basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence standard basic triangle is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010)).
NASbasic.tri(p, c1, c2, M = "CC", rv = NULL, dec = 4)
NASbasic.tri(p, c1, c2, M = "CC", rv = NULL, dec = 4)
p |
A 2D point whose AS proximity region is to be computed. |
c1 , c2
|
Positive real numbers representing the top vertex in standard basic triangle |
M |
The center of the triangle. |
rv |
The index of the |
dec |
a positive integer the number of decimals (default is 4) to round the barycentric coordinates when checking whether
the end points fall on the boundary of the triangle |
A list
with the elements
L , R
|
The end points of the line segments on the boundary of the AS proximity region.
Each row in |
Arc.Slices |
The end points of the arc-slices on the circular parts of the AS proximity region. Here points in row 1 and row 2 constitute the end points of one arc-slice, points on row 3 and row 4 constitute the end points for the next arc-slice and so on. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
## Not run: c1<-.4; c2<-.6 #try also c1<-.2; c2<-.2; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) set.seed(1) M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) P1<-as.numeric(runif.basic.tri(1,c1,c2)$g); #try also P1<-c(.3,.2) NASbasic.tri(P1,c1,c2) #default with M="CC" NASbasic.tri(P1,c1,c2,M) #or try Rv<-rel.vert.basic.triCC(P1,c1,c2)$rv NASbasic.tri(P1,c1,c2,M,Rv) NASbasic.tri(c(3,5),c1,c2,M) P2<-c(.5,.4) NASbasic.tri(P2,c1,c2,M) P3<-c(1.5,.4) NASbasic.tri(P3,c1,c2,M) if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates #plot of the NAS region P1<-as.numeric(runif.basic.tri(1,c1,c2)$g); CC<-circumcenter.basic.tri(c1,c2) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" rv<-rel.vert.basic.triCC(P1,c1,c2)$rv } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges.basic.tri(c1,c2,M) rv<-rel.vert.basic.tri(P1,c1,c2,M)$rv } RV<-Tb[rv,] rad<-Dist(P1,RV) Int.Pts<-NASbasic.tri(P1,c1,c2,M) Xlim<-range(Tb[,1],P1[1]+rad,P1[1]-rad) Ylim<-range(Tb[,2],P1[2]+rad,P1[2]-rad) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(rbind(Tb,P1,rbind(Int.Pts$L,Int.Pts$R))) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) interp::circles(P1[1],P1[2],rad,lty=2) L<-Int.Pts$L; R<-Int.Pts$R segments(L[,1], L[,2], R[,1], R[,2], lty=1,col=2) Arcs<-Int.Pts$a; if (!is.null(Arcs)) { K<-nrow(Arcs)/2 for (i in 1:K) {A1<-Arcs[2*i-1,]; A2<-Arcs[2*i,]; angles<-angle.str2end(A1,P1,A2)$c plotrix::draw.arc(P1[1],P1[2],rad,angle1=angles[1],angle2=angles[2],col=2) } } #proximity region with the triangle (i.e., for labeling the vertices of the NAS) IP.txt<-intpts<-c() if (!is.null(Int.Pts$a)) { intpts<-unique(round(Int.Pts$a,7)) #this part is for labeling the intersection points of the spherical for (i in 1:(length(intpts)/2)) IP.txt<-c(IP.txt,paste("I",i+1, sep = "")) } txt<-rbind(Tb,P1,cent,intpts) txt.str<-c("A","B","C","P1",cent.name,IP.txt) text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.03,nrow(txt))),txt.str) c1<-.4; c2<-.6; P1<-c(.3,.2) NASbasic.tri(P1,c1,c2,M) ## End(Not run)
## Not run: c1<-.4; c2<-.6 #try also c1<-.2; c2<-.2; A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C) set.seed(1) M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) P1<-as.numeric(runif.basic.tri(1,c1,c2)$g); #try also P1<-c(.3,.2) NASbasic.tri(P1,c1,c2) #default with M="CC" NASbasic.tri(P1,c1,c2,M) #or try Rv<-rel.vert.basic.triCC(P1,c1,c2)$rv NASbasic.tri(P1,c1,c2,M,Rv) NASbasic.tri(c(3,5),c1,c2,M) P2<-c(.5,.4) NASbasic.tri(P2,c1,c2,M) P3<-c(1.5,.4) NASbasic.tri(P3,c1,c2,M) if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates #plot of the NAS region P1<-as.numeric(runif.basic.tri(1,c1,c2)$g); CC<-circumcenter.basic.tri(c1,c2) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" rv<-rel.vert.basic.triCC(P1,c1,c2)$rv } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges.basic.tri(c1,c2,M) rv<-rel.vert.basic.tri(P1,c1,c2,M)$rv } RV<-Tb[rv,] rad<-Dist(P1,RV) Int.Pts<-NASbasic.tri(P1,c1,c2,M) Xlim<-range(Tb[,1],P1[1]+rad,P1[1]-rad) Ylim<-range(Tb[,2],P1[2]+rad,P1[2]-rad) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(rbind(Tb,P1,rbind(Int.Pts$L,Int.Pts$R))) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) interp::circles(P1[1],P1[2],rad,lty=2) L<-Int.Pts$L; R<-Int.Pts$R segments(L[,1], L[,2], R[,1], R[,2], lty=1,col=2) Arcs<-Int.Pts$a; if (!is.null(Arcs)) { K<-nrow(Arcs)/2 for (i in 1:K) {A1<-Arcs[2*i-1,]; A2<-Arcs[2*i,]; angles<-angle.str2end(A1,P1,A2)$c plotrix::draw.arc(P1[1],P1[2],rad,angle1=angles[1],angle2=angles[2],col=2) } } #proximity region with the triangle (i.e., for labeling the vertices of the NAS) IP.txt<-intpts<-c() if (!is.null(Int.Pts$a)) { intpts<-unique(round(Int.Pts$a,7)) #this part is for labeling the intersection points of the spherical for (i in 1:(length(intpts)/2)) IP.txt<-c(IP.txt,paste("I",i+1, sep = "")) } txt<-rbind(Tb,P1,cent,intpts) txt.str<-c("A","B","C","P1",cent.name,IP.txt) text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.03,nrow(txt))),txt.str) c1<-.4; c2<-.6; P1<-c(.3,.2) NASbasic.tri(P1,c1,c2,M) ## End(Not run)
Returns the end points of the line segments and arc-slices that constitute the boundary of AS proximity
region for a point in the triangle tri
(rv=1,rv=2,rv=3)
.
Vertex regions are based on the center M="CC"
for circumcenter of tri
; or in Cartesian coordinates
or
in barycentric coordinates in the interior of the triangle
tri
;
default is M="CC"
the circumcenter of tri
. rv
is the index of the vertex region p1
resides,
with default=NULL
.
If p
is outside of tri
, it returns NULL
for the proximity region.
dec
is the number of decimals (default is 4) to round the barycentric coordinates when checking the points
fall on the boundary of the triangle tri
or not (so as not to miss the intersection points due to precision
in the decimals).
See also (Ceyhan (2005, 2010)).
NAStri(p, tri, M = "CC", rv = NULL, dec = 4)
NAStri(p, tri, M = "CC", rv = NULL, dec = 4)
p |
A 2D point whose AS proximity region is to be computed. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
rv |
Index of the |
dec |
a positive integer the number of decimals (default is 4) to round the
barycentric coordinates when checking whether
the end points fall on the boundary of the triangle |
A list
with the elements
L , R
|
End points of the line segments on the boundary of the AS proximity region.
Each row in |
arc.slices |
The end points of the arc-slices on the circular parts of the AS proximity region. Here points in rows 1 and 2 constitute the end points of the first arc-slice, points on rows 3 and 4 constitute the end points for the next arc-slice and so on. |
Angles |
The angles (in radians) between the vectors joining arc slice end points to the point |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
NASbasic.tri
, NPEtri
, NCStri
and IarcAStri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(.6,.2) P1<-as.numeric(runif.tri(1,Tr)$g) #try also P1<-c(1.3,1.2) NAStri(P1,Tr,M) #or try Rv<-rel.vert.triCC(P1,Tr)$rv NAStri(P1,Tr,M,Rv) NAStri(c(3,5),Tr,M) P2<-c(1.5,1.4) NAStri(P2,Tr,M) P3<-c(1.5,.4) NAStri(P3,Tr,M) if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates CC<-circumcenter.tri(Tr) #the circumcenter if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" rv<-rel.vert.triCC(P1,Tr)$rv } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) rv<-rel.vert.tri(P1,Tr,M)$rv } RV<-Tr[rv,] rad<-Dist(P1,RV) Int.Pts<-NAStri(P1,Tr,M) #plot of the NAS region Xlim<-range(Tr[,1],P1[1]+rad,P1[1]-rad) Ylim<-range(Tr[,2],P1[2]+rad,P1[2]-rad) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) #asp=1 must be the case to have the arc properly placed in the figure polygon(Tr) points(rbind(Tr,P1,rbind(Int.Pts$L,Int.Pts$R))) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) interp::circles(P1[1],P1[2],rad,lty=2) L<-Int.Pts$L; R<-Int.Pts$R segments(L[,1], L[,2], R[,1], R[,2], lty=1,col=2) Arcs<-Int.Pts$a; if (!is.null(Arcs)) { K<-nrow(Arcs)/2 for (i in 1:K) {A1<-Int.Pts$arc[2*i-1,]; A2<-Int.Pts$arc[2*i,]; angles<-angle.str2end(A1,P1,A2)$c test.ang1<-angles[1]+(.01)*(angles[2]-angles[1]) test.Pnt<-P1+rad*c(cos(test.ang1),sin(test.ang1)) if (!in.triangle(test.Pnt,Tr,boundary = TRUE)$i) {angles<-c(min(angles),max(angles)-2*pi)} plotrix::draw.arc(P1[1],P1[2],rad,angle1=angles[1],angle2=angles[2],col=2) } } #proximity region with the triangle (i.e., for labeling the vertices of the NAS) IP.txt<-intpts<-c() if (!is.null(Int.Pts$a)) { intpts<-unique(round(Int.Pts$a,7)) #this part is for labeling the intersection points of the spherical for (i in 1:(length(intpts)/2)) IP.txt<-c(IP.txt,paste("I",i+1, sep = "")) } txt<-rbind(Tr,P1,cent,intpts) txt.str<-c("A","B","C","P1",cent.name,IP.txt) text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.03,nrow(txt))),txt.str) P1<-c(.3,.2) NAStri(P1,Tr,M) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(.6,.2) P1<-as.numeric(runif.tri(1,Tr)$g) #try also P1<-c(1.3,1.2) NAStri(P1,Tr,M) #or try Rv<-rel.vert.triCC(P1,Tr)$rv NAStri(P1,Tr,M,Rv) NAStri(c(3,5),Tr,M) P2<-c(1.5,1.4) NAStri(P2,Tr,M) P3<-c(1.5,.4) NAStri(P3,Tr,M) if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates CC<-circumcenter.tri(Tr) #the circumcenter if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" rv<-rel.vert.triCC(P1,Tr)$rv } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) rv<-rel.vert.tri(P1,Tr,M)$rv } RV<-Tr[rv,] rad<-Dist(P1,RV) Int.Pts<-NAStri(P1,Tr,M) #plot of the NAS region Xlim<-range(Tr[,1],P1[1]+rad,P1[1]-rad) Ylim<-range(Tr[,2],P1[2]+rad,P1[2]-rad) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",asp=1,xlab="",ylab="",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) #asp=1 must be the case to have the arc properly placed in the figure polygon(Tr) points(rbind(Tr,P1,rbind(Int.Pts$L,Int.Pts$R))) L<-rbind(cent,cent,cent); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) interp::circles(P1[1],P1[2],rad,lty=2) L<-Int.Pts$L; R<-Int.Pts$R segments(L[,1], L[,2], R[,1], R[,2], lty=1,col=2) Arcs<-Int.Pts$a; if (!is.null(Arcs)) { K<-nrow(Arcs)/2 for (i in 1:K) {A1<-Int.Pts$arc[2*i-1,]; A2<-Int.Pts$arc[2*i,]; angles<-angle.str2end(A1,P1,A2)$c test.ang1<-angles[1]+(.01)*(angles[2]-angles[1]) test.Pnt<-P1+rad*c(cos(test.ang1),sin(test.ang1)) if (!in.triangle(test.Pnt,Tr,boundary = TRUE)$i) {angles<-c(min(angles),max(angles)-2*pi)} plotrix::draw.arc(P1[1],P1[2],rad,angle1=angles[1],angle2=angles[2],col=2) } } #proximity region with the triangle (i.e., for labeling the vertices of the NAS) IP.txt<-intpts<-c() if (!is.null(Int.Pts$a)) { intpts<-unique(round(Int.Pts$a,7)) #this part is for labeling the intersection points of the spherical for (i in 1:(length(intpts)/2)) IP.txt<-c(IP.txt,paste("I",i+1, sep = "")) } txt<-rbind(Tr,P1,cent,intpts) txt.str<-c("A","B","C","P1",cent.name,IP.txt) text(txt+cbind(rep(xd*.02,nrow(txt)),rep(-xd*.03,nrow(txt))),txt.str) P1<-c(.3,.2) NAStri(P1,Tr,M) ## End(Not run)
Returns the end points of the interval which constitutes the CS proximity region for a point in the
interval int
(rv=1,rv=2)
.
CS proximity region is constructed with respect to the interval int
with expansion parameter and centrality parameter
.
Vertex regions are based on the (parameterized) center, ,
which is
for the interval,
int
.
The CS proximity region is constructed whether
x
is inside or outside the interval int
.
See also (Ceyhan (2016)).
NCSint(x, int, t, c = 0.5)
NCSint(x, int, t, c = 0.5)
x |
A 1D point for which CS proximity region is constructed. |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
The interval which constitutes the CS proximity region for the point x
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) NCSint(7,int,t,c) NCSint(17,int,t,c) NCSint(1,int,t,c) NCSint(-1,int,t,c) NCSint(3,int,t,c) NCSint(4,int,t,c) NCSint(a,int,t,c)
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) NCSint(7,int,t,c) NCSint(17,int,t,c) NCSint(1,int,t,c) NCSint(-1,int,t,c) NCSint(3,int,t,c) NCSint(4,int,t,c) NCSint(a,int,t,c)
Returns the vertices of the CS proximity region (which is itself a triangle) for a point in the
triangle tri
(rv=1,rv=2,rv=3)
.
CS proximity region is defined with respect to the triangle tri
with expansion parameter and edge regions based on center
in Cartesian coordinates or
in barycentric coordinates in the interior of the triangle
tri
;
default is i.e., the center of mass of
tri
.
Edge regions are labeled as 1,2,3
rowwise for the corresponding vertices
of the triangle tri
. re
is the index of the edge region p
resides, with default=NULL
.
If p
is outside of tri
, it returns NULL
for the proximity region.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
NCStri(p, tri, t, M = c(1, 1, 1), re = NULL)
NCStri(p, tri, t, M = c(1, 1, 1), re = NULL)
p |
A 2D point whose CS proximity region is to be computed. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
re |
Index of the |
Vertices of the triangular region which constitutes the CS proximity region with expansion parameter
and center
M
for a point p
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); tau<-1.5 M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) n<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g NCStri(Xp[1,],Tr,tau,M) P1<-as.numeric(runif.tri(1,Tr)$g) #try also P1<-c(.4,.2) NCStri(P1,Tr,tau,M) #or try re<-rel.edges.tri(P1,Tr,M)$re NCStri(P1,Tr,tau,M,re) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); tau<-1.5 M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) n<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g NCStri(Xp[1,],Tr,tau,M) P1<-as.numeric(runif.tri(1,Tr)$g) #try also P1<-c(.4,.2) NCStri(P1,Tr,tau,M) #or try re<-rel.edges.tri(P1,Tr,M)$re NCStri(P1,Tr,tau,M,re) ## End(Not run)
Returns the vertices of the PE proximity region
(which is itself a triangle) for a point in the
standard basic triangle
(rv=1,rv=2,rv=3)
.
PE proximity region is defined with respect
to the standard basic triangle
with expansion parameter
and vertex regions based on center
in
Cartesian coordinates or
in barycentric coordinates in the interior of the basic
triangle
or based on the circumcenter of
;
default is
, i.e., the center of mass of
.
Vertex regions are labeled as rowwise for the vertices
of the triangle
.
rv
is the index of the vertex region
p
resides, with default=NULL
.
If p
is outside of tri
,
it returns NULL
for the proximity region.
See also (Ceyhan (2005, 2010)).
NPEbasic.tri(p, r, c1, c2, M = c(1, 1, 1), rv = NULL)
NPEbasic.tri(p, r, c1, c2, M = c(1, 1, 1), rv = NULL)
p |
A 2D point whose PE proximity region is to be computed. |
r |
A positive real number which serves
as the expansion parameter in PE proximity region;
must be |
c1 , c2
|
Positive real numbers
representing the top vertex in standard basic triangle
|
M |
A 2D point in Cartesian coordinates or a 3D point
in barycentric coordinates
which serves as a center
in the interior of the standard basic triangle |
rv |
Index of the |
Vertices of the triangular region
which constitutes the PE proximity region with expansion parameter
r and center M
for a point p
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
NPEtri
, NAStri
, NCStri
,
and IarcPEbasic.tri
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) r<-2 P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also P1<-c(.4,.2) NPEbasic.tri(P1,r,c1,c2,M) #or try Rv<-rel.vert.basic.tri(P1,c1,c2,M)$rv NPEbasic.tri(P1,r,c1,c2,M,Rv) P1<-c(1.4,1.2) P2<-c(1.5,1.26) NPEbasic.tri(P1,r,c1,c2,M) #gives an error if M=c(1.3,1.3) #since center is not the circumcenter or not in the interior of the triangle ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) r<-2 P1<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also P1<-c(.4,.2) NPEbasic.tri(P1,r,c1,c2,M) #or try Rv<-rel.vert.basic.tri(P1,c1,c2,M)$rv NPEbasic.tri(P1,r,c1,c2,M,Rv) P1<-c(1.4,1.2) P2<-c(1.5,1.26) NPEbasic.tri(P1,r,c1,c2,M) #gives an error if M=c(1.3,1.3) #since center is not the circumcenter or not in the interior of the triangle ## End(Not run)
Returns the end points of the interval which constitutes the PE proximity region for a point in the
interval int
(rv=1,rv=2)
. PE proximity region is constructed with respect to the interval int
with expansion parameter and centrality parameter
.
Vertex regions are based on the (parameterized) center, ,
which is
for the interval,
int
.
The PE proximity region is constructed whether
x
is inside or outside the interval int
.
See also (Ceyhan (2012)).
NPEint(x, int, r, c = 0.5)
NPEint(x, int, r, c = 0.5)
x |
A 1D point for which PE proximity region is constructed. |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
The interval which constitutes the PE proximity region for the point x
Elvan Ceyhan
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.
c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) NPEint(7,int,r,c) NPEint(17,int,r,c) NPEint(1,int,r,c) NPEint(-1,int,r,c)
c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) NPEint(7,int,r,c) NPEint(17,int,r,c) NPEint(1,int,r,c) NPEint(-1,int,r,c)
Returns the vertices of the PE proximity region (which is itself a tetrahedron) for a point in the
standard regular tetrahedron
(rv=1,rv=2,rv=3,rv=4)
.
PE proximity region is defined with respect to the tetrahedron
with expansion parameter
and vertex regions based on the circumcenter of
(which is equivalent
to the center of mass in the standard regular tetrahedron).
Vertex regions are labeled as 1,2,3,4
rowwise for the vertices of the tetrahedron .
rv
is the index of the vertex region p
resides, with default=NULL
.
If p
is outside of , it returns
NULL
for the proximity region.
See also (Ceyhan (2005, 2010)).
NPEstd.tetra(p, r, rv = NULL)
NPEstd.tetra(p, r, rv = NULL)
p |
A 3D point whose PE proximity region is to be computed. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
rv |
Index of the vertex region containing the point, either |
Vertices of the tetrahedron which constitutes the PE proximity region with expansion parameter
r
and circumcenter (or center of mass) for a point p
in the standard regular tetrahedron
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-3 Xp<-runif.std.tetra(n)$g r<-1.5 NPEstd.tetra(Xp[1,],r) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv NPEstd.tetra(Xp[1,],r,rv=RV) NPEstd.tetra(c(-1,-1,-1),r,rv=NULL) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-3 Xp<-runif.std.tetra(n)$g r<-1.5 NPEstd.tetra(Xp[1,],r) #or try RV<-rel.vert.tetraCC(Xp[1,],tetra)$rv NPEstd.tetra(Xp[1,],r,rv=RV) NPEstd.tetra(c(-1,-1,-1),r,rv=NULL) ## End(Not run)
Returns the vertices of the PE proximity region (which is itself a tetrahedron) for a point in the
tetrahedron th
.
PE proximity region is defined with respect to the tetrahedron th
with expansion parameter and vertex regions based on the center
M
which is circumcenter ("CC"
) or
center of mass ("CM"
) of th
with default="CM"
.
Vertex regions are labeled as 1,2,3,4
rowwise for the vertices of the tetrahedron th
.
rv
is the index of the vertex region p
resides, with default=NULL
.
If p
is outside of th
, it returns NULL
for the proximity region.
See also (Ceyhan (2005, 2010)).
NPEtetra(p, th, r, M = "CM", rv = NULL)
NPEtetra(p, th, r, M = "CM", rv = NULL)
p |
A 3D point whose PE proximity region is to be computed. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
rv |
Index of the vertex region containing the point, either |
Vertices of the tetrahedron which constitutes the PE proximity region with expansion parameter
r
and circumcenter (or center of mass) for a point p
in the tetrahedron
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
NPEstd.tetra
, NPEtri
and NPEint
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) set.seed(1) tetra<-rbind(A,B,C,D)+matrix(runif(12,-.25,.25),ncol=3) n<-3 #try also n<-20 Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.5 NPEtetra(Xp[1,],tetra,r) #uses the default M="CM" NPEtetra(Xp[1,],tetra,r,M="CC") #or try RV<-rel.vert.tetraCM(Xp[1,],tetra)$rv NPEtetra(Xp[1,],tetra,r,M,rv=RV) P1<-c(.1,.1,.1) NPEtetra(P1,tetra,r,M) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) set.seed(1) tetra<-rbind(A,B,C,D)+matrix(runif(12,-.25,.25),ncol=3) n<-3 #try also n<-20 Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.5 NPEtetra(Xp[1,],tetra,r) #uses the default M="CM" NPEtetra(Xp[1,],tetra,r,M="CC") #or try RV<-rel.vert.tetraCM(Xp[1,],tetra)$rv NPEtetra(Xp[1,],tetra,r,M,rv=RV) P1<-c(.1,.1,.1) NPEtetra(P1,tetra,r,M) ## End(Not run)
Returns the vertices of the PE proximity region
(which is itself a triangle) for a point in the
triangle tri
(rv=1,rv=2,rv=3)
.
PE proximity region is defined with respect to the triangle tri
with expansion parameter
and vertex regions 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
.
Vertex regions are labeled as
rowwise for the vertices
of the triangle
tri
.
rv
is the index of the vertex region p
resides,
with default=NULL
.
If p
is outside of tri
,
it returns NULL
for the proximity region.
See also (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)).
NPEtri(p, tri, r, M = c(1, 1, 1), rv = NULL)
NPEtri(p, tri, r, M = c(1, 1, 1), rv = NULL)
p |
A 2D point whose PE proximity region is to be computed. |
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 |
Vertices of the triangular region
which constitutes the PE proximity region with expansion parameter
r
and center M
for a point p
Elvan Ceyhan
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
NPEbasic.tri
, NAStri
,
NCStri
, and IarcPEtri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) r<-1.5 n<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g NPEtri(Xp[3,],Tr,r,M) P1<-as.numeric(runif.tri(1,Tr)$g) #try also P1<-c(.4,.2) NPEtri(P1,Tr,r,M) M<-c(1.3,1.3) r<-2 P1<-c(1.4,1.2) P2<-c(1.5,1.26) NPEtri(P1,Tr,r,M) NPEtri(P2,Tr,r,M) #or try Rv<-rel.vert.tri(P1,Tr,M)$rv NPEtri(P1,Tr,r,M,Rv) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) r<-1.5 n<-3 set.seed(1) Xp<-runif.tri(n,Tr)$g NPEtri(Xp[3,],Tr,r,M) P1<-as.numeric(runif.tri(1,Tr)$g) #try also P1<-c(.4,.2) NPEtri(P1,Tr,r,M) M<-c(1.3,1.3) r<-2 P1<-c(1.4,1.2) P2<-c(1.5,1.26) NPEtri(P1,Tr,r,M) NPEtri(P2,Tr,r,M) #or try Rv<-rel.vert.tri(P1,Tr,M)$rv NPEtri(P1,Tr,r,M,Rv) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs and various other quantities related to the Delaunay triangles
for Arc Slice Proximity Catch Digraph (AS-PCD) whose vertices are the data points in Xp
in the multiple triangle case.
AS proximity regions are defined with respect to the
Delaunay triangles based on Yp
points and vertex regions in each triangle
are based on the center M="CC"
for circumcenter of each Delaunay triangle
or in barycentric coordinates in the
interior of each Delaunay triangle;
default is
M="CC"
i.e., circumcenter of each triangle.
Convex hull of Yp
is partitioned by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles whose union constitutes
the convex hull of Yp
points).
See (Ceyhan (2005, 2010)) for more on AS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
num.arcsAS(Xp, Yp, M = "CC")
num.arcsAS(Xp, Yp, M = "CC")
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
M |
The center of the triangle. |
A list
with the elements
desc |
A short description of the output: number of arcs and related quantities for the induced subdigraphs in the Delaunay triangles |
num.arcs |
Total number of arcs in all triangles, i.e., the number of arcs for the entire AS-PCD |
num.in.conhull |
Number of |
num.in.tris |
The vector of number of |
weight.vec |
The |
tri.num.arcs |
The |
del.tri.ind |
A matrix of indices of Delaunay triangles based on |
data.tri.ind |
A |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the Delaunay triangulation based on |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
num.arcsAStri
, num.arcsPE
, and num.arcsCS
## Not run: nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-"CC" #try also M<-c(1,1,1) Narcs = num.arcsAS(Xp,Yp,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-"CC" #try also M<-c(1,1,1) Narcs = num.arcsAS(Xp,Yp,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs of Arc Slice Proximity Catch Digraphs (AS-PCDs)
whose vertices are the 2D data set, Xp
.
It also provides number of vertices (i.e., number of data points inside the triangle)
and indices of the data points that reside in the triangle.
The data points could be inside or outside a general
triangle tri
(rv=1,rv=2,rv=3)
, with vertices of tri
stacked row-wise.
AS proximity regions are defined with respect to the triangle tri
and vertex regions are
based on the center M="CC"
for circumcenter of tri
;
or in Cartesian coordinates or
in barycentric coordinates in the
interior of the triangle
tri
; default is M="CC"
i.e., circumcenter of tri
.
For the number of arcs, loops are not allowed,
so arcs are only possible for points inside the triangle, tri
.
See also (Ceyhan (2005, 2010)).
num.arcsAStri(Xp, tri, M = "CC")
num.arcsAStri(Xp, tri, M = "CC")
Xp |
A set of 2D points which constitute the vertices of the digraph (i.e., AS-PCD). |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the triangle |
num.arcs |
Number of arcs of the AS-PCD |
num.in.tri |
Number of |
ind.in.tri |
The vector of indices of the |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support triangle. |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
num.arcsAS
, num.arcsPEtri
, and num.arcsCStri
## Not run: 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.2) Narcs = num.arcsAStri(Xp,Tr,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: 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.2) Narcs = num.arcsAStri(Xp,Tr,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs and various other quantities related to the Delaunay triangles
for Central Similarity Proximity Catch Digraph
(CS-PCD) whose vertices are the data points in Xp
in the multiple triangle case.
CS proximity regions are defined with respect to the
Delaunay triangles based on Yp
points with expansion parameter and edge regions in each triangle
is based on the center
in barycentric coordinates in the interior of each
Delaunay triangle or based on circumcenter of each Delaunay triangle (default for
which is the center of mass of the triangle).
Each Delaunay triangle is first converted to an (nonscaled) basic triangle so that
M
will be the same
type of center for each Delaunay triangle (this conversion is not necessary when M
is ).
Convex hull of Yp
is partitioned by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles whose union constitutes the
convex hull of Yp
points). For the number of arcs, loops are not allowed so arcs are only possible
for points inside the convex hull of Yp
points.
See (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)) for more on CS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
num.arcsCS(Xp, Yp, t, M = c(1, 1, 1))
num.arcsCS(Xp, Yp, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 3D point in barycentric coordinates which serves as a center in the interior of each Delaunay
triangle, default for |
A list
with the elements
desc |
A short description of the output: number of arcs and related quantities for the induced subdigraphs in the Delaunay triangles |
num.arcs |
Total number of arcs in all triangles, i.e., the number of arcs for the entire PE-PCD |
num.in.conhull |
Number of |
num.in.tris |
The vector of number of |
weight.vec |
The |
tri.num.arcs |
The |
del.tri.ind |
A matrix of indices of vertices of the Delaunay triangles based on |
data.tri.ind |
A |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the Delaunay triangulation based on |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
num.arcsCStri
, num.arcsCSstd.tri
, num.arcsPE
,
and num.arcsAS
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) Narcs = num.arcsCS(Xp,Yp,t=1,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) Narcs = num.arcsCS(Xp,Yp,t=1,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs and various other quantities related to the partition intervals
for Central Similarity Proximity Catch Digraph
(CS-PCD) whose vertices are the data points in Xp
in the multiple interval case.
For this function, CS proximity regions are constructed data points inside or outside the intervals based
on Yp
points with expansion parameter and centrality parameter
. That is, for this function,
arcs may exist for points in the middle or end intervals.
Range (or convex hull) of Yp
(i.e., the interval ) is partitioned by the spacings based on
Yp
points (i.e., multiple intervals are these partition intervals based on the order statistics of Yp
points
whose union constitutes the range of Yp
points). For the number of arcs, loops are not counted.
num.arcsCS1D(Xp, Yp, t, c = 0.5)
num.arcsCS1D(Xp, Yp, t, c = 0.5)
Xp |
A set or |
Yp |
A set or |
t |
A positive real number which serves as the expansion parameter in CS proximity region;
must be |
c |
A positive real number in |
A list
with the elements
desc |
A short description of the output: number of arcs and related quantities for the induced subdigraphs in the partition intervals |
num.arcs |
Total number of arcs in all intervals (including the end intervals), i.e., the number of arcs for the entire CS-PCD |
num.in.range |
Number of |
num.in.ints |
The vector of number of |
weight.vec |
The |
int.num.arcs |
The |
part.int |
A list of partition intervals based on |
data.int.ind |
A |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the partition intervals based on |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
There are no references for Rd macro \insertAllCites
on this help page.
num.arcsCSint
, num.arcsCSmid.int
,
num.arcsCSend.int
, and num.arcsPE1D
tau<-1.5 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) Narcs = num.arcsCS1D(Xp,Yp,tau,c) Narcs summary(Narcs) plot(Narcs)
tau<-1.5 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) Narcs = num.arcsCS1D(Xp,Yp,tau,c) Narcs summary(Narcs) plot(Narcs)
Returns the number of arcs of Central Similarity Proximity Catch Digraphs (CS-PCDs) whose
vertices are a 1D numerical data set, Xp
, outside the interval int
.
CS proximity region is constructed only with expansion parameter for points outside the interval
.
End vertex regions are based on the end points of the interval,
i.e., the corresponding end vertex region is an interval as or
for the interval
.
For the number of arcs, loops are not allowed, so arcs are only possible for points outside
the interval,
int
, for this function.
See also (Ceyhan (2016)).
num.arcsCSend.int(Xp, int, t)
num.arcsCSend.int(Xp, int, t)
Xp |
A |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
Number of arcs for the CS-PCD with vertices being 1D data set, Xp
,
expansion parameter, t
, for the end intervals.
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
num.arcsCSmid.int
, num.arcsPEmid.int
, and num.arcsPEend.int
a<-0; b<-10; int<-c(a,b) n<-5 XpL<-runif(n,a-5,a) XpR<-runif(n,b,b+5) Xp<-c(XpL,XpR) num.arcsCSend.int(Xp,int,t=2) num.arcsCSend.int(Xp,int,t=1.2) num.arcsCSend.int(Xp,int,t=4) num.arcsCSend.int(Xp,int,t=2+5) #num.arcsCSend.int(Xp,int,t=c(-5,15)) n<-10 #try also n<-20 Xp2<-runif(n,a-5,b+5) num.arcsCSend.int(Xp2,int,t=2) t<-.5 num.arcsCSend.int(Xp,int,t)
a<-0; b<-10; int<-c(a,b) n<-5 XpL<-runif(n,a-5,a) XpR<-runif(n,b,b+5) Xp<-c(XpL,XpR) num.arcsCSend.int(Xp,int,t=2) num.arcsCSend.int(Xp,int,t=1.2) num.arcsCSend.int(Xp,int,t=4) num.arcsCSend.int(Xp,int,t=2+5) #num.arcsCSend.int(Xp,int,t=c(-5,15)) n<-10 #try also n<-20 Xp2<-runif(n,a-5,b+5) num.arcsCSend.int(Xp2,int,t=2) t<-.5 num.arcsCSend.int(Xp,int,t)
An object of class "NumArcs"
.
Returns the number of arcs of Central Similarity Proximity Catch Digraphs (CS-PCDs)
whose vertices are the
data points in Xp
in the one middle interval case.
It also provides number of vertices
(i.e., number of data points inside the intervals)
and indices of the data points that reside in the intervals.
The data points could be inside or outside the interval is int
.
CS proximity region is constructed
with an expansion parameter and a centrality parameter
.
CS proximity region is constructed for both points inside and outside the interval, hence
the arcs may exist for all points inside or outside the interval.
See also (Ceyhan (2016)).
num.arcsCSint(Xp, int, t, c = 0.5)
num.arcsCSint(Xp, int, t, c = 0.5)
Xp |
A set of 1D points which constitute the vertices of CS-PCD. |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the interval |
num.arcs |
Total number of arcs in all intervals (including the end intervals), i.e., the number of arcs for the entire CS-PCD |
num.in.range |
Number of |
num.in.ints |
The vector of number of |
int.num.arcs |
The |
data.int.ind |
A |
ind.left.end , ind.mid , ind.right.end
|
Indices of data points in the left end interval, middle interval, and right end interval (respectively) |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support interval. |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
num.arcsCSmid.int
, num.arcsCSend.int
,
and num.arcsPEint
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) n<-10 set.seed(1) Xp<-runif(n,a,b) Narcs = num.arcsCSint(Xp,int,t,c) Narcs summary(Narcs) plot(Narcs)
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) n<-10 set.seed(1) Xp<-runif(n,a,b) Narcs = num.arcsCSint(Xp,int,t,c) Narcs summary(Narcs) plot(Narcs)
Returns the number of arcs of of Central Similarity Proximity Catch Digraphs (CS-PCDs) whose vertices are
the given 1D numerical data set, Xp
.
CS proximity region is defined with respect to the interval
int
for this function. CS proximity region is constructed with expansion parameter
and
centrality parameter
.
Vertex regions are based on the center associated with the centrality parameter .
For the interval,
int
, the parameterized center is
and for the number of arcs,
loops are not allowed so arcs are only possible for points inside the middle interval
int
for this function.
See also (Ceyhan (2016)).
num.arcsCSmid.int(Xp, int, t, c = 0.5)
num.arcsCSmid.int(Xp, int, t, c = 0.5)
Xp |
A set or |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
Number of arcs for the PE-PCD whose vertices are the 1D data set, Xp
,
with expansion parameter, , and centrality parameter,
. PE proximity regions are defined only
for
Xp
points inside the interval int
, i.e., arcs are possible for such points only.
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
num.arcsCSend.int
, num.arcsPEmid.int
, and num.arcsPEend.int
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) n<-10 Xp<-runif(n,a,b) num.arcsCSmid.int(Xp,int,t,c) num.arcsCSmid.int(Xp,int,t,c=.3) num.arcsCSmid.int(Xp,int,t=1.5,c) #num.arcsCSmid.int(Xp,int,t,c+5) #gives error #num.arcsCSmid.int(Xp,int,t,c+10) n<-10 #try also n<-20 Xp<-runif(n,a-5,b+5) num.arcsCSint(Xp,int,t,c) Xp<-runif(n,a+10,b+10) num.arcsCSmid.int(Xp,int,t,c) n<-10 Xp<-runif(n,a,b) num.arcsCSmid.int(Xp,int,t,c)
c<-.4 t<-2 a<-0; b<-10; int<-c(a,b) n<-10 Xp<-runif(n,a,b) num.arcsCSmid.int(Xp,int,t,c) num.arcsCSmid.int(Xp,int,t,c=.3) num.arcsCSmid.int(Xp,int,t=1.5,c) #num.arcsCSmid.int(Xp,int,t,c+5) #gives error #num.arcsCSmid.int(Xp,int,t,c+10) n<-10 #try also n<-20 Xp<-runif(n,a-5,b+5) num.arcsCSint(Xp,int,t,c) Xp<-runif(n,a+10,b+10) num.arcsCSmid.int(Xp,int,t,c) n<-10 Xp<-runif(n,a,b) num.arcsCSmid.int(Xp,int,t,c)
An object of class "NumArcs"
.
Returns the number of arcs of Central Similarity Proximity Catch Digraphs (CS-PCDs)
whose vertices are the
given 2D numerical data set, Xp
.
It also provides number of vertices
(i.e., number of data points inside the standard equilateral triangle )
and indices of the data points that reside in
.
CS proximity region is defined with respect to the standard
equilateral triangle
with expansion parameter
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
i.e., the center of mass of
.
For the number of arcs, loops are not allowed so
arcs are only possible for points inside
for this function.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
num.arcsCSstd.tri(Xp, t, M = c(1, 1, 1))
num.arcsCSstd.tri(Xp, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the digraph. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates.
which serves as a center in the interior of the standard equilateral triangle |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the standard equilateral triangle |
num.arcs |
Number of arcs of the CS-PCD |
num.in.tri |
Number of |
ind.in.tri |
The vector of indices of the |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the support triangle |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
num.arcsCStri
, num.arcsCS
, and num.arcsPEstd.tri
,
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); n<-10 #try also n<-20 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) Narcs = num.arcsCSstd.tri(Xp,t=.5,M) Narcs summary(Narcs) par(pty="s") plot(Narcs,asp=1) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); n<-10 #try also n<-20 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) Narcs = num.arcsCSstd.tri(Xp,t=.5,M) Narcs summary(Narcs) par(pty="s") plot(Narcs,asp=1) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs of Central Similarity Proximity Catch Digraphs (CS-PCDs)
whose vertices are the
given 2D numerical data set, Xp
.
It also provides number of vertices
(i.e., number of data points inside the triangle)
and indices of the data points that reside in the triangle.
CS proximity region is defined with respect to the triangle,
tri
with expansion parameter
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
tri
;
default is i.e., the center of mass of
tri
.
For the number of arcs, loops are not allowed so
arcs are only possible for points inside tri
for this function.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
num.arcsCStri(Xp, tri, t, M = c(1, 1, 1))
num.arcsCStri(Xp, tri, t, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of CS-PCD. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the triangle |
num.arcs |
Number of arcs of the CS-PCD |
num.in.tri |
Number of |
ind.in.tri |
The vector of indices of the |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support triangle. |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
num.arcsCSstd.tri
, num.arcsCS
, num.arcsPEtri
,
and num.arcsAStri
## Not run: 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) Narcs = num.arcsCStri(Xp,Tr,t=.5,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: 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) Narcs = num.arcsCStri(Xp,Tr,t=.5,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs and various other quantities related to the Delaunay triangles
for Proportional Edge Proximity Catch Digraph
(PE-PCD) whose vertices are the data points in Xp
in the multiple triangle case.
PE proximity regions are defined with respect to the
Delaunay triangles based on Yp
points
with expansion parameter
and vertex regions in each triangle
is based on the center
in barycentric coordinates in the interior of each
Delaunay triangle or based on circumcenter of each Delaunay triangle
(default for
which is the center of mass of the triangle).
Each Delaunay triangle is first converted to
an (nonscaled) basic triangle so that
M
will be the same
type of center for each Delaunay triangle
(this conversion is not necessary when M
is ).
Convex hull of Yp
is partitioned
by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles
whose union constitutes the
convex hull of Yp
points). For the number of arcs,
loops are not allowed so arcs are only possible
for points inside the convex hull of Yp
points.
See (Ceyhan (2005); Ceyhan et al. (2006)) for more on PE-PCDs. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
num.arcsPE(Xp, Yp, r, M = c(1, 1, 1))
num.arcsPE(Xp, Yp, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 3D point in barycentric coordinates
which serves as a center in the interior of each Delaunay
triangle or circumcenter of each Delaunay triangle
(for this, argument should be set as |
A list
with the elements
desc |
A short description of the output: number of arcs and related quantities for the induced subdigraphs in the Delaunay triangles |
num.arcs |
Total number of arcs in all triangles, i.e., the number of arcs for the entire PE-PCD |
num.in.conhull |
Number of |
num.in.tris |
The vector of number of |
weight.vec |
The |
tri.num.arcs |
The |
del.tri.ind |
A matrix of indices of vertices of
the Delaunay triangles based on |
data.tri.ind |
A |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the Delaunay triangulation based on |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
num.arcsPEtri
, num.arcsPEstd.tri
,
num.arcsCS
, and num.arcsAS
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) Narcs = num.arcsPE(Xp,Yp,r=1.25,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) Narcs = num.arcsPE(Xp,Yp,r=1.25,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs and various other quantities related to the partition intervals
for Proportional Edge Proximity Catch Digraph
(PE-PCD) whose vertices are the data points in Xp
in the multiple interval case.
For this function, PE proximity regions are constructed data points inside or outside the intervals based
on Yp
points with expansion parameter and centrality parameter
. That is, for this function,
arcs may exist for points in the middle or end intervals.
Range (or convex hull) of Yp
(i.e., the interval ) is partitioned by the spacings based on
Yp
points (i.e., multiple intervals are these partition intervals based on the order statistics of Yp
points
whose union constitutes the range of Yp
points). For the number of arcs, loops are not counted.
See also (Ceyhan (2012)).
num.arcsPE1D(Xp, Yp, r, c = 0.5)
num.arcsPE1D(Xp, Yp, r, c = 0.5)
Xp |
A set or |
Yp |
A set or |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
A list
with the elements
desc |
A short description of the output: number of arcs and related quantities for the induced subdigraphs in the partition intervals |
num.arcs |
Total number of arcs in all intervals (including the end intervals), i.e., the number of arcs for the entire PE-PCD |
num.in.range |
Number of |
num.in.ints |
The vector of number of |
weight.vec |
The |
int.num.arcs |
The |
part.int |
A matrix with columns corresponding to the partition intervals based on |
data.int.ind |
A |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the partition intervals based on |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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.
num.arcsPEint
, num.arcsPEmid.int
, num.arcsPEend.int
,
and num.arcsCS1D
## Not run: 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<-15; 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) Narcs = num.arcsPE1D(Xp,Yp,r,c) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: 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<-15; 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) Narcs = num.arcsPE1D(Xp,Yp,r,c) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
Returns the number of arcs of Proportional Edge Proximity Catch Digraphs (PE-PCDs) whose
vertices are a 1D numerical data set, Xp
, outside the interval int
.
PE proximity region is constructed only with expansion parameter for points outside the interval
.
End vertex regions are based on the end points of the interval,
i.e., the corresponding vertex region is an interval as
or
for the interval
.
For the number of arcs, loops are not allowed, so arcs are only possible for points outside
the interval,
int
, for this function.
See also (Ceyhan (2012)).
num.arcsPEend.int(Xp, int, r)
num.arcsPEend.int(Xp, int, r)
Xp |
A |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
Number of arcs for the PE-PCD with vertices being 1D data set, Xp
,
expansion parameter, , for the end intervals.
Elvan Ceyhan
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.
num.arcsPEmid.int
, num.arcsPE1D
, num.arcsCSmid.int
, and num.arcsCSend.int
## Not run: a<-0; b<-10; int<-c(a,b) n<-5 XpL<-runif(n,a-5,a) XpR<-runif(n,b,b+5) Xp<-c(XpL,XpR) r<-1.2 num.arcsPEend.int(Xp,int,r) num.arcsPEend.int(Xp,int,r=2) ## End(Not run)
## Not run: a<-0; b<-10; int<-c(a,b) n<-5 XpL<-runif(n,a-5,a) XpR<-runif(n,b,b+5) Xp<-c(XpL,XpR) r<-1.2 num.arcsPEend.int(Xp,int,r) num.arcsPEend.int(Xp,int,r=2) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs of Proportional Edge Proximity Catch Digraph (PE-PCD)
whose vertices are the
data points in Xp
in the one middle interval case.
It also provides number of vertices
(i.e., number of data points inside the intervals)
and indices of the data points that reside in the intervals.
The data points could be inside or outside the interval is int
.
PE proximity region is constructed
with an expansion parameter
and a centrality parameter
.
int
determines the end points of the interval.
The PE proximity region is constructed for both points inside and outside the interval, hence the arcs may exist for all points inside or outside the interval.
See also (Ceyhan (2012)).
num.arcsPEint(Xp, int, r, c = 0.5)
num.arcsPEint(Xp, int, r, c = 0.5)
Xp |
A set of 1D points which constitute the vertices of PE-PCD. |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the interval |
num.arcs |
Total number of arcs in all intervals (including the end intervals), i.e., the number of arcs for the entire PE-PCD |
num.in.range |
Number of |
num.in.ints |
The vector of number of |
int.num.arcs |
The |
data.int.ind |
A |
ind.left.end , ind.mid , ind.right.end
|
Indices of data points in the left end interval, middle interval, and right end interval (respectively) |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support interval. |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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.
num.arcsPEmid.int
, num.arcsPEend.int
,
and num.arcsCSint
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) xf<-(int[2]-int[1])*.1 set.seed(123) n<-10 Xp<-runif(n,a-xf,b+xf) Narcs = num.arcsPEint(Xp,int,r,c) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) xf<-(int[2]-int[1])*.1 set.seed(123) n<-10 Xp<-runif(n,a-xf,b+xf) Narcs = num.arcsPEint(Xp,int,r,c) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
Returns the number of arcs of Proportional Edge Proximity Catch Digraphs (PE-PCDs) whose vertices are the
given 1D numerical data set, Xp
. PE proximity region is defined with respect to the interval
int
for this function.
PE proximity region is constructed with expansion parameter and
centrality parameter
.
Vertex regions are based on the center associated with the centrality parameter .
For the interval,
int
, the parameterized center is
and for the number of arcs,
loops are not allowed so arcs are only possible for points inside the middle interval
int
for this function.
See also (Ceyhan (2012)).
num.arcsPEmid.int(Xp, int, r, c = 0.5)
num.arcsPEmid.int(Xp, int, r, c = 0.5)
Xp |
A set or |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
Number of arcs for the PE-PCD whose vertices are the 1D data set, Xp
,
with expansion parameter, , and centrality parameter,
. PE proximity regions are defined only
for
Xp
points inside the interval int
, i.e., arcs are possible for such points only.
Elvan Ceyhan
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.
num.arcsPEend.int
, num.arcsPE1D
, num.arcsCSmid.int
, and num.arcsCSend.int
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) n<-10 Xp<-runif(n,a,b) num.arcsPEmid.int(Xp,int,r,c) num.arcsPEmid.int(Xp,int,r=1.5,c) ## End(Not run)
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) n<-10 Xp<-runif(n,a,b) num.arcsPEmid.int(Xp,int,r,c) num.arcsPEmid.int(Xp,int,r=1.5,c) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs of
Proportional Edge Proximity Catch Digraphs (PE-PCDs)
whose vertices are the
given 2D numerical data set, Xp
in the standard equilateral triangle.
It also provides number of vertices
(i.e., number of data points inside the standard equilateral triangle )
and indices of the data points that reside in
.
PE proximity region is defined
with respect to the standard equilateral triangle
with expansion parameter
and vertex regions are based on the center
in Cartesian coordinates or
in barycentric coordinates in the interior of
;
default is
, i.e., the center of mass of
.
For the number of arcs, loops are not allowed so
arcs are only possible for points inside
for this function.
See also (Ceyhan et al. (2006)).
num.arcsPEstd.tri(Xp, r, M = c(1, 1, 1))
num.arcsPEstd.tri(Xp, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
r |
A positive real number
which serves as the expansion parameter for 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 standard equilateral triangle |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the standard equilateral triangle |
num.arcs |
Number of arcs of the PE-PCD |
num.in.tri |
Number of |
ind.in.tri |
The vector of indices of the |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation
is the support triangle |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
num.arcsPEtri
, num.arcsPE
,
and num.arcsCSstd.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); n<-10 #try also n<-20 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-c(.6,.2) #try also M<-c(1,1,1) Narcs = num.arcsPEstd.tri(Xp,r=1.25,M) Narcs summary(Narcs) par(pty="s") plot(Narcs,asp=1) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); n<-10 #try also n<-20 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-c(.6,.2) #try also M<-c(1,1,1) Narcs = num.arcsPEstd.tri(Xp,r=1.25,M) Narcs summary(Narcs) par(pty="s") plot(Narcs,asp=1) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs of
Proportional Edge Proximity Catch Digraphs (PE-PCDs)
whose vertices are the
given 3D numerical data set, Xp
.
It also provides number of vertices
(i.e., number of data points inside the tetrahedron)
and indices of the data points that reside in the tetrahedron.
PE proximity region is constructed with respect to the tetrahedron th
and
vertex regions are based on the center M
which is circumcenter ("CC"
) or
center of mass ("CM"
) of th
with default="CM"
.
For the number of arcs, loops are not
allowed so arcs are only possible for points inside the tetrahedron th
for this function.
See also (Ceyhan (2005, 2010)).
num.arcsPEtetra(Xp, th, r, M = "CM")
num.arcsPEtetra(Xp, th, r, M = "CM")
Xp |
A set of 3D points which constitute the vertices of PE-PCD. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the tetrahedron |
num.arcs |
Number of arcs of the PE-PCD |
num.in.tetra |
Number of |
ind.in.tetra |
The vector of indices of the |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support tetrahedron. |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
num.arcsPEtri
, num.arcsCStri
,
and num.arcsAStri
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-10 #try also n<-20 set.seed(1) Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.25 Narcs = num.arcsPEtetra(Xp,tetra,r,M) Narcs summary(Narcs) #plot(Narcs) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-10 #try also n<-20 set.seed(1) Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.25 Narcs = num.arcsPEtetra(Xp,tetra,r,M) Narcs summary(Narcs) #plot(Narcs) ## End(Not run)
An object of class "NumArcs"
.
Returns the number of arcs of
Proportional Edge Proximity Catch Digraphs (PE-PCDs)
whose vertices are the
given 2D numerical data set, Xp
.
It also provides number of vertices
(i.e., number of data points inside the triangle)
and indices of the data points that reside in the triangle.
PE proximity region is defined
with respect to the triangle,
tri
with expansion parameter and vertex regions are
based on the center
in Cartesian coordinates
or
in barycentric coordinates
in the interior of the triangle
tri
or
based on circumcenter of tri
;
default is , i.e.,
the center of mass of
tri
.
For the number of arcs, loops are not
allowed so arcs are only possible for points
inside the triangle tri
for this function.
See also (Ceyhan (2005, 2016)).
num.arcsPEtri(Xp, tri, r, M = c(1, 1, 1))
num.arcsPEtri(Xp, tri, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of 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 |
A list
with the elements
desc |
A short description of the output: number of arcs and quantities related to the triangle |
num.arcs |
Number of arcs of the PE-PCD |
num.in.tri |
Number of |
ind.in.tri |
The vector of indices of the |
tess.points |
Points on which the tessellation of the study region is performed, here, tessellation is the support triangle. |
vertices |
Vertices of the digraph, |
Elvan Ceyhan
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 (2016).
“Edge Density of New Graph Types Based on a Random Digraph Family.”
Statistical Methodology, 33, 31-54.
num.arcsPEstd.tri
, num.arcsPE
,
num.arcsCStri
, and num.arcsAStri
## Not run: 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) Narcs = num.arcsPEtri(Xp,Tr,r=1.25,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
## Not run: 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) Narcs = num.arcsPEtri(Xp,Tr,r=1.25,M) Narcs summary(Narcs) plot(Narcs) ## End(Not run)
Returns the number of Delaunay triangles
based on the 2D set of points Yp
.
See (Okabe et al. (2000); Sinclair (2016))
for more on Delaunay triangulation and
the corresponding algorithm.
num.delaunay.tri(Yp)
num.delaunay.tri(Yp)
Yp |
A set of 2D points which constitute the vertices of Delaunay triangles. |
Number of Delaunay triangles based on Yp
points.
Elvan Ceyhan
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
ny<-10 set.seed(1) Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) num.delaunay.tri(Yp)
ny<-10 set.seed(1) Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) num.delaunay.tri(Yp)
p
parallel to the line segment
joining two distinct 2D points a
and b
An object of class "Lines"
.
Returns the equation, slope, intercept
,
and -coordinates of the line crossing the
point
p
and parallel to the line
passing through the points a
and b
with
-coordinates are provided in
vector
x
.
paraline(p, a, b, x)
paraline(p, a, b, x)
p |
A 2D point at which the parallel line to line segment
joining |
a , b
|
2D points that determine the line segment (the line will be parallel to this line segment). |
x |
A scalar or a |
A list
with the elements
desc |
Description of the line
passing through point |
mtitle |
The |
points |
The input points |
x |
The input vector.
It can be a scalar or a |
y |
The output scalar or |
slope |
Slope of the line, |
intercept |
Intercept of the line
passing through point |
equation |
Equation of the line
passing through point |
Elvan Ceyhan
slope
, Line
, and perpline
,
line
in the generic stats
package,
and paraline3D
## Not run: A<-c(1.1,1.2); B<-c(2.3,3.4); p<-c(.51,2.5) paraline(p,A,B,.45) pts<-rbind(A,B,p) xr<-range(pts[,1]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 plnAB<-paraline(p,A,B,x) plnAB summary(plnAB) plot(plnAB) y<-plnAB$y Xlim<-range(x,pts[,1]) if (!is.na(y[1])) {Ylim<-range(y,pts[,2])} else {Ylim<-range(pts[,2])} xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 plot(A,pch=".",xlab="",ylab="",main="Line Crossing P and Parallel to AB", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(pts) txt.str<-c("A","B","p") text(pts+rbind(pf,pf,pf),txt.str) segments(A[1],A[2],B[1],B[2],lty=2) if (!is.na(y[1])) {lines(x,y,type="l",lty=1,xlim=Xlim,ylim=Ylim)} else {abline(v=p[1])} tx<-(A[1]+B[1])/2; if (!is.na(y[1])) {ty<-paraline(p,A,B,tx)$y} else {ty=p[2]} text(tx,ty,"line parallel to AB\n and crossing p") ## End(Not run)
## Not run: A<-c(1.1,1.2); B<-c(2.3,3.4); p<-c(.51,2.5) paraline(p,A,B,.45) pts<-rbind(A,B,p) xr<-range(pts[,1]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 plnAB<-paraline(p,A,B,x) plnAB summary(plnAB) plot(plnAB) y<-plnAB$y Xlim<-range(x,pts[,1]) if (!is.na(y[1])) {Ylim<-range(y,pts[,2])} else {Ylim<-range(pts[,2])} xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 plot(A,pch=".",xlab="",ylab="",main="Line Crossing P and Parallel to AB", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(pts) txt.str<-c("A","B","p") text(pts+rbind(pf,pf,pf),txt.str) segments(A[1],A[2],B[1],B[2],lty=2) if (!is.na(y[1])) {lines(x,y,type="l",lty=1,xlim=Xlim,ylim=Ylim)} else {abline(v=p[1])} tx<-(A[1]+B[1])/2; if (!is.na(y[1])) {ty<-paraline(p,A,B,tx)$y} else {ty=p[2]} text(tx,ty,"line parallel to AB\n and crossing p") ## End(Not run)
p
and parallel to line joining 3D points a
and b
An object of class "Lines3D"
.
Returns the equation, -,
-,
and
-coordinates of the line crossing 3D point
p
and parallel to the line
joining 3D points a
and b
(i.e., the line is in the direction of vector
b
-a
)
with the parameter t
being provided in vector
t
.
paraline3D(p, a, b, t)
paraline3D(p, a, b, t)
p |
A 3D point through which the straight line passes. |
a , b
|
3D points
which determine the straight line to which
the line passing through point |
t |
A scalar or a |
A list
with the elements
desc |
A description of the line |
mtitle |
The |
points |
The input points
that determine the line to which the line
crossing point |
pnames |
The names of the input points
that determine the line to which the line crossing point |
vecs |
The points |
vec.names |
The names of the points |
x , y , z
|
The |
tsq |
The scalar or the |
equation |
Equation of the line
passing through point |
Elvan Ceyhan
Line3D
, perpline2plane
,
and paraline
## Not run: P<-c(1,10,4); Q<-c(1,1,3); R<-c(3,9,12) vecs<-rbind(P,R-Q) pts<-rbind(P,Q,R) paraline3D(P,Q,R,.1) tr<-range(pts,vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=5) #try also l=10, 20, or 100 pln3D<-paraline3D(P,Q,R,tsq) pln3D summary(pln3D) plot(pln3D) x<-pln3D$x y<-pln3D$y z<-pln3D$z zr<-range(z) zf<-(zr[2]-zr[1])*.2 Qv<-(R-Q)*tf*5 Xlim<-range(x,pts[,1]) Ylim<-range(y,pts[,2]) Zlim<-range(z,pts[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] Dr<-P+min(tsq)*(R-Q) plot3D::lines3D(x, y, z, phi = 0, bty = "g", main="Line Crossing P \n in the direction of R-Q", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.1,.1)+c(-zf,zf), pch = 20, cex = 2, ticktype = "detailed") plot3D::arrows3D(Dr[1],Dr[2],Dr[3]+zf,Dr[1]+Qv[1], Dr[2]+Qv[2],Dr[3]+zf+Qv[3], add=TRUE) plot3D::points3D(pts[,1],pts[,2],pts[,3],add=TRUE) plot3D::text3D(pts[,1],pts[,2],pts[,3],labels=c("P","Q","R"),add=TRUE) plot3D::arrows3D(P[1],P[2],P[3]-2*zf,P[1],P[2],P[3],lty=2, add=TRUE) plot3D::text3D(P[1],P[2],P[3]-2*zf,labels="initial point",add=TRUE) plot3D::arrows3D(Dr[1]+Qv[1]/2,Dr[2]+Qv[2]/2, Dr[3]+3*zf+Qv[3]/2,Dr[1]+Qv[1]/2, Dr[2]+Qv[2]/2,Dr[3]+zf+Qv[3]/2,lty=2, add=TRUE) plot3D::text3D(Dr[1]+Qv[1]/2,Dr[2]+Qv[2]/2,Dr[3]+3*zf+Qv[3]/2, labels="direction vector",add=TRUE) plot3D::text3D(Dr[1]+Qv[1]/2,Dr[2]+Qv[2]/2, Dr[3]+zf+Qv[3]/2,labels="R-Q",add=TRUE) ## End(Not run)
## Not run: P<-c(1,10,4); Q<-c(1,1,3); R<-c(3,9,12) vecs<-rbind(P,R-Q) pts<-rbind(P,Q,R) paraline3D(P,Q,R,.1) tr<-range(pts,vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=5) #try also l=10, 20, or 100 pln3D<-paraline3D(P,Q,R,tsq) pln3D summary(pln3D) plot(pln3D) x<-pln3D$x y<-pln3D$y z<-pln3D$z zr<-range(z) zf<-(zr[2]-zr[1])*.2 Qv<-(R-Q)*tf*5 Xlim<-range(x,pts[,1]) Ylim<-range(y,pts[,2]) Zlim<-range(z,pts[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] Dr<-P+min(tsq)*(R-Q) plot3D::lines3D(x, y, z, phi = 0, bty = "g", main="Line Crossing P \n in the direction of R-Q", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.1,.1)+c(-zf,zf), pch = 20, cex = 2, ticktype = "detailed") plot3D::arrows3D(Dr[1],Dr[2],Dr[3]+zf,Dr[1]+Qv[1], Dr[2]+Qv[2],Dr[3]+zf+Qv[3], add=TRUE) plot3D::points3D(pts[,1],pts[,2],pts[,3],add=TRUE) plot3D::text3D(pts[,1],pts[,2],pts[,3],labels=c("P","Q","R"),add=TRUE) plot3D::arrows3D(P[1],P[2],P[3]-2*zf,P[1],P[2],P[3],lty=2, add=TRUE) plot3D::text3D(P[1],P[2],P[3]-2*zf,labels="initial point",add=TRUE) plot3D::arrows3D(Dr[1]+Qv[1]/2,Dr[2]+Qv[2]/2, Dr[3]+3*zf+Qv[3]/2,Dr[1]+Qv[1]/2, Dr[2]+Qv[2]/2,Dr[3]+zf+Qv[3]/2,lty=2, add=TRUE) plot3D::text3D(Dr[1]+Qv[1]/2,Dr[2]+Qv[2]/2,Dr[3]+3*zf+Qv[3]/2, labels="direction vector",add=TRUE) plot3D::text3D(Dr[1]+Qv[1]/2,Dr[2]+Qv[2]/2, Dr[3]+zf+Qv[3]/2,labels="R-Q",add=TRUE) ## End(Not run)
a
, b
, and c
An object of class "Planes"
.
Returns the equation and -coordinates of the plane
passing through point
p
and parallel to the plane spanned
by three distinct 3D points a
, b
,
and c
with - and
-coordinates are provided
in vectors
x
and y
,
respectively.
paraplane(p, a, b, c, x, y)
paraplane(p, a, b, c, x, y)
p |
A 3D point which the plane parallel to the plane spanned by
three distinct 3D points |
a , b , c
|
3D points that determine the plane to which the plane
crossing point |
x , y
|
Scalars or |
A list
with the elements
desc |
Description of the plane passing through point |
points |
The input points |
x , y
|
The input vectors which constitutes the |
z |
The output |
coeff |
Coefficients of the plane (in the |
equation |
Equation of the plane in long form |
equation2 |
Equation of the plane in short form, to be inserted on the plot |
Elvan Ceyhan
## Not run: Q<-c(1,10,3); R<-c(1,1,3); S<-c(3,9,12); P<-c(1,1,0) pts<-rbind(Q,R,S,P) paraplane(P,Q,R,S,.1,.2) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.25 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plP2QRS<-paraplane(P,Q,R,S,x,y) plP2QRS summary(plP2QRS) plot(plP2QRS,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) paraplane(P,Q,R,Q+R,.1,.2) z.grid<-plP2QRS$z plQRS<-Plane(Q,R,S,x,y) plQRS pl.grid<-plQRS$z zr<-max(z.grid)-min(z.grid) Pts<-rbind(Q,R,S,P)+rbind(c(0,0,zr*.1),c(0,0,zr*.1), c(0,0,zr*.1),c(0,0,zr*.1)) Mn.pts<-apply(Pts[1:3,],2,mean) plot3D::persp3D(z = pl.grid, x = x, y = y, theta =225, phi = 30, ticktype = "detailed", main="Plane Crossing Points Q, R, S\n and Plane Passing P Parallel to it") #plane spanned by points Q, R, S plot3D::persp3D(z = z.grid, x = x, y = y,add=TRUE) #plane parallel to the original plane and passing thru point \code{P} plot3D::persp3D(z = z.grid, x = x, y = y, theta =225, phi = 30, ticktype = "detailed", main="Plane Crossing Point P \n and Parallel to the Plane Crossing Q, R, S") #plane spanned by points Q, R, S #add the defining points plot3D::points3D(Pts[,1],Pts[,2],Pts[,3], add=TRUE) plot3D::text3D(Pts[,1],Pts[,2],Pts[,3], c("Q","R","S","P"),add=TRUE) plot3D::text3D(Mn.pts[1],Mn.pts[2],Mn.pts[3],plP2QRS$equation,add=TRUE) plot3D::polygon3D(Pts[1:3,1],Pts[1:3,2],Pts[1:3,3], add=TRUE) ## End(Not run)
## Not run: Q<-c(1,10,3); R<-c(1,1,3); S<-c(3,9,12); P<-c(1,1,0) pts<-rbind(Q,R,S,P) paraplane(P,Q,R,S,.1,.2) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.25 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plP2QRS<-paraplane(P,Q,R,S,x,y) plP2QRS summary(plP2QRS) plot(plP2QRS,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) paraplane(P,Q,R,Q+R,.1,.2) z.grid<-plP2QRS$z plQRS<-Plane(Q,R,S,x,y) plQRS pl.grid<-plQRS$z zr<-max(z.grid)-min(z.grid) Pts<-rbind(Q,R,S,P)+rbind(c(0,0,zr*.1),c(0,0,zr*.1), c(0,0,zr*.1),c(0,0,zr*.1)) Mn.pts<-apply(Pts[1:3,],2,mean) plot3D::persp3D(z = pl.grid, x = x, y = y, theta =225, phi = 30, ticktype = "detailed", main="Plane Crossing Points Q, R, S\n and Plane Passing P Parallel to it") #plane spanned by points Q, R, S plot3D::persp3D(z = z.grid, x = x, y = y,add=TRUE) #plane parallel to the original plane and passing thru point \code{P} plot3D::persp3D(z = z.grid, x = x, y = y, theta =225, phi = 30, ticktype = "detailed", main="Plane Crossing Point P \n and Parallel to the Plane Crossing Q, R, S") #plane spanned by points Q, R, S #add the defining points plot3D::points3D(Pts[,1],Pts[,2],Pts[,3], add=TRUE) plot3D::text3D(Pts[,1],Pts[,2],Pts[,3], c("Q","R","S","P"),add=TRUE) plot3D::text3D(Mn.pts[1],Mn.pts[2],Mn.pts[3],plP2QRS$equation,add=TRUE) plot3D::polygon3D(Pts[1:3,1],Pts[1:3,2],Pts[1:3,3], add=TRUE) ## End(Not run)
pcds
is a package for construction and
visualization of proximity catch digraphs (PCDs)
and computation of two graph invariants of the PCDs and
testing spatial patterns using these invariants.
The PCD families considered are Arc-Slice (AS) PCDs,
Proportional-Edge (PE) PCDs
and Central Similarity (CS) PCDs.
The graph invariants used in testing spatial point data are the domination number (Ceyhan (2011)) and arc density (Ceyhan et al. (2006); Ceyhan et al. (2007)) of for two-dimensional data.
The pcds
package also contains the functions
for generating patterns of segregation, association, CSR
(complete spatial randomness) and Uniform data
in one, two and three dimensional cases,
for testing these patterns
based on two invariants of various families of the proximity catch digraphs (PCDs),
(see (Ceyhan (2005)).
Moreover, the package has visualization tools for these digraphs for 1D-3D vertices. The AS-PCD related tools are provided for 1D and 2D data; PE-PCD related tools are provided for 1D-3D data, and CS-PCD tools are provided for 1D and 2D data.
pcds
functionsThe pcds
functions can be grouped as Auxiliary Functions,
AS-PCD Functions,
PE-PCD Functions,
and CS-PCD Functions.
Contains the auxiliary (or utility) functions for constructing and visualizing Delaunay tessellations in 1D and 2D settings, computing the domination number, constructing the geometrical tools, such as equation of lines for two points, distances between lines and points, checking points inside the triangle etc., finding the (local) extrema (restricted to Delaunay cells or vertex or edge regions in them).
Contains the functions used in AS-PCD construction, estimation of domination number, arc density, etc in the 2D setting.
Contains the functions used in PE-PCD construction, estimation of domination number, arc density, etc in the 1D-3D settings.
Contains the functions used in CS-PCD construction, estimation of domination number, arc density, etc in the 1D and 2D setting.
Contains functions for generation of points from uniform (or CSR), segregation and association patterns.
In all these functions points are vectors, and data sets are either matrices or data frames.
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
for Proportional Edge Proximity Catch Digraphs (PE-PCDs)
- middle interval caseReturns the asymptotic domination number
for PE-PCD whose vertices are a uniform
data set in a finite interval
.
The PE proximity region is defined with respect to
with centrality parameter
c
in and expansion parameter
.
Pdom.num2PE1Dasy(c)
Pdom.num2PE1Dasy(c)
c |
A positive real number in |
The asymptotic domination number
for PE-PCD whose vertices are a uniform data set in a finite
interval
Elvan Ceyhan
Pdom.num2PE1D
and Pdom.num2PEtri
c<-.5 Pdom.num2PE1Dasy(c) Pdom.num2PE1Dasy(c=1/1.5) Pdom.num2PE1D(r=1.5,c=1/1.5,n=10) Pdom.num2PE1D(r=1.5,c=1/1.5,n=100)
c<-.5 Pdom.num2PE1Dasy(c) Pdom.num2PE1Dasy(c=1/1.5) Pdom.num2PE1D(r=1.5,c=1/1.5,n=10) Pdom.num2PE1D(r=1.5,c=1/1.5,n=100)
Returns domination number
for PE-PCD for uniform data in a triangle,
when the sample size
goes to
infinity (i.e., asymptotic probability of domination number
).
PE proximity regions are constructed
with respect to the triangle
with the expansion parameter and
-vertex regions where
is the vertex
that renders the asymptotic distribution of the domination
number non-degenerate for the given value of
r
in .
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011)).
Pdom.num2PEtri(r)
Pdom.num2PEtri(r)
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
domination number
for PE-PCD for uniform data on an triangle as the sample size
goes to infinity
Elvan Ceyhan
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, 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.
## Not run: Pdom.num2PEtri(r=1.5) Pdom.num2PEtri(r=1.4999999999) Pdom.num2PEtri(r=1.5) / Pdom.num2PEtri(r=1.4999999999) rseq<-seq(1.01,1.49999999999,l=20) #try also l=100 lrseq<-length(rseq) pg2<-vector() for (i in 1:lrseq) { pg2<-c(pg2,Pdom.num2PEtri(rseq[i])) } plot(rseq, pg2,type="l",xlab="r", ylab=expression(paste("P(", gamma, "=2)")), lty=1,xlim=range(rseq)+c(0,.01),ylim=c(0,1)) points(rbind(c(1.50,Pdom.num2PEtri(1.50))),pch=".",cex=3) ## End(Not run)
## Not run: Pdom.num2PEtri(r=1.5) Pdom.num2PEtri(r=1.4999999999) Pdom.num2PEtri(r=1.5) / Pdom.num2PEtri(r=1.4999999999) rseq<-seq(1.01,1.49999999999,l=20) #try also l=100 lrseq<-length(rseq) pg2<-vector() for (i in 1:lrseq) { pg2<-c(pg2,Pdom.num2PEtri(rseq[i])) } plot(rseq, pg2,type="l",xlab="r", ylab=expression(paste("P(", gamma, "=2)")), lty=1,xlim=range(rseq)+c(0,.01),ylim=c(0,1)) points(rbind(c(1.50,Pdom.num2PEtri(1.50))),pch=".",cex=3) ## End(Not run)
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 convex hull 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 2D data.
The function yields the test statistic,
-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 convex hull 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 triangles,
or segregation).
PE proximity region is constructed
with the expansion parameter and
-vertex regions
(i.e., the test is not available for a general center
at this version of the function).
**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 convex hull of Yp
points
are handled with a convex hull correction factor
(see the description below and the function code.)
However, in the special case of no Xp
points
in the convex hull 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 topic of research of the author of the package.
ch.cor
is for convex hull correction
(default is "no convex hull correction"
, i.e., ch.cor=FALSE
)
which is recommended
when both Xp
and Yp
have the same rectangular support.
See also (Ceyhan (2005); Ceyhan et al. (2006)) for more on the test based on the arc density of PE-PCDs.
PEarc.dens.test( Xp, Yp, r, ch.cor = FALSE, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
PEarc.dens.test( Xp, Yp, r, ch.cor = FALSE, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
ch.cor |
A logical argument for convex hull correction,
default |
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
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
CSarc.dens.test
and PEarc.dens.test1D
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="") PEarc.dens.test(Xp,Yp,r=1.25) PEarc.dens.test(Xp,Yp,r=1.25,ch=TRUE) #since Y points are not uniform, convex hull correction is invalid here ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="") PEarc.dens.test(Xp,Yp,r=1.25) PEarc.dens.test(Xp,Yp,r=1.25,ch=TRUE) #since Y points are not uniform, convex hull correction is invalid here ## End(Not run)
An object of class "htest"
.
This is an "htest"
(i.e., hypothesis test) function which performs a hypothesis test of uniformity of 1D data
in one interval based on the normal approximation of the arc density of the PE-PCD with expansion parameter
and centrality parameter
.
The function yields the test statistic, -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.
The null hypothesis is that data is
uniform in a finite interval (i.e., arc density of PE-PCD equals to its expected value under uniform
distribution) and alternative
could be two-sided, or left-sided (i.e., data is accumulated around the end
points) or right-sided (i.e., data is accumulated around the mid point or center ).
See also (Ceyhan (2012, 2016)).
PEarc.dens.test.int( Xp, int, r, c = 0.5, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
PEarc.dens.test.int( Xp, int, r, c = 0.5, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
Xp |
A set or |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
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
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.
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) n<-100 #try also n<-20, 1000 Xp<-runif(n,a,b) PEarc.dens.test.int(Xp,int,r,c) PEarc.dens.test.int(Xp,int,r,c,alt="g") PEarc.dens.test.int(Xp,int,r,c,alt="l") ## End(Not run)
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) n<-100 #try also n<-20, 1000 Xp<-runif(n,a,b) PEarc.dens.test.int(Xp,int,r,c) PEarc.dens.test.int(Xp,int,r,c,alt="g") PEarc.dens.test.int(Xp,int,r,c,alt="l") ## End(Not run)
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, -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 and centrality parameter
c
which yields
-vertex regions. More precisely, for a middle interval
, the center is
for the centrality parameter
.
**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.
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 )
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 )
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 |
c |
A positive real number which serves as the centrality parameter in PE 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
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.
PEarc.dens.test
, PEdom.num.binom.test1D
, and PEarc.dens.test.int
## Not run: 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) ## End(Not run)
## Not run: 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) ## End(Not run)
Returns the arc density of PE-PCD whose vertex set is the given 2D numerical data set, Xp
,
(some of its members are) in the tetrahedron th
.
PE proximity region is constructed with respect to the tetrahedron th
and
vertex regions are based on the center M
which is circumcenter ("CC"
) or
center of mass ("CM"
) of th
with default="CM"
.
For the number of arcs, loops are not
allowed so arcs are only possible for points inside the tetrahedron th
for this function.
th.cor
is a logical argument for tetrahedron correction (default is TRUE
), if TRUE
, only the points
inside the tetrahedron are considered (i.e., digraph induced by these vertices are considered) in computing
the arc density, otherwise all points are considered (for the number of vertices in the denominator of arc
density).
See also (Ceyhan (2005, 2010)).
PEarc.dens.tetra(Xp, th, r, M = "CM", th.cor = FALSE)
PEarc.dens.tetra(Xp, th, r, M = "CM", th.cor = FALSE)
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
th.cor |
A logical argument for computing the arc density for only the points inside the tetrahedron,
|
Arc density of PE-PCD whose vertices are the 2D numerical data set, Xp
;
PE proximity regions are defined with respect to the tetrahedron th
and M
-vertex regions
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
PEarc.dens.tri
and num.arcsPEtetra
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-10 #try also n<-20 set.seed(1) Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.5 num.arcsPEtetra(Xp,tetra,r,M) PEarc.dens.tetra(Xp,tetra,r,M) PEarc.dens.tetra(Xp,tetra,r,M,th.cor = FALSE) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-10 #try also n<-20 set.seed(1) Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.5 num.arcsPEtetra(Xp,tetra,r,M) PEarc.dens.tetra(Xp,tetra,r,M) PEarc.dens.tetra(Xp,tetra,r,M,th.cor = FALSE) ## End(Not run)
Returns the arc density of PE-PCD
whose vertex set is the given 2D numerical data set, Xp
,
(some of its members are) in the triangle tri
.
PE proximity regions is defined with respect to 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
circumcenter of tri
; default is , i.e.,
the center of mass of
tri
.
The function also provides arc density standardized
by the mean and asymptotic variance of the arc density
of PE-PCD for uniform data in the triangle tri
only when M
is the center of mass.
For the number of arcs, loops are not allowed.
tri.cor
is a logical argument for triangle correction
(default is TRUE
),
if TRUE
, only the points
inside the triangle are considered
(i.e., digraph induced by these vertices are considered) in computing
the arc density, otherwise all points are considered
(for the number of vertices in the denominator of arc density).
See also (Ceyhan (2005); Ceyhan et al. (2006)).
PEarc.dens.tri(Xp, tri, r, M = c(1, 1, 1), tri.cor = FALSE)
PEarc.dens.tri(Xp, tri, r, M = c(1, 1, 1), tri.cor = FALSE)
Xp |
A set of 2D points which constitute 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 |
tri.cor |
A logical argument
for computing the arc density for only the points inside the triangle,
|
A list
with the elements
arc.dens |
Arc density of PE-PCD
whose vertices are the 2D numerical data set, |
std.arc.dens |
Arc density standardized
by the mean and asymptotic variance of the arc
density of PE-PCD for uniform data in the triangle |
Elvan Ceyhan
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
ASarc.dens.tri
, CSarc.dens.tri
,
and num.arcsPEtri
## Not run: 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) num.arcsPEtri(Xp,Tr,r=1.5,M) PEarc.dens.tri(Xp,Tr,r=1.5,M) PEarc.dens.tri(Xp,Tr,r=1.5,M,tri.cor = TRUE) ## End(Not run)
## Not run: 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) num.arcsPEtri(Xp,Tr,r=1.5,M) PEarc.dens.tri(Xp,Tr,r=1.5,M) PEarc.dens.tri(Xp,Tr,r=1.5,M,tri.cor = TRUE) ## End(Not run)
Returns the domination number,
indices of a minimum dominating set of PE-PCD whose vertices are the data
points in Xp
in the multiple triangle case
and domination numbers for the Delaunay triangles
based on Yp
points.
PE proximity regions are defined
with respect to the Delaunay triangles based on Yp
points
with expansion parameter
and vertex regions in each triangle are
based on the center
in barycentric coordinates
in the interior of each Delaunay triangle or based on
circumcenter of each Delaunay triangle (default for
which is the center of mass of the
triangle). Each Delaunay triangle is first converted to
an (nonscaled) basic triangle so that
M
will be the
same type of center for each Delaunay triangle
(this conversion is not necessary when M
is ).
Convex hull of Yp
is partitioned
by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles
whose union constitutes the
convex hull of Yp
points).
Loops are allowed for the domination number.
See (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)) for more on the domination number of PE-PCDs. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
PEdom.num(Xp, Yp, r, M = c(1, 1, 1))
PEdom.num(Xp, Yp, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 3D point in barycentric coordinates
which serves as a center in the interior of each Delaunay
triangle or circumcenter of each Delaunay triangle
(for this, argument should be set as |
A list
with three elements
dom.num |
Domination number of the PE-PCD
whose vertices are |
#
mds |
A minimum dominating set of the PE-PCD
whose vertices are |
ind.mds |
The vector of data indices of the minimum dominating set
of the PE-PCD whose vertices are |
tri.dom.nums |
The vector of domination numbers of the PE-PCD components for the Delaunay triangles. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
PEdom.num.tri
, PEdom.num.tetra
,
dom.num.exact
, and dom.num.greedy
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 PEdom.num(Xp,Yp,r,M) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 PEdom.num(Xp,Yp,r,M) ## End(Not run)
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 convex hull of Yp
points against the alternatives
of segregation (where Xp
points cluster away from Yp
points
i.e., cluster around the centers of the Delaunay triangles)
and association (where Xp
points cluster around Yp
points)
based on the (asymptotic) binomial distribution of the
domination number of PE-PCD for uniform 2D data
in the convex hull of Yp
points.
The function yields the test statistic,
-value for the corresponding
alternative
,
the confidence interval,
estimate and null value for the parameter of interest
(which is domination number
),
and method and name of the data set used.
Under the null hypothesis of uniformity of Xp
points
in the convex hull of Yp
points, probability of success
(i.e., domination number
) equals
to its expected value under the uniform distribution) and
alternative
could be two-sided, or right-sided
(i.e., data is accumulated
around the Yp
points, or association)
or left-sided (i.e., data is accumulated
around the centers of the triangles, or segregation).
PE proximity region is constructed
with the expansion parameter and
-vertex regions
where
is a center
that yields non-degenerate asymptotic distribution
of the domination number.
The test statistic is based on the binomial distribution,
when success is defined as domination number being less than
or equal to 2 in the one triangle case
(i.e., number of failures is equal
to number of times restricted domination number = 3
in the triangles).
That is, the test statistic is based on the domination number
for Xp
points inside convex hull of Yp
points
for the PE-PCD and default convex hull correction, ch.cor
,
is FALSE
where M
is the center
that yields nondegenerate asymptotic distribution
for the domination number.
For this approximation to work,
number of Xp
points must be at least 7 times more than
number of Yp
points.
PE proximity region is constructed
with the expansion parameter and
-vertex regions
(i.e., the test is not available for a general center
at this version of the function).
**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 7 times more.
This test is more appropriate
when supports of Xp
and Yp
have a substantial overlap.
Currently, the Xp
points
outside the convex hull of Yp
points
are handled with a convex hull correction factor
(see the description below and the function code.)
Removing the conditioning
and extending it to the case of non-concurring supports is
an ongoing topic of research of the author of the package.
See also (Ceyhan (2011)).
PEdom.num.binom.test( Xp, Yp, r, ch.cor = FALSE, ndt = NULL, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
PEdom.num.binom.test( Xp, Yp, r, ch.cor = FALSE, ndt = NULL, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
ch.cor |
A logical argument for convex hull correction,
default |
ndt |
Number of Delaunay triangles based on |
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 |
estimate |
A |
null.value |
Hypothesized value for the parameter,
i.e., the null value for |
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
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.
## Not run: nx<-100; ny<-5 #try also nx<-1000; ny<-10 r<-1.4 #try also r<-1.5 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="") PEdom.num.binom.test(Xp,Yp,r) #try also #PEdom.num.binom.test(Xp,Yp,r,alt="l") and # PEdom.num.binom.test(Xp,Yp,r,alt="g") PEdom.num.binom.test(Xp,Yp,r,ch=TRUE) #or try ndt<-num.delaunay.tri(Yp) PEdom.num.binom.test(Xp,Yp,r,ndt=ndt) #values might differ due to the random of choice of the three centers M1,M2,M3 #for the non-degenerate asymptotic distribution of the domination number ## End(Not run)
## Not run: nx<-100; ny<-5 #try also nx<-1000; ny<-10 r<-1.4 #try also r<-1.5 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="") PEdom.num.binom.test(Xp,Yp,r) #try also #PEdom.num.binom.test(Xp,Yp,r,alt="l") and # PEdom.num.binom.test(Xp,Yp,r,alt="g") PEdom.num.binom.test(Xp,Yp,r,ch=TRUE) #or try ndt<-num.delaunay.tri(Yp) PEdom.num.binom.test(Xp,Yp,r,ndt=ndt) #values might differ due to the random of choice of the three centers M1,M2,M3 #for the non-degenerate asymptotic distribution of the domination number ## End(Not run)
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 within the partition intervals based on Yp
points (both residing in the
support interval ).
The test is for testing the spatial interaction between
Xp
and Yp
points.
The null hypothesis is uniformity of Xp
points on (by default)
where
and
are minimum and maximum of
Yp
points, respectively.
Yp
determines the end points of the intervals (i.e., partition the real line via its spacings called intervalization)
where end points are the order statistics of Yp
points.
The alternatives are segregation (where Xp
points cluster away from Yp
points i.e., cluster around the centers of the
partition intervals) and association (where Xp
points cluster around Yp
points). The test is based on the (asymptotic) binomial
distribution of the domination number of PE-PCD for uniform 1D data in the partition intervals based on Yp
points.
The test by default is restricted to the range of Yp
points, and so ignores Xp
points outside this range.
However, a correction for the Xp
points outside the range of Yp
points is available by setting
end.int.cor=TRUE
, which is recommended when both Xp
and Yp
have the same interval support.
The function yields the test statistic, -value for the corresponding
alternative, the confidence interval, estimate and null value for the parameter of interest (which is
domination number
), and method and name of the data set used.
Under the null hypothesis of uniformity of Xp
points in the intervals based on Yp
points, probability of success
(i.e., domination number
) equals to its expected value) 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 partition intervals, or segregation).
PE proximity region is constructed with the expansion parameter and centrality parameter
c
which yields
-vertex regions. More precisely, for a middle interval
, the center is
for the centrality parameter
c
.
For a given , the
expansion parameter
is taken to be
which yields non-degenerate asymptotic distribution of the
domination number.
The test statistic is based on the binomial distribution, when success is defined as domination number being less than or
equal to 1 in the one interval case
(i.e., number of successes is equal to domination number in the partition intervals).
That is, the test statistic is based on the domination number for
Xp
points inside range of Yp
points
(the domination numbers are summed over the middle intervals)
for the PE-PCD and default end interval correction,
end.int.cor
, is FALSE
and the center is chosen so that asymptotic distribution for the domination number is nondegenerate.
For this test to work,
Xp
must be at least 5 times more than Yp
points
(or Xp
must be at least 5 or more per partition interval).
Probability of success is the exact probability of success for the binomial distribution.
**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 7 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 an end interval correction factor
(see the description below and the function code.)
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.
See also (Ceyhan (2020)) for more on the uniformity test based on the arc density of PE-PCDs.
PEdom.num.binom.test1D( Xp, Yp, c = 0.5, support.int = NULL, end.int.cor = FALSE, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
PEdom.num.binom.test1D( Xp, Yp, 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 PE-PCD. |
Yp |
A set of 1D points which constitute the end points of the partition intervals. |
c |
A positive real number which serves as the centrality parameter in PE 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 |
estimate |
A |
null.value |
Hypothesized value for the parameter, i.e., the null value for |
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
Ceyhan E (2020). “Domination Number of an Interval Catch Digraph Family and Its Use for Testing Uniformity.” Statistics, 54(2), 310-339.
PEdom.num.binom.test
and PEdom.num1D
## Not run: a<-0; b<-10; supp<-c(a,b) c<-.4 r<-1/max(c,1-c) #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) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) PEdom.num.binom.test1D(Xp,Yp,c,supp) PEdom.num.binom.test1D(Xp,Yp,c,supp,alt="l") PEdom.num.binom.test1D(Xp,Yp,c,supp,alt="g") PEdom.num.binom.test1D(Xp,Yp,c,supp,end=TRUE) ## End(Not run)
## Not run: a<-0; b<-10; supp<-c(a,b) c<-.4 r<-1/max(c,1-c) #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) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) PEdom.num.binom.test1D(Xp,Yp,c,supp) PEdom.num.binom.test1D(Xp,Yp,c,supp,alt="l") PEdom.num.binom.test1D(Xp,Yp,c,supp,alt="g") PEdom.num.binom.test1D(Xp,Yp,c,supp,end=TRUE) ## End(Not run)
An object of class "htest"
(i.e., hypothesis test) function which performs a hypothesis test of
uniformity of Xp
points in the support interval ).
The support interval is partitioned as
(b-a)*(0:nint)/nint
where nint=round(sqrt(nx),0)
and nx
is number of Xp
points, and the test is for testing the uniformity of Xp
points in the interval .
The null hypothesis is uniformity of Xp
points on .
The alternative is deviation of distribution of
Xp
points from uniformity. The test is based on the (asymptotic) binomial
distribution of the domination number of PE-PCD for uniform 1D data in the partition intervals based on partition of .
The function yields the test statistic, -value for the corresponding
alternative, the confidence interval, estimate and null value for the parameter of interest (which is
domination number
), and method and name of the data set used.
Under the null hypothesis of uniformity of Xp
points in the support interval, probability of success
(i.e., domination number
) equals to its expected value) and
alternative
could be two-sided, or left-sided (i.e., data is accumulated around the end points of the partition
intervals of the support) or right-sided (i.e., data is accumulated around the centers of the partition intervals).
PE proximity region is constructed with the expansion parameter and centrality parameter
c
which yields
-vertex regions. More precisely
for the centrality parameter
c
and for a given , the
expansion parameter
is taken to be
which yields non-degenerate asymptotic distribution of the
domination number.
The test statistic is based on the binomial distribution, when success is defined as domination number being less than
or equal to 1 in the one interval case (i.e., number of failures is equal to number of times restricted domination number = 1
in the intervals).
That is, the test statistic is based on the domination number for Xp
points inside the partition intervals
for the PE-PCD. For this approach to work, Xp
must be large for each partition interval,
but 5 or more per partition interval seems to work in practice.
Probability of success is chosen in the following way for various parameter choices.
asy.bin
is a logical argument for the use of asymptotic probability of success for the binomial distribution,
default is asy.bin=FALSE
. When asy.bin=TRUE
, asymptotic probability of success for the binomial distribution is used.
When asy.bin=FALSE
, the finite sample probability of success for the binomial distribution is used with number
of trials equals to expected number of Xp
points per partition interval.
PEdom.num.binom.test1Dint( Xp, support.int, c = 0.5, asy.bin = FALSE, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
PEdom.num.binom.test1Dint( Xp, support.int, c = 0.5, asy.bin = FALSE, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
Xp |
A set of 1D points which constitute the vertices of the PE-PCD. |
support.int |
Support interval |
c |
A positive real number which serves as the centrality parameter in PE proximity region;
must be in |
asy.bin |
A logical argument for the use of asymptotic probability of success for the binomial distribution,
default |
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 |
estimate |
A |
null.value |
Hypothesized value for the parameter, i.e., the null value for |
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
There are no references for Rd macro \insertAllCites
on this help page.
PEdom.num.binom.test
, PEdom.num1D
and PEdom.num1Dnondeg
## Not run: a<-0; b<-10; supp<-c(a,b) c<-.4 r<-1/max(c,1-c) #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) Xp<-runif(nx,a,b) PEdom.num.binom.test1Dint(Xp,supp,c,alt="t") PEdom.num.binom.test1Dint(Xp,support.int = supp,c=c,alt="t") PEdom.num.binom.test1Dint(Xp,supp,c,alt="l") PEdom.num.binom.test1Dint(Xp,supp,c,alt="g") PEdom.num.binom.test1Dint(Xp,supp,c,alt="t",asy.bin = TRUE) ## End(Not run)
## Not run: a<-0; b<-10; supp<-c(a,b) c<-.4 r<-1/max(c,1-c) #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) Xp<-runif(nx,a,b) PEdom.num.binom.test1Dint(Xp,supp,c,alt="t") PEdom.num.binom.test1Dint(Xp,support.int = supp,c=c,alt="t") PEdom.num.binom.test1Dint(Xp,supp,c,alt="l") PEdom.num.binom.test1Dint(Xp,supp,c,alt="g") PEdom.num.binom.test1Dint(Xp,supp,c,alt="t",asy.bin = TRUE) ## End(Not run)
Returns the domination number,
indices of a minimum dominating set of PE-PCD
whose vertices are the data
points in Xp
in the multiple triangle case
and domination numbers for the Delaunay triangles based on Yp
points
when PE-PCD is constructed with vertex regions
based on non-degeneracy centers.
PE proximity regions are defined
with respect to the Delaunay triangles based on Yp
points
with expansion parameter
and vertex regions in each triangle are
based on the center
which is one of the 3 centers
that renders the asymptotic distribution of domination number
to be non-degenerate for a given value of
r
in
and
M
is center of mass for .
Convex hull of Yp
is partitioned
by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles
whose union constitutes the
convex hull of Yp
points).
Loops are allowed for the domination number.
See (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)) more on the domination number of PE-PCDs. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
PEdom.num.nondeg(Xp, Yp, r)
PEdom.num.nondeg(Xp, Yp, r)
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
A list
with three elements
dom.num |
Domination number of the PE-PCD
whose vertices are |
#
mds |
A minimum dominating set of the PE-PCD
whose vertices are |
ind.mds |
The data indices of the minimum dominating set of the PE-PCD
whose vertices are |
tri.dom.nums |
Domination numbers of the PE-PCD components for the Delaunay triangles. |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
PEdom.num.tri
, PEdom.num.tetra
,
dom.num.exact
, and dom.num.greedy
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; r<-1.5 #try also r<-2 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) PEdom.num.nondeg(Xp,Yp,r) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; r<-1.5 #try also r<-2 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) PEdom.num.nondeg(Xp,Yp,r) ## End(Not run)
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 convex hull of Yp
points against the alternatives
of segregation (where Xp
points cluster
away from Yp
points i.e.,
cluster around the centers of the Delaunay
triangles) and association (where Xp
points cluster
around Yp
points) based on the normal approximation
to the binomial distribution of the domination number of PE-PCD
for uniform 2D data
in the convex hull of Yp
points
The function yields the test statistic, -value
for the corresponding
alternative
,
the confidence interval, estimate and null value
for the parameter of interest
(which is domination number
),
and method and name of the data set used.
Under the null hypothesis of uniformity of Xp
points
in the convex hull of Yp
points, probability of success
(i.e., domination number
) equals
to its expected value under the uniform distribution) and
alternative
could be two-sided, or right-sided
(i.e., data is accumulated around the Yp
points, or association)
or left-sided (i.e., data is accumulated
around the centers of the triangles,
or segregation).
PE proximity region is constructed
with the expansion parameter
and
-vertex regions where M
is a center that yields non-degenerate asymptotic distribution of
the domination number.
The test statistic is based on the normal approximation
to the binomial distribution,
when success is defined as domination number being less than
or equal to 2 in the one triangle case
(i.e., number of failures is equal to number of times
restricted domination number = 3
in the triangles).
That is, the test statistic is
based on the domination number for Xp
points
inside convex hull of Yp
points for the PE-PCD and default convex hull correction, ch.cor
,
is FALSE
where M
is the center
that yields nondegenerate asymptotic distribution
for the domination number.
For this approximation to work,
number of Yp
points must be at least 5
(i.e., about 7 or more Delaunay triangles)
and number of Xp
points must be at least 7 times more than
the number of Yp
points.
See also (Ceyhan (2011)).
PEdom.num.norm.test( Xp, Yp, r, ch.cor = FALSE, ndt = NULL, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
PEdom.num.norm.test( Xp, Yp, r, ch.cor = FALSE, ndt = NULL, alternative = c("two.sided", "less", "greater"), conf.level = 0.95 )
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
ch.cor |
A logical argument for convex hull correction,
default |
ndt |
Number of Delaunay triangles based on |
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 domination number
at the given level |
estimate |
A |
null.value |
Hypothesized value for the parameter, i.e., the null value for expected domination number |
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
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.
## Not run: nx<-100; ny<-5 #try also nx<-1000; ny<-10 r<-1.5 #try also r<-2 or r<-1.25 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="") PEdom.num.norm.test(Xp,Yp,r) #try also PEdom.num.norm.test(Xp,Yp,r, alt="l") PEdom.num.norm.test(Xp,Yp,1.25,ch=TRUE) #or try ndt<-num.delaunay.tri(Yp) PEdom.num.norm.test(Xp,Yp,r,ndt=ndt) #values might differ due to the random of choice of the three centers M1,M2,M3 #for the non-degenerate asymptotic distribution of the domination number ## End(Not run)
## Not run: nx<-100; ny<-5 #try also nx<-1000; ny<-10 r<-1.5 #try also r<-2 or r<-1.25 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="") PEdom.num.norm.test(Xp,Yp,r) #try also PEdom.num.norm.test(Xp,Yp,r, alt="l") PEdom.num.norm.test(Xp,Yp,1.25,ch=TRUE) #or try ndt<-num.delaunay.tri(Yp) PEdom.num.norm.test(Xp,Yp,r,ndt=ndt) #values might differ due to the random of choice of the three centers M1,M2,M3 #for the non-degenerate asymptotic distribution of the domination number ## End(Not run)
Returns the domination number of PE-PCD whose vertices are the data points in Xp
.
PE proximity region is defined with respect to the tetrahedron th
with expansion parameter and
vertex regions are based on the center
M
which is circumcenter ("CC"
) or center of mass ("CM"
) of th
with default="CM"
.
See also (Ceyhan (2005, 2010)).
PEdom.num.tetra(Xp, th, r, M = "CM")
PEdom.num.tetra(Xp, th, r, M = "CM")
Xp |
A set of 3D points which constitute the vertices of the digraph. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
A list
with two elements
dom.num |
Domination number of PE-PCD with vertex set = |
mds |
A minimum dominating set of PE-PCD with vertex set = |
ind.mds |
Indices of the minimum dominating set |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-10 #try also n<-20 Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.25 PEdom.num.tetra(Xp,tetra,r,M) P1<-c(.5,.5,.5) PEdom.num.tetra(P1,tetra,r,M) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-10 #try also n<-20 Xp<-runif.tetra(n,tetra)$g M<-"CM" #try also M<-"CC" r<-1.25 PEdom.num.tetra(Xp,tetra,r,M) P1<-c(.5,.5,.5) PEdom.num.tetra(P1,tetra,r,M) ## End(Not run)
Returns the domination number of PE-PCD
whose vertices are the data points in Xp
.
PE proximity region is defined
with respect to the triangle tri
with expansion parameter and
vertex regions are constructed with center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the triangle
tri
or the circumcenter of tri
.
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011, 2012)).
PEdom.num.tri(Xp, tri, r, M = c(1, 1, 1))
PEdom.num.tri(Xp, tri, r, M = c(1, 1, 1))
Xp |
A set of 2D points which constitute the vertices of the digraph. |
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 |
A list
with two elements
dom.num |
Domination number of PE-PCD with vertex set = |
mds |
A minimum dominating set of PE-PCD with vertex set = |
ind.mds |
Indices of the minimum dominating set |
Elvan Ceyhan
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.
PEdom.num.nondeg
, PEdom.num
,
and PEdom.num1D
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2) Tr<-rbind(A,B,C) n<-10 #try also n<-20 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1,1,1) r<-1.4 PEdom.num.tri(Xp,Tr,r,M) IM<-inci.matPEtri(Xp,Tr,r,M) dom.num.greedy #try also dom.num.exact(IM) gr.gam<-dom.num.greedy(IM) gr.gam Xp[gr.gam$i,] PEdom.num.tri(Xp,Tr,r,M=c(.4,.4)) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2) Tr<-rbind(A,B,C) n<-10 #try also n<-20 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1,1,1) r<-1.4 PEdom.num.tri(Xp,Tr,r,M) IM<-inci.matPEtri(Xp,Tr,r,M) dom.num.greedy #try also dom.num.exact(IM) gr.gam<-dom.num.greedy(IM) gr.gam Xp[gr.gam$i,] PEdom.num.tri(Xp,Tr,r,M=c(.4,.4)) ## End(Not run)
Returns the domination number, a minimum dominating set of PE-PCD whose vertices are the 1D data set Xp
,
and the domination numbers for partition intervals based on Yp
.
Yp
determines the end points of the intervals (i.e., partition the real line via intervalization).
It also includes the domination numbers in the end intervals, with interval label 1 for the left end interval
and $|Yp|+1$ for the right end interval.
PE proximity region is constructed with expansion parameter and centrality parameter
.
PEdom.num1D(Xp, Yp, r, c = 0.5)
PEdom.num1D(Xp, Yp, r, c = 0.5)
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 intervals which partition the real line. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
A list
with three elements
dom.num |
Domination number of PE-PCD with vertex set |
mds |
A minimum dominating set of the PE-PCD. |
ind.mds |
The data indices of the minimum dominating set of the PE-PCD whose vertices are |
int.dom.nums |
Domination numbers of the PE-PCD components for the partition intervals. |
Elvan Ceyhan
## Not run: a<-0; b<-10 c<-.4 r<-2 #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) PEdom.num1D(Xp,Yp,r,c) PEdom.num1D(Xp,Yp,r,c=.25) PEdom.num1D(Xp,Yp,r=1.25,c) ## End(Not run)
## Not run: a<-0; b<-10 c<-.4 r<-2 #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) PEdom.num1D(Xp,Yp,r,c) PEdom.num1D(Xp,Yp,r,c=.25) PEdom.num1D(Xp,Yp,r=1.25,c) ## End(Not run)
Returns the domination number, a minimum dominating set of PE-PCD whose vertices are the 1D data set Xp
,
and the domination numbers for partition intervals based on Yp
when PE-PCD is constructed with vertex regions based on non-degeneracy centers.
Yp
determines the end points of the intervals
(i.e., partition the real line via intervalization).
PE proximity regions are defined with respect to the intervals based on Yp
points with
expansion parameter and
vertex regions in each interval are based on the centrality parameter
c
which is one of the 2 values of c
(i.e., )
that renders the asymptotic distribution of domination number
to be non-degenerate for a given value of
r
in
and
c
is center of mass for .
These values are called non-degeneracy centrality parameters
and the corresponding centers are called
nondegeneracy centers.
PEdom.num1Dnondeg(Xp, Yp, r)
PEdom.num1Dnondeg(Xp, Yp, r)
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 intervals which partition the real line. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
A list
with three elements
dom.num |
Domination number of PE-PCD with vertex set |
mds |
A minimum dominating set of the PE-PCD. |
ind.mds |
The data indices of the minimum dominating set of the PE-PCD
whose vertices are |
int.dom.nums |
Domination numbers of the PE-PCD components for the partition intervals. |
Elvan Ceyhan
## Not run: a<-0; b<-10 r<-1.5 #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) PEdom.num1Dnondeg(Xp,Yp,r) PEdom.num1Dnondeg(Xp,Yp,r=1.25) ## End(Not run)
## Not run: a<-0; b<-10 r<-1.5 #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) PEdom.num1Dnondeg(Xp,Yp,r) PEdom.num1Dnondeg(Xp,Yp,r=1.25) ## End(Not run)
An object of class "Lines"
.
Returns the equation, slope, intercept
,
and -coordinates of the line crossing
the point
p
and perpendicular to the line
passing through the points a
and b
with -coordinates are provided in
vector
x
.
perpline(p, a, b, x)
perpline(p, a, b, x)
p |
A 2D point at which the perpendicular line to line segment
joining |
a , b
|
2D points that determine the line segment (the line will be perpendicular to this line segment). |
x |
A scalar or a |
A list
with the elements
desc |
Description of the line
passing through point |
mtitle |
The |
points |
The input points |
x |
The input vector, can be a scalar or a |
y |
The output |
slope |
Slope of the line passing through point |
intercept |
Intercept of the line passing through point |
equation |
Equation of the line passing through point |
Elvan Ceyhan
## Not run: A<-c(1.1,1.2); B<-c(2.3,3.4); p<-c(.51,2.5) perpline(p,A,B,.45) pts<-rbind(A,B,p) xr<-range(pts[,1]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 plnAB<-perpline(p,A,B,x) plnAB summary(plnAB) plot(plnAB,asp=1) y<-plnAB$y Xlim<-range(x,pts[,1]) if (!is.na(y[1])) {Ylim<-range(y,pts[,2])} else {Ylim<-range(pts[,2])} xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 plot(A,asp=1,pch=".",xlab="",ylab="", main="Line Crossing p and Perpendicular to AB", xlim=Xlim+xd*c(-.5,.5),ylim=Ylim+yd*c(-.05,.05)) points(pts) txt.str<-c("A","B","p") text(pts+rbind(pf,pf,pf),txt.str) segments(A[1],A[2],B[1],B[2],lty=2) if (!is.na(y[1])) {lines(x,y,type="l",lty=1, xlim=Xlim,ylim=Ylim)} else {abline(v=p[1])} tx<-p[1]+abs(xf-p[1])/2; if (!is.na(y[1])) {ty<-perpline(p,A,B,tx)$y} else {ty=p[2]} text(tx,ty,"line perpendicular to AB\n and crossing p") ## End(Not run)
## Not run: A<-c(1.1,1.2); B<-c(2.3,3.4); p<-c(.51,2.5) perpline(p,A,B,.45) pts<-rbind(A,B,p) xr<-range(pts[,1]) xf<-(xr[2]-xr[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 plnAB<-perpline(p,A,B,x) plnAB summary(plnAB) plot(plnAB,asp=1) y<-plnAB$y Xlim<-range(x,pts[,1]) if (!is.na(y[1])) {Ylim<-range(y,pts[,2])} else {Ylim<-range(pts[,2])} xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] pf<-c(xd,-yd)*.025 plot(A,asp=1,pch=".",xlab="",ylab="", main="Line Crossing p and Perpendicular to AB", xlim=Xlim+xd*c(-.5,.5),ylim=Ylim+yd*c(-.05,.05)) points(pts) txt.str<-c("A","B","p") text(pts+rbind(pf,pf,pf),txt.str) segments(A[1],A[2],B[1],B[2],lty=2) if (!is.na(y[1])) {lines(x,y,type="l",lty=1, xlim=Xlim,ylim=Ylim)} else {abline(v=p[1])} tx<-p[1]+abs(xf-p[1])/2; if (!is.na(y[1])) {ty<-perpline(p,A,B,tx)$y} else {ty=p[2]} text(tx,ty,"line perpendicular to AB\n and crossing p") ## End(Not run)
p
and perpendicular to the plane spanned by 3D points a
,
b
, and c
An object of class "Lines3D"
.
Returns the equation, -,
-,
and
-coordinates of the line crossing 3D point
p
and perpendicular to the plane
spanned by 3D points a
, b
, and c
(i.e., the line is in the direction of normal vector
of this plane)
with the parameter t
being provided in vector
t
.
perpline2plane(p, a, b, c, t)
perpline2plane(p, a, b, c, t)
p |
A 3D point through which the straight line passes. |
a , b , c
|
3D points which determine the plane to
which the line passing through point |
t |
A scalar or a |
A list
with the elements
desc |
A description of the line |
mtitle |
The |
points |
The input points that determine the line and plane,
line crosses point |
pnames |
The names of the input points that determine the line and plane; line would be perpendicular to the plane. |
vecs |
The point |
vec.names |
The names of the point |
x , y , z
|
The |
tsq |
The scalar or the |
equation |
Equation of the line passing through point |
Elvan Ceyhan
Line3D
, paraline3D
,
and perpline
## Not run: P<-c(1,1,1); Q<-c(1,10,4); R<-c(1,1,3); S<-c(3,9,12) cf<-as.numeric(Plane(Q,R,S,1,1)$coeff) a<-cf[1]; b<-cf[2]; c<- -1; vecs<-rbind(Q,c(a,b,c)) pts<-rbind(P,Q,R,S) perpline2plane(P,Q,R,S,.1) tr<-range(pts,vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=5) #try also l=10, 20, or 100 pln2pl<-perpline2plane(P,Q,R,S,tsq) pln2pl summary(pln2pl) plot(pln2pl,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) xc<-pln2pl$x yc<-pln2pl$y zc<-pln2pl$z zr<-range(zc) zf<-(zr[2]-zr[1])*.2 Rv<- -c(a,b,c)*zf*5 Dr<-(Q+R+S)/3 pts2<-rbind(Q,R,S) xr<-range(pts2[,1],xc); yr<-range(pts2[,2],yc) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate xs<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 ys<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plQRS<-Plane(Q,R,S,xs,ys) z.grid<-plQRS$z Xlim<-range(xc,xs,pts[,1]) Ylim<-range(yc,ys,pts[,2]) Zlim<-range(zc,z.grid,pts[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::persp3D(z = z.grid, x = xs, y = ys, theta =225, phi = 30, main="Line Crossing P and \n Perpendicular to the Plane Defined by Q, R, S", col="lightblue", ticktype = "detailed", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05)) #plane spanned by points Q, R, S plot3D::lines3D(xc, yc, zc, bty = "g",pch = 20, cex = 2,col="red", ticktype = "detailed",add=TRUE) plot3D::arrows3D(Dr[1],Dr[2],Dr[3],Dr[1]+Rv[1],Dr[2]+Rv[2], Dr[3]+Rv[3], add=TRUE) plot3D::points3D(pts[,1],pts[,2],pts[,3],add=TRUE) plot3D::text3D(pts[,1],pts[,2],pts[,3],labels=c("P","Q","R","S"),add=TRUE) plot3D::arrows3D(P[1],P[2],P[3]-zf,P[1],P[2],P[3],lty=2, add=TRUE) plot3D::text3D(P[1],P[2],P[3]-zf,labels="initial point",add=TRUE) plot3D::text3D(P[1],P[2],P[3]+zf/2,labels="P",add=TRUE) plot3D::arrows3D(Dr[1],Dr[2],Dr[3],Dr[1]+Rv[1]/2,Dr[2]+Rv[2]/2, Dr[3]+Rv[3]/2,lty=2, add=TRUE) plot3D::text3D(Dr[1]+Rv[1]/2,Dr[2]+Rv[2]/2,Dr[3]+Rv[3]/2, labels="normal vector",add=TRUE) ## End(Not run)
## Not run: P<-c(1,1,1); Q<-c(1,10,4); R<-c(1,1,3); S<-c(3,9,12) cf<-as.numeric(Plane(Q,R,S,1,1)$coeff) a<-cf[1]; b<-cf[2]; c<- -1; vecs<-rbind(Q,c(a,b,c)) pts<-rbind(P,Q,R,S) perpline2plane(P,Q,R,S,.1) tr<-range(pts,vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=5) #try also l=10, 20, or 100 pln2pl<-perpline2plane(P,Q,R,S,tsq) pln2pl summary(pln2pl) plot(pln2pl,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) xc<-pln2pl$x yc<-pln2pl$y zc<-pln2pl$z zr<-range(zc) zf<-(zr[2]-zr[1])*.2 Rv<- -c(a,b,c)*zf*5 Dr<-(Q+R+S)/3 pts2<-rbind(Q,R,S) xr<-range(pts2[,1],xc); yr<-range(pts2[,2],yc) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate xs<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 ys<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plQRS<-Plane(Q,R,S,xs,ys) z.grid<-plQRS$z Xlim<-range(xc,xs,pts[,1]) Ylim<-range(yc,ys,pts[,2]) Zlim<-range(zc,z.grid,pts[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::persp3D(z = z.grid, x = xs, y = ys, theta =225, phi = 30, main="Line Crossing P and \n Perpendicular to the Plane Defined by Q, R, S", col="lightblue", ticktype = "detailed", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05)) #plane spanned by points Q, R, S plot3D::lines3D(xc, yc, zc, bty = "g",pch = 20, cex = 2,col="red", ticktype = "detailed",add=TRUE) plot3D::arrows3D(Dr[1],Dr[2],Dr[3],Dr[1]+Rv[1],Dr[2]+Rv[2], Dr[3]+Rv[3], add=TRUE) plot3D::points3D(pts[,1],pts[,2],pts[,3],add=TRUE) plot3D::text3D(pts[,1],pts[,2],pts[,3],labels=c("P","Q","R","S"),add=TRUE) plot3D::arrows3D(P[1],P[2],P[3]-zf,P[1],P[2],P[3],lty=2, add=TRUE) plot3D::text3D(P[1],P[2],P[3]-zf,labels="initial point",add=TRUE) plot3D::text3D(P[1],P[2],P[3]+zf/2,labels="P",add=TRUE) plot3D::arrows3D(Dr[1],Dr[2],Dr[3],Dr[1]+Rv[1]/2,Dr[2]+Rv[2]/2, Dr[3]+Rv[3]/2,lty=2, add=TRUE) plot3D::text3D(Dr[1]+Rv[1]/2,Dr[2]+Rv[2]/2,Dr[3]+Rv[3]/2, labels="normal vector",add=TRUE) ## End(Not run)
a
, b
, and c
An object of class "Planes"
.
Returns the equation and -coordinates of the plane
passing through three distinct 3D points
a
, b
, and c
with - and
-coordinates are provided
in vectors
x
and y
, respectively.
Plane(a, b, c, x, y)
Plane(a, b, c, x, y)
a , b , c
|
3D points that determine the plane (i.e., through which the plane is passing). |
x , y
|
Scalars or vectors of scalars
representing the |
A list
with the elements
desc |
A description of the plane |
points |
The input points |
x , y
|
The input vectors which constitutes the |
z |
The output |
coeff |
Coefficients of the plane (in the |
equation |
Equation of the plane in long form |
equation2 |
Equation of the plane in short form, to be inserted on the plot |
Elvan Ceyhan
## Not run: P1<-c(1,10,3); P2<-c(1,1,3); P3<-c(3,9,12) #also try P2=c(2,2,3) pts<-rbind(P1,P2,P3) Plane(P1,P2,P3,.1,.2) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plP123<-Plane(P1,P2,P3,x,y) plP123 summary(plP123) plot(plP123,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) z.grid<-plP123$z persp(x,y,z.grid, xlab="x",ylab="y",zlab="z", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") zr<-max(z.grid)-min(z.grid) Pts<-rbind(P1,P2,P3)+rbind(c(0,0,zr*.1),c(0,0,zr*.1),c(0,0,zr*.1)) Mn.pts<-apply(Pts,2,mean) plot3D::persp3D(z = z.grid, x = x, y = y,theta = 225, phi = 30, expand = 0.3, main = "Plane Crossing Points P1, P2, and P3", facets = FALSE, scale = TRUE) #plane spanned by points P1, P2, P3 #add the defining points plot3D::points3D(Pts[,1],Pts[,2],Pts[,3], add=TRUE) plot3D::text3D(Pts[,1],Pts[,2],Pts[,3], c("P1","P2","P3"),add=TRUE) plot3D::text3D(Mn.pts[1],Mn.pts[2],Mn.pts[3],plP123$equation,add=TRUE) #plot3D::polygon3D(Pts[,1],Pts[,2],Pts[,3], add=TRUE) ## End(Not run)
## Not run: P1<-c(1,10,3); P2<-c(1,1,3); P3<-c(3,9,12) #also try P2=c(2,2,3) pts<-rbind(P1,P2,P3) Plane(P1,P2,P3,.1,.2) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20, or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20, or 100 plP123<-Plane(P1,P2,P3,x,y) plP123 summary(plP123) plot(plP123,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) z.grid<-plP123$z persp(x,y,z.grid, xlab="x",ylab="y",zlab="z", theta = -30, phi = 30, expand = 0.5, col = "lightblue", ltheta = 120, shade = 0.05, ticktype = "detailed") zr<-max(z.grid)-min(z.grid) Pts<-rbind(P1,P2,P3)+rbind(c(0,0,zr*.1),c(0,0,zr*.1),c(0,0,zr*.1)) Mn.pts<-apply(Pts,2,mean) plot3D::persp3D(z = z.grid, x = x, y = y,theta = 225, phi = 30, expand = 0.3, main = "Plane Crossing Points P1, P2, and P3", facets = FALSE, scale = TRUE) #plane spanned by points P1, P2, P3 #add the defining points plot3D::points3D(Pts[,1],Pts[,2],Pts[,3], add=TRUE) plot3D::text3D(Pts[,1],Pts[,2],Pts[,3], c("P1","P2","P3"),add=TRUE) plot3D::text3D(Mn.pts[1],Mn.pts[2],Mn.pts[3],plP123$equation,add=TRUE) #plot3D::polygon3D(Pts[,1],Pts[,2],Pts[,3], add=TRUE) ## End(Not run)
Extrema
object
Plots the data points and extrema among these points together with the reference object (e.g., boundary of the support region)
## S3 method for class 'Extrema' plot(x, asp = NA, xlab = "", ylab = "", zlab = "", ...)
## S3 method for class 'Extrema' plot(x, asp = NA, xlab = "", ylab = "", zlab = "", ...)
x |
Object of class |
asp |
A |
xlab , ylab , zlab
|
Titles
for the |
... |
Additional parameters for |
None
print.Extrema
,
summary.Extrema
,
and print.summary.Extrema
## Not run: n<-10 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext plot(Ext,asp=1) ## End(Not run)
## Not run: n<-10 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext plot(Ext,asp=1) ## End(Not run)
Lines
object
Plots the line together with the defining points
.
## S3 method for class 'Lines' plot(x, asp = NA, xlab = "x", ylab = "y", ...)
## S3 method for class 'Lines' plot(x, asp = NA, xlab = "x", ylab = "y", ...)
x |
Object of class |
asp |
A |
xlab , ylab
|
Titles for the |
... |
Additional parameters for |
None
print.Lines
, summary.Lines
,
and print.summary.Lines
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=3) #try also l=10, 20 or 100 lnAB<-Line(A,B,x) lnAB plot(lnAB) ## End(Not run)
## Not run: A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=3) #try also l=10, 20 or 100 lnAB<-Line(A,B,x) lnAB plot(lnAB) ## End(Not run)
Lines3D
object
Plots the line together with the defining vectors (i.e., the initial and direction vectors).
## S3 method for class 'Lines3D' plot(x, xlab = "x", ylab = "y", zlab = "z", phi = 40, theta = 40, ...)
## S3 method for class 'Lines3D' plot(x, xlab = "x", ylab = "y", zlab = "z", phi = 40, theta = 40, ...)
x |
Object of class |
xlab , ylab , zlab
|
Titles for the |
theta , phi
|
The angles defining the viewing direction.
|
... |
Additional parameters for |
None
print.Lines3D
, summary.Lines3D
,
and print.summary.Lines3D
## Not run: P<-c(1,10,3); Q<-c(1,1,3); vecs<-rbind(P,Q) Line3D(P,Q,.1) Line3D(P,Q,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=3) #try also l=10, 20 or 100 lnPQ3D<-Line3D(P,Q,tsq) lnPQ3D plot(lnPQ3D) ## End(Not run)
## Not run: P<-c(1,10,3); Q<-c(1,1,3); vecs<-rbind(P,Q) Line3D(P,Q,.1) Line3D(P,Q,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=3) #try also l=10, 20 or 100 lnPQ3D<-Line3D(P,Q,tsq) lnPQ3D plot(lnPQ3D) ## End(Not run)
NumArcs
object
Plots the scatter plot of the data points (i.e. vertices of the PCDs) and the Delaunay tessellation of the nontarget points marked with number of arcs in the centroid of the Delaunay cells.
## S3 method for class 'NumArcs' plot(x, Jit = 0.1, ...)
## S3 method for class 'NumArcs' plot(x, Jit = 0.1, ...)
x |
Object of class |
Jit |
A positive real number
that determines the amount of jitter along the |
... |
Additional parameters for |
None
print.NumArcs
, summary.NumArcs
,
and print.summary.NumArcs
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs plot(Arcs) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs plot(Arcs) ## End(Not run)
Patterns
object
Plots the points generated from the pattern (color coded for each class) together with the study window
## S3 method for class 'Patterns' plot(x, asp = NA, xlab = "x", ylab = "y", ...)
## S3 method for class 'Patterns' plot(x, asp = NA, xlab = "x", ylab = "y", ...)
x |
Object of class |
asp |
A |
xlab , ylab
|
Titles for the |
... |
Additional parameters for |
None
print.Patterns
,
summary.Patterns
,
and print.summary.Patterns
## Not run: nx<-10; #try also 100 and 1000 ny<-5; #try also 1 e<-.15; Y<-cbind(runif(ny),runif(ny)) #with default bounding box (i.e., unit square) Xdt<-rseg.circular(nx,Y,e) Xdt plot(Xdt,asp=1) ## End(Not run)
## Not run: nx<-10; #try also 100 and 1000 ny<-5; #try also 1 e<-.15; Y<-cbind(runif(ny),runif(ny)) #with default bounding box (i.e., unit square) Xdt<-rseg.circular(nx,Y,e) Xdt plot(Xdt,asp=1) ## End(Not run)
PCDs
object
Plots the vertices and the arcs of the PCD together with the vertices and boundaries of the partition cells (i.e., intervals in the 1D case and triangles in the 2D case)
## S3 method for class 'PCDs' plot(x, Jit = 0.1, ...)
## S3 method for class 'PCDs' plot(x, Jit = 0.1, ...)
x |
Object of class |
Jit |
A positive real number
that determines the amount of jitter along the |
... |
Additional parameters for |
None
print.PCDs
,
summary.PCDs
,
and print.summary.PCDs
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs plot(Arcs) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs plot(Arcs) ## End(Not run)
Planes
object
Plots the plane together with the defining 3D points
.
## S3 method for class 'Planes' plot( x, x.grid.size = 10, y.grid.size = 10, xlab = "x", ylab = "y", zlab = "z", phi = 40, theta = 40, ... )
## S3 method for class 'Planes' plot( x, x.grid.size = 10, y.grid.size = 10, xlab = "x", ylab = "y", zlab = "z", phi = 40, theta = 40, ... )
x |
Object of class |
x.grid.size , y.grid.size
|
the size of the grids
for the |
xlab , ylab , zlab
|
Titles for the |
theta , phi
|
The angles defining the viewing direction,
default is 40 for both.
|
... |
Additional parameters for |
None
print.Planes
,
summary.Planes
,
and print.summary.Planes
## Not run: P<-c(1,10,3); Q<-c(1,1,3); C<-c(3,9,12) pts<-rbind(P,Q,C) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20 or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20 or 100 plPQC<-Plane(P,Q,C,x,y) plPQC plot(plPQC,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) ## End(Not run)
## Not run: P<-c(1,10,3); Q<-c(1,1,3); C<-c(3,9,12) pts<-rbind(P,Q,C) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20 or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20 or 100 plPQC<-Plane(P,Q,C,x,y) plPQC plot(plPQC,theta = 225, phi = 30, expand = 0.7, facets = FALSE, scale = TRUE) ## End(Not run)
TriLines
object
Plots the line together with the defining triangle.
## S3 method for class 'TriLines' plot(x, xlab = "x", ylab = "y", ...)
## S3 method for class 'TriLines' plot(x, xlab = "x", ylab = "y", ...)
x |
Object of class |
xlab , ylab
|
Titles for the |
... |
Additional parameters for |
None
print.TriLines
,
summary.TriLines
,
and print.summary.TriLines
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,l=3) lnACM<-lineA2CMinTe(x) lnACM plot(lnACM)
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,l=3) lnACM<-lineA2CMinTe(x) lnACM plot(lnACM)
Uniform
object
Plots the points generated from the uniform distribution together with the support region
## S3 method for class 'Uniform' plot(x, asp = NA, xlab = "x", ylab = "y", zlab = "z", ...)
## S3 method for class 'Uniform' plot(x, asp = NA, xlab = "x", ylab = "y", zlab = "z", ...)
x |
Object of class |
asp |
A |
xlab , ylab , zlab
|
Titles for the |
... |
Additional parameters for |
None
print.Uniform
,
summary.Uniform
,
and print.summary.Uniform
## Not run: n<-10 #try also 20, 100, and 1000 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) Xdt<-runif.tri(n,Tr) Xdt plot(Xdt,asp=1) ## End(Not run)
## Not run: n<-10 #try also 20, 100, and 1000 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) Xdt<-runif.tri(n,Tr) Xdt plot(Xdt,asp=1) ## End(Not run)
Plots the arcs of AS-PCD whose vertices are the data points in Xp
and Delaunay triangles based on Yp
points.
AS proximity regions are constructed with respect to the Delaunay triangles based on Yp
points, i.e.,
AS proximity regions are defined only for Xp
points inside the convex hull of Yp
points.
That is, arcs may exist for Xp
points only inside the convex hull of Yp
points.
Vertex regions are based on the center M="CC"
for circumcenter of each Delaunay triangle or in barycentric coordinates in the
interior of each Delaunay triangle; default is
M="CC"
i.e., circumcenter of each triangle.
See (Ceyhan (2005, 2010)) for more on AS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
plotASarcs( Xp, Yp, M = "CC", asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotASarcs( Xp, Yp, M = "CC", asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangulation. The Delaunay
triangles partition the convex hull of |
M |
The center of the triangle. |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
A plot of the arcs of the AS-PCD for a 2D data set Xp
where AS proximity regions
are defined with respect to the Delaunay triangles based on Yp
points; also plots the Delaunay triangles
based on Yp
points.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
plotASarcs.tri
, plotPEarcs.tri
, plotPEarcs
,
plotCSarcs.tri
, and plotCSarcs
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) #plotASarcs(Xp,Yp,M,xlab="",ylab="") plotASarcs(Xp,Yp,M,asp=1,xlab="",ylab="") plotASarcs(Xp,Yp[1:3,],M,xlab="",ylab="") ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) #plotASarcs(Xp,Yp,M,xlab="",ylab="") plotASarcs(Xp,Yp,M,asp=1,xlab="",ylab="") plotASarcs(Xp,Yp[1:3,],M,xlab="",ylab="") ## End(Not run)
Plots the arcs of AS-PCD whose vertices are the data points, Xp
and the triangle tri
. AS proximity regions
are constructed with respect to the triangle tri
, i.e., only for Xp
points inside the triangle tri
.
Vertex regions are based on the center M="CC"
for
circumcenter of tri
; or in Cartesian coordinates or
in barycentric
coordinates in the interior of the triangle
tri
; default is M="CC"
the circumcenter of tri
.
When the center is the circumcenter, CC
, the vertex regions are constructed based on the
orthogonal projections to the edges, while with any interior center M
, the vertex regions are constructed using the extensions
of the lines combining vertices with M
.
See also (Ceyhan (2005, 2010)).
plotASarcs.tri( Xp, tri, M = "CC", asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
plotASarcs.tri( Xp, tri, M = "CC", asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
Xp |
A set of 2D points which constitute the vertices of the AS-PCD. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
vert.reg |
A logical argument to add vertex regions to the plot, default is |
... |
Additional |
A plot of the arcs of the AS-PCD for a 2D data set Xp
where AS proximity regions
are defined with respect to the triangle tri
; also plots the triangle tri
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
plotASarcs
, plotPEarcs.tri
, plotPEarcs
,
plotCSarcs.tri
, and plotCSarcs
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g #try also Xp<-cbind(runif(n,1,2),runif(n,0,2)) M<-as.numeric(runif.tri(1,Tr)$g) #try also #M<-c(1.6,1.2) plotASarcs.tri(Xp,Tr,M,main="Arcs of AS-PCD",xlab="",ylab="") plotASarcs.tri(Xp,Tr,M,main="Arcs of AS-PCD",xlab="",ylab="",vert.reg = TRUE) # or try the default center #plotASarcs.tri(Xp,Tr,asp=1,main="arcs of AS-PCD",xlab="",ylab="",vert.reg = TRUE); #M = (arcsAStri(Xp,Tr)$param)$c #the part "M = as.numeric(arcsAStri(Xp,Tr)$param)" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) #but first we need to determine whether the center used for vertex regions is CC or not #see the description for more detail. CC<-circumcenter.tri(Tr) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } #now we add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.02,.02,.01,.05,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.05,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp<-runif.tri(n,Tr)$g #try also Xp<-cbind(runif(n,1,2),runif(n,0,2)) M<-as.numeric(runif.tri(1,Tr)$g) #try also #M<-c(1.6,1.2) plotASarcs.tri(Xp,Tr,M,main="Arcs of AS-PCD",xlab="",ylab="") plotASarcs.tri(Xp,Tr,M,main="Arcs of AS-PCD",xlab="",ylab="",vert.reg = TRUE) # or try the default center #plotASarcs.tri(Xp,Tr,asp=1,main="arcs of AS-PCD",xlab="",ylab="",vert.reg = TRUE); #M = (arcsAStri(Xp,Tr)$param)$c #the part "M = as.numeric(arcsAStri(Xp,Tr)$param)" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) #but first we need to determine whether the center used for vertex regions is CC or not #see the description for more detail. CC<-circumcenter.tri(Tr) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } #now we add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.02,.02,.01,.05,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.05,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Plots the Xp
points in and outside of the convex hull of Yp
points and also plots the AS proximity regions
for Xp
points and Delaunay triangles based on Yp
points.
AS proximity regions are constructed with respect
to the Delaunay triangles based on Yp
points (these triangles partition the convex hull of Yp
points),
i.e., AS proximity regions are only defined for Xp
points inside the convex hull of Yp
points.
Vertex regions are based on the center M="CC"
for circumcenter of each Delaunay triangle or in barycentric coordinates in the
interior of each Delaunay triangle; default is
M="CC"
i.e., circumcenter of each triangle.
See (Ceyhan (2005, 2010)) for more on AS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
plotASregs( Xp, Yp, M = "CC", main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotASregs( Xp, Yp, M = "CC", main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 2D points for which AS proximity regions are constructed. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangulation. The Delaunay
triangles partition the convex hull of |
M |
The center of the triangle. |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
Plot of the Xp
points, Delaunay triangles based on Yp
and also the AS proximity regions
for Xp
points inside the convex hull of Yp
points
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
plotASregs.tri
, plotPEregs.tri
, plotPEregs
,
plotCSregs.tri
, and plotCSregs
## Not run: nx<-10 ; ny<-5 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) #or M="CC" plotASregs(Xp,Yp,M,xlab="",ylab="") plotASregs(Xp,Yp[1:3,],M,xlab="",ylab="") Xp<-c(.5,.5) plotASregs(Xp,Yp,M,xlab="",ylab="") ## End(Not run)
## Not run: nx<-10 ; ny<-5 set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) #or M="CC" plotASregs(Xp,Yp,M,xlab="",ylab="") plotASregs(Xp,Yp[1:3,],M,xlab="",ylab="") Xp<-c(.5,.5) plotASregs(Xp,Yp,M,xlab="",ylab="") ## End(Not run)
Plots the points in and outside of the triangle tri
and also the AS proximity regions
for points in data set Xp
.
AS proximity regions are defined with respect to the triangle tri
,
so AS proximity regions are defined only for points inside the triangle tri
and
vertex regions are based on the center M="CC"
for
circumcenter of tri
; or in Cartesian coordinates or
in barycentric
coordinates in the interior of the triangle
tri
; default is M="CC"
the circumcenter of tri
.
When vertex regions are constructed with circumcenter, CC
, the vertex regions are constructed based on the
orthogonal projections to the edges, while with any interior center M
, the vertex regions are constructed using the extensions
of the lines combining vertices with M
.
See also (Ceyhan (2005, 2010)).
plotASregs.tri( Xp, tri, M = "CC", main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
plotASregs.tri( Xp, tri, M = "CC", main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
Xp |
A set of 2D points for which AS proximity regions are constructed. |
tri |
Three 2D points, stacked row-wise, each row representing a vertex of the triangle. |
M |
The center of the triangle. |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
vert.reg |
A logical argument to add vertex regions to the plot, default is |
... |
Additional |
Plot of the AS proximity regions for points inside the triangle tri
(and only the points outside tri
)
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
plotASregs
, plotPEregs.tri
, plotPEregs
,
plotCSregs.tri
, and plotCSregs
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp0<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also #M<-c(1.6,1.2); plotASregs.tri(Xp0,Tr,M,main="Proximity Regions for AS-PCD", xlab="",ylab="") Xp = Xp0[1,] plotASregs.tri(Xp,Tr,M,main="Proximity Regions for AS-PCD", xlab="",ylab="") #can plot the arcs of the AS-PCD #plotASarcs.tri(Xp,Tr,M,main="Arcs of AS-PCD",xlab="",ylab="") plotASregs.tri(Xp,Tr,M,main="Proximity Regions for AS-PCD", xlab="",ylab="",vert.reg=TRUE) # or try the default center #plotASregs.tri(Xp,Tr,main="Proximity Regions for AS-PCD", xlab="",ylab="",vert.reg=TRUE); M = (arcsAStri(Xp,Tr)$param)$c #the part "M = as.numeric(arcsAStri(Xp,Tr)$param)" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) #but first we need to determine whether the center used for vertex regions is CC or not #see the description for more detail. CC<-circumcenter.tri(Tr) #Arcs<-arcsAStri(Xp,Tr,M) #M = as.numeric(Arcs$parameters) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } #now we add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.03,.03,.03,.05,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.05,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp0<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also #M<-c(1.6,1.2); plotASregs.tri(Xp0,Tr,M,main="Proximity Regions for AS-PCD", xlab="",ylab="") Xp = Xp0[1,] plotASregs.tri(Xp,Tr,M,main="Proximity Regions for AS-PCD", xlab="",ylab="") #can plot the arcs of the AS-PCD #plotASarcs.tri(Xp,Tr,M,main="Arcs of AS-PCD",xlab="",ylab="") plotASregs.tri(Xp,Tr,M,main="Proximity Regions for AS-PCD", xlab="",ylab="",vert.reg=TRUE) # or try the default center #plotASregs.tri(Xp,Tr,main="Proximity Regions for AS-PCD", xlab="",ylab="",vert.reg=TRUE); M = (arcsAStri(Xp,Tr)$param)$c #the part "M = as.numeric(arcsAStri(Xp,Tr)$param)" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) #but first we need to determine whether the center used for vertex regions is CC or not #see the description for more detail. CC<-circumcenter.tri(Tr) #Arcs<-arcsAStri(Xp,Tr,M) #M = as.numeric(Arcs$parameters) if (isTRUE(all.equal(M,CC)) || identical(M,"CC")) {cent<-CC D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) cent.name<-"CC" } else {cent<-M cent.name<-"M" Ds<-prj.cent2edges(Tr,M) } #now we add the vertex names and annotation txt<-rbind(Tr,cent,Ds) xc<-txt[,1]+c(-.02,.03,.03,.03,.05,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.05,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Plots the arcs of Central Similarity Proximity Catch Digraph (CS-PCD) whose vertices are the data
points in Xp
in the multiple triangle case and the Delaunay triangles based on Yp
points.
CS proximity regions are defined with respect to the Delaunay triangles based on Yp
points with
expansion parameter and edge regions in each triangle are based on the center
in barycentric coordinates in the interior of each Delaunay triangle (default for
which is the center of mass of the triangle). Each Delaunay triangle is first converted to an (nonscaled)
basic triangle so that
M
will be the same type of center for each Delaunay triangle (this conversion is
not necessary when M
is ).
Convex hull of Yp
is partitioned by the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles whose union constitutes the
convex hull of Yp
points). Loops are not allowed so arcs are only possible
for points inside the convex hull of Yp
points.
See (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)) more on the CS-PCDs. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
plotCSarcs( Xp, Yp, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotCSarcs( Xp, Yp, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
M |
A 3D point in barycentric coordinates which serves as a center in the interior of each Delaunay
triangle, default for |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
A plot of the arcs of the CS-PCD whose vertices are the points in data set Xp
and the Delaunay
triangles based on Yp
points
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
plotCSarcs.tri
, plotASarcs
, and plotPEarcs
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) t<-1.5 #try also t<-2 plotCSarcs(Xp,Yp,t,M,xlab="",ylab="") ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) t<-1.5 #try also t<-2 plotCSarcs(Xp,Yp,t,M,xlab="",ylab="") ## End(Not run)
-coordinate) - one interval casePlots the arcs of CS-PCD whose vertices are the 1D points, Xp
. CS proximity regions are constructed with
expansion parameter and centrality parameter
and the intervals are based on the
interval
int
That is, data set
Xp
constitutes the vertices of the digraph and int
determines the end points of the interval.
For better visualization, a uniform jitter from (default for
) is added to
the
-direction where
Jit
equals to the range of Xp
, int
multiplied by
Jit
with default for ).
center
is a logical argument, if TRUE
, plot includes the center of the interval int
as a vertical line in the plot, else center of the interval is not plotted.
plotCSarcs.int( Xp, int, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
plotCSarcs.int( Xp, int, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
Xp |
A |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles of the |
xlim , ylim
|
Two |
center |
A logical argument, if |
... |
Additional |
A plot of the arcs of CS-PCD whose vertices are the 1D data set Xp
in which vertices are jittered
along -axis for better visualization.
Elvan Ceyhan
There are no references for Rd macro \insertAllCites
on this help page.
plotCSarcs1D
and plotPEarcs.int
tau<-2 c<-.4 a<-0; b<-10; int<-c(a,b) #n is number of X points n<-10; #try also n<-20; set.seed(1) xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) Xlim=range(Xp,int) Ylim=3*c(-1,1) jit<-.1 plotCSarcs.int(Xp,int,t=tau,c,jit,xlab="",ylab="",xlim=Xlim,ylim=Ylim) set.seed(1) plotCSarcs.int(Xp,int,t=1.5,c=.3,jit,xlab="",ylab="",center=TRUE) set.seed(1) plotCSarcs.int(Xp,int,t=2,c=.4,jit,xlab="",ylab="",center=TRUE)
tau<-2 c<-.4 a<-0; b<-10; int<-c(a,b) #n is number of X points n<-10; #try also n<-20; set.seed(1) xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) Xlim=range(Xp,int) Ylim=3*c(-1,1) jit<-.1 plotCSarcs.int(Xp,int,t=tau,c,jit,xlab="",ylab="",xlim=Xlim,ylim=Ylim) set.seed(1) plotCSarcs.int(Xp,int,t=1.5,c=.3,jit,xlab="",ylab="",center=TRUE) set.seed(1) plotCSarcs.int(Xp,int,t=2,c=.4,jit,xlab="",ylab="",center=TRUE)
Plots the arcs of CS-PCD whose vertices are the data points, Xp
and the triangle tri
. CS proximity regions
are constructed with respect to the triangle tri
with expansion parameter , i.e., arcs may exist only
for
Xp
points inside the triangle tri
.
Edge regions are based on center in Cartesian coordinates
or
in barycentric coordinates in the interior of the triangle
tri
; default
is i.e., the center of mass of
tri
.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
plotCSarcs.tri( Xp, tri, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, edge.reg = FALSE, ... )
plotCSarcs.tri( Xp, tri, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, edge.reg = FALSE, ... )
Xp |
A set of 2D points which constitute the vertices of the CS-PCD. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
edge.reg |
A logical argument to add edge regions to the plot, default is |
... |
Additional |
A plot of the arcs of the CS-PCD whose vertices are the points in data set Xp
and the triangle tri
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
plotCSarcs
, plotPEarcs.tri
and plotASarcs.tri
## Not run: 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) t<-1.5 #try also t<-2 plotCSarcs.tri(Xp,Tr,t,M,main="Arcs of CS-PCD with t=1.5",xlab="",ylab="",edge.reg = TRUE) # or try the default center #plotCSarcs.tri(Xp,Tr,t,main="Arcs of CS-PCD with t=1.5",xlab="",ylab="",edge.reg = TRUE); #M=(arcsCStri(Xp,Tr,r)$param)$c #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with edge regions) txt<-rbind(Tr,M) xc<-txt[,1]+c(-.02,.02,.02,.03) yc<-txt[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
## Not run: 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) t<-1.5 #try also t<-2 plotCSarcs.tri(Xp,Tr,t,M,main="Arcs of CS-PCD with t=1.5",xlab="",ylab="",edge.reg = TRUE) # or try the default center #plotCSarcs.tri(Xp,Tr,t,main="Arcs of CS-PCD with t=1.5",xlab="",ylab="",edge.reg = TRUE); #M=(arcsCStri(Xp,Tr,r)$param)$c #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with edge regions) txt<-rbind(Tr,M) xc<-txt[,1]+c(-.02,.02,.02,.03) yc<-txt[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
-coordinate) - multiple interval casePlots the arcs of CS-PCD whose vertices are the 1D points, Xp
. CS proximity regions are constructed with
expansion parameter and centrality parameter
and the intervals are based on
Yp
points (i.e.
the intervalization is based on Yp
points). That is, data set Xp
constitutes the vertices of the digraph and Yp
determines the end points of the intervals.
For better visualization, a uniform jitter from (default for
) is added to
the
-direction where
Jit
equals to the range of Xp
and Yp
multiplied by Jit
with default for ).
centers
is a logical argument, if TRUE
, plot includes the centers of the intervals
as vertical lines in the plot, else centers of the intervals are not plotted.
See also (Ceyhan (2016)).
plotCSarcs1D( Xp, Yp, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
plotCSarcs1D( Xp, Yp, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
Xp |
A |
Yp |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles of the |
xlim , ylim
|
Two |
centers |
A logical argument, if |
... |
Additional |
A plot of the arcs of CS-PCD whose vertices are the 1D data set Xp
in which vertices are jittered
along -axis for better visualization.
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
t<-1.5 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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.1 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) Xlim=range(Xp,Yp) Ylim=c(-.2,.2) jit<-.1 plotCSarcs1D(Xp,Yp,t,c,jit,xlab="",ylab="",xlim=Xlim,ylim=Ylim) set.seed(1) plotCSarcs1D(Xp,Yp,t=1.5,c=.3,jit,main="t=1.5, c=.3",xlab="",ylab="",centers=TRUE) set.seed(1) plotCSarcs1D(Xp,Yp,t=2,c=.3,jit,main="t=2, c=.3",xlab="",ylab="",centers=TRUE) set.seed(1) plotCSarcs1D(Xp,Yp,t=1.5,c=.5,jit,main="t=1.5, c=.5",xlab="",ylab="",centers=TRUE) set.seed(1) plotCSarcs1D(Xp,Yp,t=2,c=.5,jit,main="t=2, c=.5",xlab="",ylab="",centers=TRUE)
t<-1.5 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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.1 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) Xlim=range(Xp,Yp) Ylim=c(-.2,.2) jit<-.1 plotCSarcs1D(Xp,Yp,t,c,jit,xlab="",ylab="",xlim=Xlim,ylim=Ylim) set.seed(1) plotCSarcs1D(Xp,Yp,t=1.5,c=.3,jit,main="t=1.5, c=.3",xlab="",ylab="",centers=TRUE) set.seed(1) plotCSarcs1D(Xp,Yp,t=2,c=.3,jit,main="t=2, c=.3",xlab="",ylab="",centers=TRUE) set.seed(1) plotCSarcs1D(Xp,Yp,t=1.5,c=.5,jit,main="t=1.5, c=.5",xlab="",ylab="",centers=TRUE) set.seed(1) plotCSarcs1D(Xp,Yp,t=2,c=.5,jit,main="t=2, c=.5",xlab="",ylab="",centers=TRUE)
Plots the points in and outside of the Delaunay triangles based on Yp
points which partition
the convex hull of Yp
points and also plots the CS proximity regions
for Xp
points and the Delaunay triangles based on Yp
points.
CS proximity regions are constructed with respect to the Delaunay triangles with the expansion parameter .
Edge regions in each triangle is based on the center
in barycentric coordinates in the interior of each Delaunay triangle
(default for
which is the center of mass of the triangle).
See (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)) more on the CS proximity regions. Also see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
plotCSregs( Xp, Yp, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotCSregs( Xp, Yp, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 2D points for which CS proximity regions are constructed. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
Plot of the Xp
points, Delaunay triangles based on Yp
and also the CS proximity regions
for Xp
points inside the convex hull of Yp
points
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Ceyhan E (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
plotCSregs.tri
, plotASregs
and plotPEregs
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) tau<-1.5 #try also tau<-2 plotCSregs(Xp,Yp,tau,M,xlab="",ylab="") ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) tau<-1.5 #try also tau<-2 plotCSregs(Xp,Yp,tau,M,xlab="",ylab="") ## End(Not run)
-coordinate) - one interval casePlots the points in and outside of the interval int
and also the CS proximity regions (which are also intervals).
CS proximity regions are constructed with expansion parameter and centrality parameter
.
For better visualization, a uniform jitter from (default is
) times range of proximity
regions and
Xp
) is added to the -direction.
center
is a logical argument, if TRUE
, plot includes the
center of the interval as a vertical line in the plot, else center of the interval is not plotted.
plotCSregs.int( Xp, int, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
plotCSregs.int( Xp, int, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
Xp |
A set of 1D points for which CS proximity regions are to be constructed. |
int |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
center |
A logical argument, if |
... |
Additional |
Plot of the CS proximity regions for 1D points in or outside the interval int
Elvan Ceyhan
There are no references for Rd macro \insertAllCites
on this help page.
plotCSregs1D
, plotCSregs
, and plotPEregs.int
c<-.4 tau<-2 a<-0; b<-10; int<-c(a,b) n<-10 xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) #try also Xp<-runif(n,a-5,b+5) plotCSregs.int(7,int,tau,c,xlab="x",ylab="") plotCSregs.int(Xp,int,tau,c,xlab="x",ylab="") plotCSregs.int(17,int,tau,c,xlab="x",ylab="") plotCSregs.int(1,int,tau,c,xlab="x",ylab="") plotCSregs.int(4,int,tau,c,xlab="x",ylab="") plotCSregs.int(-7,int,tau,c,xlab="x",ylab="")
c<-.4 tau<-2 a<-0; b<-10; int<-c(a,b) n<-10 xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) #try also Xp<-runif(n,a-5,b+5) plotCSregs.int(7,int,tau,c,xlab="x",ylab="") plotCSregs.int(Xp,int,tau,c,xlab="x",ylab="") plotCSregs.int(17,int,tau,c,xlab="x",ylab="") plotCSregs.int(1,int,tau,c,xlab="x",ylab="") plotCSregs.int(4,int,tau,c,xlab="x",ylab="") plotCSregs.int(-7,int,tau,c,xlab="x",ylab="")
Plots the points in and outside of the triangle tri
and also the CS proximity regions which are also
triangular for points inside the triangle tri
with edge regions are based on the center of mass CM.
CS proximity regions are defined with respect to the triangle tri
with expansion parameter , so CS proximity regions are defined only for points inside the
triangle
tri
.
Edge regions are based on center in Cartesian coordinates
or
in barycentric coordinates in the interior of the triangle
tri
;
default is i.e., the center of mass of
tri
.
See also (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan (2014)).
plotCSregs.tri( Xp, tri, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, edge.reg = FALSE, ... )
plotCSregs.tri( Xp, tri, t, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, edge.reg = FALSE, ... )
Xp |
A set of 2D points for which CS proximity regions are constructed. |
tri |
A |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
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 |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
edge.reg |
A logical argument to add edge regions to the plot, default is |
... |
Additional |
Plot of the CS proximity regions for points inside the triangle tri
(and just the points outside tri
)
Elvan Ceyhan
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 (2014).
“Comparison of Relative Density of Two Random Geometric Digraph Families in Testing Spatial Clustering.”
TEST, 23(1), 100-134.
Ceyhan E, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
plotCSregs
, plotASregs.tri
and plotPEregs.tri
,
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp0<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) t<-.5 #try also t<-2 plotCSregs.tri(Xp0,Tr,t,M,main="Proximity Regions for CS-PCD", xlab="",ylab="") Xp = Xp0[1,] plotCSregs.tri(Xp,Tr,t,M,main="CS Proximity Regions with t=.5", xlab="",ylab="",edge.reg=TRUE) # or try the default center plotCSregs.tri(Xp,Tr,t,main="CS Proximity Regions with t=.5", xlab="",ylab="",edge.reg=TRUE); #M=(arcsCStri(Xp,Tr,r)$param)$c #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with edge regions) txt<-rbind(Tr,M) xc<-txt[,1]+c(-.02,.02,.02,.02) yc<-txt[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp0<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) t<-.5 #try also t<-2 plotCSregs.tri(Xp0,Tr,t,M,main="Proximity Regions for CS-PCD", xlab="",ylab="") Xp = Xp0[1,] plotCSregs.tri(Xp,Tr,t,M,main="CS Proximity Regions with t=.5", xlab="",ylab="",edge.reg=TRUE) # or try the default center plotCSregs.tri(Xp,Tr,t,main="CS Proximity Regions with t=.5", xlab="",ylab="",edge.reg=TRUE); #M=(arcsCStri(Xp,Tr,r)$param)$c #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with edge regions) txt<-rbind(Tr,M) xc<-txt[,1]+c(-.02,.02,.02,.02) yc<-txt[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
-coordinate)
- multiple interval casePlots the points in and outside of the intervals based on Yp
points and also the CS proximity regions
(which are also intervals).
CS proximity region is constructed with expansion parameter and
centrality parameter
. For better visualization, a uniform jitter from
(default is
) times range of
Xp
and Yp
and the proximity regions (intervals)) is added to the
-direction.
centers
is a logical argument, if TRUE
,
plot includes the centers of the intervals as vertical lines in the plot,
else centers of the intervals are not plotted.
See also (Ceyhan (2016)).
plotCSregs1D( Xp, Yp, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
plotCSregs1D( Xp, Yp, t, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
Xp |
A set of 1D points for which CS proximity regions are plotted. |
Yp |
A set of 1D points which constitute the end points of the intervals which partition the real line. |
t |
A positive real number which serves as the expansion parameter in CS proximity region. |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles of the |
xlim , ylim
|
Two |
centers |
A logical argument, if |
... |
Additional |
Plot of the CS proximity regions for 1D points located in the middle or end intervals
based on Yp
points
Elvan Ceyhan
Ceyhan E (2016). “Density of a Random Interval Catch Digraph Family and its Use for Testing Uniformity.” REVSTAT, 14(4), 349-394.
plotCSregs.int
and plotPEregs1D
t<-2 c<-.4 a<-0; b<-10; #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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.1 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) plotCSregs1D(Xp,Yp,t,c,xlab="",ylab="") plotCSregs1D(Xp,Yp+10,t,c,xlab="",ylab="")
t<-2 c<-.4 a<-0; b<-10; #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) xr<-range(a,b) xf<-(xr[2]-xr[1])*.1 Xp<-runif(nx,a-xf,b+xf) Yp<-runif(ny,a,b) plotCSregs1D(Xp,Yp,t,c,xlab="",ylab="") plotCSregs1D(Xp,Yp+10,t,c,xlab="",ylab="")
Plots the scatter plot of Xp
points together
with the Delaunay triangles based on the Yp
points.
Both sets of points are of 2D.
See (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
plotDelaunay.tri( Xp, Yp, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotDelaunay.tri( Xp, Yp, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 2D points whose scatterplot is to be plotted. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
A scatterplot of Xp
points
and the Delaunay triangulation of Yp
points.
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
plot.triSht
in interp
package
## Not run: nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="",main="X points and Delaunay Triangulation of Y points") ## End(Not run)
## Not run: nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) plotDelaunay.tri(Xp,Yp,xlab="",ylab="",main="X points and Delaunay Triangulation of Y points") ## End(Not run)
Yp
points
together with Xp
pointsPlots the Xp
points
and the intervals based on Yp
points.
plotIntervals( Xp, Yp, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotIntervals( Xp, Yp, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 1D points whose scatter-plot is provided. |
Yp |
A set of 1D points which constitute the end points of the intervals which partition the real line. |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
Plot of the intervals based on Yp
points
and also scatter plot of Xp
points
Elvan Ceyhan
plotPEregs1D
and plotDelaunay.tri
## Not run: a<-0; b<-10; #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) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) plotIntervals(Xp,Yp,xlab="",ylab="") ## End(Not run)
## Not run: a<-0; b<-10; #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) Xp<-runif(nx,a,b) Yp<-runif(ny,a,b) plotIntervals(Xp,Yp,xlab="",ylab="") ## End(Not run)
Plots the arcs of Proportional Edge Proximity Catch Digraph
(PE-PCD) whose vertices are the data
points in Xp
in the multiple triangle case
and the Delaunay triangles based on Yp
points.
PE proximity regions are defined
with respect to the Delaunay triangles based on Yp
points
with expansion parameter
and vertex regions in each triangle are
based on the center
in barycentric coordinates in the interior of each Delaunay triangle
or based on circumcenter of
each Delaunay triangle (default for
which is the center of mass of the triangle).
Each Delaunay triangle is first converted to
an (nonscaled) basic triangle so that
M
will be the same
type of center for each Delaunay triangle
(this conversion is not necessary
when M
is ).
Convex hull of Yp
is partitioned by
the Delaunay triangles based on Yp
points
(i.e., multiple triangles are the set of these Delaunay triangles
whose union constitutes the
convex hull of Yp
points).
Loops are not allowed so arcs are only possible
for points inside the convex hull of Yp
points.
See (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)) for more on the PE-PCDs. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
plotPEarcs( Xp, Yp, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotPEarcs( Xp, Yp, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 2D points which constitute the vertices of the PE-PCD. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 3D point in barycentric coordinates
which serves as a center in the interior of each Delaunay
triangle or circumcenter of each Delaunay triangle
(for this, argument should be set as |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
A plot of the arcs of the PE-PCD
whose vertices are the points in data set Xp
and the Delaunay
triangles based on Yp
points
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
plotPEarcs.tri
, plotASarcs
,
and plotCSarcs
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 plotPEarcs(Xp,Yp,r,M,xlab="",ylab="") ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 plotPEarcs(Xp,Yp,r,M,xlab="",ylab="") ## End(Not run)
-coordinate) - one interval casePlots the arcs of PE-PCD whose vertices are the 1D points, Xp
. PE proximity regions are constructed with
expansion parameter and centrality parameter
and the intervals are based on the interval
int
That is, data set
Xp
constitutes the vertices of the digraph and int
determines the end points of the interval.
For better visualization, a uniform jitter from (default for
) is added to
the
-direction where
Jit
equals to the range of Xp
, int
multiplied by
Jit
with default for ).
center
is a logical argument, if TRUE
, plot includes the center of the interval int
as a vertical line in the plot, else center of the interval is not plotted.
See also (Ceyhan (2012)).
plotPEarcs.int( Xp, int, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
plotPEarcs.int( Xp, int, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
Xp |
A |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles of the |
xlim , ylim
|
Two |
center |
A logical argument, if |
... |
Additional |
A plot of the arcs of PE-PCD whose vertices are the 1D data set Xp
in which vertices are jittered
along -axis for better visualization.
Elvan Ceyhan
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.
plotPEarcs1D
and plotCSarcs.int
## Not run: r<-2 c<-.4 a<-0; b<-10; int<-c(a,b) #n is number of X points n<-10; #try also n<-20; set.seed(1) xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) Xlim=range(Xp,int) Ylim=.1*c(-1,1) jit<-.1 set.seed(1) plotPEarcs.int(Xp,int,r=1.5,c=.3,jit,xlab="",ylab="",center=TRUE) set.seed(1) plotPEarcs.int(Xp,int,r=2,c=.3,jit,xlab="",ylab="",center=TRUE) ## End(Not run)
## Not run: r<-2 c<-.4 a<-0; b<-10; int<-c(a,b) #n is number of X points n<-10; #try also n<-20; set.seed(1) xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) Xlim=range(Xp,int) Ylim=.1*c(-1,1) jit<-.1 set.seed(1) plotPEarcs.int(Xp,int,r=1.5,c=.3,jit,xlab="",ylab="",center=TRUE) set.seed(1) plotPEarcs.int(Xp,int,r=2,c=.3,jit,xlab="",ylab="",center=TRUE) ## End(Not run)
Plots the arcs of PE-PCD whose vertices are the data points, Xp
and the triangle tri
.
PE proximity regions
are constructed with respect to the triangle tri
with expansion parameter , i.e., arcs may exist only
for
Xp
points inside the triangle tri
.
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
.
When the center is the circumcenter, CC
,
the vertex regions are constructed based on the
orthogonal projections to the edges,
while with any interior center M
,
the vertex regions are constructed using the extensions
of the lines combining vertices with M
.
M
-vertex regions are recommended spatial inference,
due to geometry invariance property of the arc density
and domination number the PE-PCDs based on uniform data.
See also (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)).
plotPEarcs.tri( Xp, tri, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
plotPEarcs.tri( Xp, tri, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
Xp |
A set of 2D points which constitute 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 |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
vert.reg |
A logical argument to add vertex regions to the plot,
default is |
... |
Additional |
A plot of the arcs of the PE-PCD
whose vertices are the points in data set Xp
and the triangle tri
Elvan Ceyhan
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
plotASarcs.tri
, plotCSarcs.tri
,
and plotPEarcs
## Not run: 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) or M<-circumcenter.tri(Tr) r<-1.5 #try also r<-2 plotPEarcs.tri(Xp,Tr,r,M,main="Arcs of PE-PCD with r = 1.5", xlab="",ylab="",vert.reg = TRUE) # or try the default center #plotPEarcs.tri(Xp,Tr,r,main="Arcs of PE-PCD with r = 1.5", #xlab="",ylab="",vert.reg = TRUE); #M=(arcsPEtri(Xp,Tr,r)$param)$cent #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) ifelse(isTRUE(all.equal(M,circumcenter.tri(Tr))), {Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2); cent.name="CC"}, {Ds<-prj.cent2edges(Tr,M); cent.name="M"}) txt<-rbind(Tr,M,Ds) xc<-txt[,1]+c(-.02,.02,.02,.02,.04,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.04,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: 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) or M<-circumcenter.tri(Tr) r<-1.5 #try also r<-2 plotPEarcs.tri(Xp,Tr,r,M,main="Arcs of PE-PCD with r = 1.5", xlab="",ylab="",vert.reg = TRUE) # or try the default center #plotPEarcs.tri(Xp,Tr,r,main="Arcs of PE-PCD with r = 1.5", #xlab="",ylab="",vert.reg = TRUE); #M=(arcsPEtri(Xp,Tr,r)$param)$cent #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) ifelse(isTRUE(all.equal(M,circumcenter.tri(Tr))), {Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2); cent.name="CC"}, {Ds<-prj.cent2edges(Tr,M); cent.name="M"}) txt<-rbind(Tr,M,Ds) xc<-txt[,1]+c(-.02,.02,.02,.02,.04,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.04,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
-coordinate) - multiple interval casePlots the arcs of PE-PCD whose vertices are the 1D points, Xp
. PE proximity regions are constructed with
expansion parameter and centrality parameter
and the intervals are based on
Yp
points (i.e.
the intervalization is based on Yp
points). That is, data set Xp
constitutes the vertices of the digraph and Yp
determines the end points of the intervals.
For better visualization, a uniform jitter from (default for
) is added to
the
-direction where
Jit
equals to the range of Xp
and Yp
multiplied by Jit
with default for ).
centers
is a logical argument, if TRUE
, plot includes the centers of the intervals
as vertical lines in the plot, else centers of the intervals are not plotted.
See also (Ceyhan (2012)).
plotPEarcs1D( Xp, Yp, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
plotPEarcs1D( Xp, Yp, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
Xp |
A |
Yp |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles of the |
xlim , ylim
|
Two |
centers |
A logical argument, if |
... |
Additional |
A plot of the arcs of PE-PCD whose vertices are the 1D data set Xp
in which vertices are jittered
along -axis for better visualization.
Elvan Ceyhan
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.
plotPEarcs.int
and plotCSarcs1D
## Not run: 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<-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) Xlim=range(Xp,Yp) Ylim=.1*c(-1,1) jit<-.1 set.seed(1) plotPEarcs1D(Xp,Yp,r=1.5,c=.3,jit,xlab="",ylab="",centers=TRUE) set.seed(1) plotPEarcs1D(Xp,Yp,r=2,c=.3,jit,xlab="",ylab="",centers=TRUE) ## End(Not run)
## Not run: 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<-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) Xlim=range(Xp,Yp) Ylim=.1*c(-1,1) jit<-.1 set.seed(1) plotPEarcs1D(Xp,Yp,r=1.5,c=.3,jit,xlab="",ylab="",centers=TRUE) set.seed(1) plotPEarcs1D(Xp,Yp,r=2,c=.3,jit,xlab="",ylab="",centers=TRUE) ## End(Not run)
Plots the points in and outside of the Delaunay triangles
based on Yp
points which partition
the convex hull of Yp
points and also plots the PE proximity regions
for Xp
points and the Delaunay triangles based on Yp
points.
PE proximity regions are constructed
with respect to the Delaunay triangles with the expansion parameter
.
Vertex regions in each triangle is
based on the center
in barycentric coordinates in the interior of each Delaunay triangle
or based on circumcenter of
each Delaunay triangle (default for
which is the center of mass of the triangle).
See (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)) for more on the PE proximity regions. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
plotPEregs( Xp, Yp, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
plotPEregs( Xp, Yp, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, ... )
Xp |
A set of 2D points for which PE proximity regions are constructed. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be |
M |
A 3D point in barycentric coordinates
which serves as a center in the interior of each Delaunay
triangle or circumcenter of each Delaunay triangle
(for this, argument should be set as |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
... |
Additional |
Plot of the Xp
points,
Delaunay triangles based on Yp
points
and also the PE proximity regions
for Xp
points inside the convex hull of Yp
points
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
plotPEregs.tri
, plotASregs
,
and plotCSregs
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 plotPEregs(Xp,Yp,r,M,xlab="",ylab="") ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25), runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-c(1,1,1) #try also M<-c(1,2,3) r<-1.5 #try also r<-2 plotPEregs(Xp,Yp,r,M,xlab="",ylab="") ## End(Not run)
-coordinate) - one interval casePlots the points in and outside of the interval int
and also the PE proximity regions (which are also intervals).
PE proximity regions are constructed with expansion parameter and centrality parameter
.
For better visualization, a uniform jitter from (default is
) times range of proximity
regions and
Xp
) is added to the -direction.
center
is a logical argument, if TRUE
, plot includes the
center of the interval as a vertical line in the plot, else center of the interval is not plotted.
See also (Ceyhan (2012)).
plotPEregs.int( Xp, int, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
plotPEregs.int( Xp, int, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, center = FALSE, ... )
Xp |
A set of 1D points for which PE proximity regions are to be constructed. |
int |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
center |
A logical argument, if |
... |
Additional |
Plot of the PE proximity regions for 1D points in or outside the interval int
Elvan Ceyhan
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.
plotPEregs1D
, plotCSregs.int
, and plotCSregs.int
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) n<-10 xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) #try also Xp<-runif(n,a-5,b+5) plotPEregs.int(Xp,int,r,c,xlab="x",ylab="") plotPEregs.int(7,int,r,c,xlab="x",ylab="") ## End(Not run)
## Not run: c<-.4 r<-2 a<-0; b<-10; int<-c(a,b) n<-10 xf<-(int[2]-int[1])*.1 Xp<-runif(n,a-xf,b+xf) #try also Xp<-runif(n,a-5,b+5) plotPEregs.int(Xp,int,r,c,xlab="x",ylab="") plotPEregs.int(7,int,r,c,xlab="x",ylab="") ## End(Not run)
Plots the points in and outside of the standard regular tetrahedron
and also the PE proximity regions
for points in data set
Xp
.
PE proximity regions are defined with respect to the standard regular tetrahedron
with expansion parameter
, so PE proximity regions are defined only for points inside
.
Vertex regions are based on circumcenter (which is equivalent to the center of mass for the standard
regular tetrahedron) of .
See also (Ceyhan (2005, 2010)).
plotPEregs.std.tetra( Xp, r, main = NULL, xlab = NULL, ylab = NULL, zlab = NULL, xlim = NULL, ylim = NULL, zlim = NULL, ... )
plotPEregs.std.tetra( Xp, r, main = NULL, xlab = NULL, ylab = NULL, zlab = NULL, xlim = NULL, ylim = NULL, zlim = NULL, ... )
Xp |
A set of 3D points for which PE proximity regions are constructed. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
main |
An overall title for the plot (default= |
xlab , ylab , zlab
|
titles for the |
xlim , ylim , zlim
|
Two |
... |
Additional |
Plot of the PE proximity regions for points inside the standard regular tetrahedron
(and just the points outside
)
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
plotPEregs
, plotASregs.tri
, plotASregs
,
plotCSregs.tri
, and plotCSregs
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) r<-1.5 n<-3 #try also n<-20 Xp<-runif.std.tetra(n)$g #try also Xp[,1]<-Xp[,1]+1 plotPEregs.std.tetra(Xp[1:3,],r) P1<-c(.1,.1,.1) plotPEregs.std.tetra(rbind(P1,P1),r) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) r<-1.5 n<-3 #try also n<-20 Xp<-runif.std.tetra(n)$g #try also Xp[,1]<-Xp[,1]+1 plotPEregs.std.tetra(Xp[1:3,],r) P1<-c(.1,.1,.1) plotPEregs.std.tetra(rbind(P1,P1),r) ## End(Not run)
Plots the points in and outside of the tetrahedron th
and also the PE proximity regions (which are also
tetrahedrons) for points inside the tetrahedron th
.
PE proximity regions are constructed with respect to
tetrahedron th
with expansion parameter and vertex regions are based on the center
M
which is
circumcenter ("CC"
) or center of mass ("CM"
) of th
with default="CM"
, so PE proximity regions are defined
only for points inside the tetrahedron th
.
See also (Ceyhan (2005, 2010)).
plotPEregs.tetra( Xp, th, r, M = "CM", main = NULL, xlab = NULL, ylab = NULL, zlab = NULL, xlim = NULL, ylim = NULL, zlim = NULL, ... )
plotPEregs.tetra( Xp, th, r, M = "CM", main = NULL, xlab = NULL, ylab = NULL, zlab = NULL, xlim = NULL, ylim = NULL, zlim = NULL, ... )
Xp |
A set of 3D points for which PE proximity regions are constructed. |
th |
A |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
M |
The center to be used in the construction of the vertex regions in the tetrahedron, |
main |
An overall title for the plot (default= |
xlab , ylab , zlab
|
Titles for the |
xlim , ylim , zlim
|
Two |
... |
Additional |
Plot of the PE proximity regions for points inside the tetrahedron th
(and just the points outside th
)
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
plotPEregs.std.tetra
, plotPEregs.tri
and plotPEregs.int
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) set.seed(1) tetra<-rbind(A,B,C,D)+matrix(runif(12,-.25,.25),ncol=3) #adding jitter to make it non-regular n<-5 #try also n<-20 Xp<-runif.tetra(n,tetra)$g #try also Xp[,1]<-Xp[,1]+1 M<-"CM" #try also M<-"CC" r<-1.5 plotPEregs.tetra(Xp,tetra,r) #uses the default M="CM" plotPEregs.tetra(Xp,tetra,r,M="CC") plotPEregs.tetra(Xp[1,],tetra,r) #uses the default M="CM" plotPEregs.tetra(Xp[1,],tetra,r,M) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) set.seed(1) tetra<-rbind(A,B,C,D)+matrix(runif(12,-.25,.25),ncol=3) #adding jitter to make it non-regular n<-5 #try also n<-20 Xp<-runif.tetra(n,tetra)$g #try also Xp[,1]<-Xp[,1]+1 M<-"CM" #try also M<-"CC" r<-1.5 plotPEregs.tetra(Xp,tetra,r) #uses the default M="CM" plotPEregs.tetra(Xp,tetra,r,M="CC") plotPEregs.tetra(Xp[1,],tetra,r) #uses the default M="CM" plotPEregs.tetra(Xp[1,],tetra,r,M) ## End(Not run)
Plots the points in and outside of the triangle tri
and also the PE proximity regions
for points in data set Xp
.
PE proximity regions are defined
with respect to the triangle tri
with expansion parameter ,
so PE proximity regions are defined only for points inside the
triangle
tri
.
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
.
When the center is the circumcenter, CC
,
the vertex regions are constructed based on the
orthogonal projections to the edges,
while with any interior center M
,
the vertex regions are constructed using the extensions
of the lines combining vertices with M
.
M
-vertex regions are recommended spatial inference,
due to geometry invariance property of the arc density
and domination number the PE-PCDs based on uniform data.
See also (Ceyhan (2005); Ceyhan et al. (2006); Ceyhan (2011)).
plotPEregs.tri( Xp, tri, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
plotPEregs.tri( Xp, tri, r, M = c(1, 1, 1), asp = NA, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, vert.reg = FALSE, ... )
Xp |
A set of 2D points for which PE proximity regions are constructed. |
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 |
asp |
A |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
vert.reg |
A logical argument to add vertex regions to the plot,
default is |
... |
Additional |
Plot of the PE proximity regions for points
inside the triangle tri
(and just the points outside tri
)
Elvan Ceyhan
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, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
plotPEregs
, plotASregs.tri
,
and plotCSregs.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp0<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) or M = circumcenter.tri(Tr) r<-1.5 #try also r<-2 plotPEregs.tri(Xp0,Tr,r,M) Xp = Xp0[1,] plotPEregs.tri(Xp,Tr,r,M) plotPEregs.tri(Xp,Tr,r,M, main="PE Proximity Regions with r = 1.5", xlab="",ylab="",vert.reg = TRUE) # or try the default center #plotPEregs.tri(Xp,Tr,r,main="PE Proximity Regions with r = 1.5",xlab="",ylab="",vert.reg = TRUE); #M=(arcsPEtri(Xp,Tr,r)$param)$c #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) ifelse(isTRUE(all.equal(M,circumcenter.tri(Tr))), {Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2); cent.name="CC"}, {Ds<-prj.cent2edges(Tr,M); cent.name<-"M"}) txt<-rbind(Tr,M,Ds) xc<-txt[,1]+c(-.02,.02,.02,.02,.03,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.05,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 set.seed(1) Xp0<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) or M = circumcenter.tri(Tr) r<-1.5 #try also r<-2 plotPEregs.tri(Xp0,Tr,r,M) Xp = Xp0[1,] plotPEregs.tri(Xp,Tr,r,M) plotPEregs.tri(Xp,Tr,r,M, main="PE Proximity Regions with r = 1.5", xlab="",ylab="",vert.reg = TRUE) # or try the default center #plotPEregs.tri(Xp,Tr,r,main="PE Proximity Regions with r = 1.5",xlab="",ylab="",vert.reg = TRUE); #M=(arcsPEtri(Xp,Tr,r)$param)$c #the part "M=(arcsPEtri(Xp,Tr,r)$param)$cent" is optional, #for the below annotation of the plot #can add vertex labels and text to the figure (with vertex regions) ifelse(isTRUE(all.equal(M,circumcenter.tri(Tr))), {Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2); cent.name="CC"}, {Ds<-prj.cent2edges(Tr,M); cent.name<-"M"}) txt<-rbind(Tr,M,Ds) xc<-txt[,1]+c(-.02,.02,.02,.02,.03,-0.03,-.01) yc<-txt[,2]+c(.02,.02,.02,.07,.02,.05,-.06) txt.str<-c("A","B","C",cent.name,"D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
-coordinate)
- multiple interval casePlots the points in and outside of the intervals based on Yp
points and also the PE proximity regions
(i.e., intervals). PE proximity region is constructed with expansion parameter and
centrality parameter
.
For better visualization, a uniform jitter from
(default is
) times range of
Xp
and Yp
and the proximity regions (intervals)) is added to the
-direction.
centers
is a logical argument, if TRUE
,
plot includes the centers of the intervals as vertical lines in the plot,
else centers of the intervals are not plotted.
See also (Ceyhan (2012)).
plotPEregs1D( Xp, Yp, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
plotPEregs1D( Xp, Yp, r, c = 0.5, Jit = 0.1, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, centers = FALSE, ... )
Xp |
A set of 1D points for which PE proximity regions are plotted. |
Yp |
A set of 1D points which constitute the end points of the intervals which partition the real line. |
r |
A positive real number which serves as the expansion parameter in PE proximity region;
must be |
c |
A positive real number in |
Jit |
A positive real number that determines the amount of jitter along the |
main |
An overall title for the plot (default= |
xlab , ylab
|
Titles for the |
xlim , ylim
|
Two |
centers |
A logical argument, if |
... |
Additional |
Plot of the PE proximity regions for 1D points located in the middle or end intervals
based on Yp
points
Elvan Ceyhan
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.
plotPEregs1D
, plotCSregs.int
, and plotCSregs1D
## Not run: 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<-15; 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) plotPEregs1D(Xp,Yp,r,c,xlab="x",ylab="") ## End(Not run)
## Not run: 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<-15; 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) plotPEregs1D(Xp,Yp,r,c,xlab="x",ylab="") ## End(Not run)
Extrema
object
Prints the call
of the object
of class "Extrema"
and also the type
(i.e. a brief description) of the extrema).
## S3 method for class 'Extrema' print(x, ...)
## S3 method for class 'Extrema' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "Extrema"
and also the type
(i.e. a brief description) of the extrema).
summary.Extrema
,
print.summary.Extrema
,
and plot.Extrema
## Not run: n<-10 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext print(Ext) typeof(Ext)) attributes(Ext) ## End(Not run)
## Not run: n<-10 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext print(Ext) typeof(Ext)) attributes(Ext) ## End(Not run)
Lines
object
Prints the call
of the object
of class "Lines"
and also the coefficients
of the line
(in the form: y = slope * x + intercept
).
## S3 method for class 'Lines' print(x, ...)
## S3 method for class 'Lines' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "Lines"
and the coefficients
of the line
(in the form: y = slope * x + intercept
).
summary.Lines
, print.summary.Lines
,
and plot.Lines
A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=3) #try also l=10, 20 or 100 lnAB<-Line(A,B,x) lnAB print(lnAB) typeof(lnAB) attributes(lnAB)
A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=3) #try also l=10, 20 or 100 lnAB<-Line(A,B,x) lnAB print(lnAB) typeof(lnAB) attributes(lnAB)
Lines3D
object
Prints the call
of the object
of class "Lines3D"
,
the coefficients
of the line
(in the form: x=x0 + A*t
, y=y0 + B*t
,
and z=z0 + C*t
),
and the initial point together with the direction vector.
## S3 method for class 'Lines3D' print(x, ...)
## S3 method for class 'Lines3D' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "Lines3D"
,
the coefficients
of the line
(in the form: x=x0 + A*t
, y=y0 + B*t
,
and z=z0 + C*t
),
and the initial point together with the direction vector.
summary.Lines3D
,
print.summary.Lines3D
,
and plot.Lines3D
## Not run: P<-c(1,10,3); Q<-c(1,1,3); vecs<-rbind(P,Q) Line3D(P,Q,.1) Line3D(P,Q,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=3) #try also l=10, 20 or 100 lnPQ3D<-Line3D(P,Q,tsq) lnPQ3D print(lnPQ3D) typeof(lnPQ3D) attributes(lnPQ3D) ## End(Not run)
## Not run: P<-c(1,10,3); Q<-c(1,1,3); vecs<-rbind(P,Q) Line3D(P,Q,.1) Line3D(P,Q,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=3) #try also l=10, 20 or 100 lnPQ3D<-Line3D(P,Q,tsq) lnPQ3D print(lnPQ3D) typeof(lnPQ3D) attributes(lnPQ3D) ## End(Not run)
NumArcs
object
Prints the call
of the object
of class "NumArcs"
and also the desc
(i.e. a brief description)
of the output.
## S3 method for class 'NumArcs' print(x, ...)
## S3 method for class 'NumArcs' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "NumArcs"
and also the desc
(i.e. a brief description)
of the output: number of arcs in the proximity catch digraph (PCD) and
related quantities in the induced subdigraphs for points in the Delaunay cells.
summary.NumArcs
, print.summary.NumArcs
,
and plot.NumArcs
## Not run: nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-"CC" #try also M<-c(1,1,1) Narcs<-num.arcsAS(Xp,Yp,M) Narcs print(Narcs) typeof(Narcs) attributes(Narcs) ## End(Not run)
## Not run: nx<-15; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx),runif(nx)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) M<-"CC" #try also M<-c(1,1,1) Narcs<-num.arcsAS(Xp,Yp,M) Narcs print(Narcs) typeof(Narcs) attributes(Narcs) ## End(Not run)
Patterns
object
Prints the call
of the object
of class "Patterns"
and also the type
(or description) of the pattern).
## S3 method for class 'Patterns' print(x, ...)
## S3 method for class 'Patterns' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "Patterns"
and also the type
(or description) of the pattern).
summary.Patterns
,
print.summary.Patterns
,
and plot.Patterns
## Not run: nx<-10; #try also 20, 100, and 1000 ny<-5; #try also 1 e<-.15; Y<-cbind(runif(ny),runif(ny)) #with default bounding box (i.e., unit square) Xdt<-rseg.circular(nx,Y,e) Xdt print(Xdt) typeof(Xdt)) attributes(Xdt) ## End(Not run)
## Not run: nx<-10; #try also 20, 100, and 1000 ny<-5; #try also 1 e<-.15; Y<-cbind(runif(ny),runif(ny)) #with default bounding box (i.e., unit square) Xdt<-rseg.circular(nx,Y,e) Xdt print(Xdt) typeof(Xdt)) attributes(Xdt) ## End(Not run)
PCDs
object
Prints the call
of the object
of class "PCDs"
and also the type
(i.e. a brief description)
of the proximity catch digraph (PCD.
## S3 method for class 'PCDs' print(x, ...)
## S3 method for class 'PCDs' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "PCDs"
and also the type
(i.e. a brief description)
of the proximity catch digraph (PCD.
summary.PCDs
,
print.summary.PCDs
,
and plot.PCDs
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs print(Arcs) typeof(Arcs)) attributes(Arcs) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs print(Arcs) typeof(Arcs)) attributes(Arcs) ## End(Not run)
Planes
object
Prints the call
of the object
of class "Planes"
and also the coefficients
of the plane
(in the form: z = A*x + B*y + C
).
## S3 method for class 'Planes' print(x, ...)
## S3 method for class 'Planes' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "Planes"
and the coefficients
of the plane
(in the form: z = A*x + B*y + C
).
summary.Planes
,
print.summary.Planes
,
and plot.Planes
## Not run: P<-c(1,10,3); Q<-c(1,1,3); C<-c(3,9,12) pts<-rbind(P,Q,C) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20 or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20 or 100 plPQC<-Plane(P,Q,C,x,y) plPQC print(plPQC) typeof(plPQC) attributes(plPQC) ## End(Not run)
## Not run: P<-c(1,10,3); Q<-c(1,1,3); C<-c(3,9,12) pts<-rbind(P,Q,C) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20 or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20 or 100 plPQC<-Plane(P,Q,C,x,y) plPQC print(plPQC) typeof(plPQC) attributes(plPQC) ## End(Not run)
Extrema
object
Prints some information about the object
.
## S3 method for class 'summary.Extrema' print(x, ...)
## S3 method for class 'summary.Extrema' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.Extrema
,
summary.Extrema
,
and plot.Extrema
Lines
object
Prints some information about the object
.
## S3 method for class 'summary.Lines' print(x, ...)
## S3 method for class 'summary.Lines' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.Lines
, summary.Lines
,
and plot.Lines
Lines3D
object
Prints some information about the object
.
## S3 method for class 'summary.Lines3D' print(x, ...)
## S3 method for class 'summary.Lines3D' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.Lines3D
,
summary.Lines3D
,
and plot.Lines3D
NumArcs
object
Prints some information about the object
.
## S3 method for class 'summary.NumArcs' print(x, ...)
## S3 method for class 'summary.NumArcs' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.NumArcs
, summary.NumArcs
,
and plot.NumArcs
Patterns
object
Prints some information about the object
.
## S3 method for class 'summary.Patterns' print(x, ...)
## S3 method for class 'summary.Patterns' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.Patterns
,
summary.Patterns
,
and plot.Patterns
PCDs
object
Prints some information about the object
.
## S3 method for class 'summary.PCDs' print(x, ...)
## S3 method for class 'summary.PCDs' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.PCDs
,
summary.PCDs
,
and plot.PCDs
Planes
object
Prints some information about the object
.
## S3 method for class 'summary.Planes' print(x, ...)
## S3 method for class 'summary.Planes' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.Planes
,
summary.Planes
,
and plot.Planes
TriLines
object
Prints some information about the object
## S3 method for class 'summary.TriLines' print(x, ...)
## S3 method for class 'summary.TriLines' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.TriLines
,
summary.TriLines
,
and plot.TriLines
Uniform
object
Prints some information about the object
.
## S3 method for class 'summary.Uniform' print(x, ...)
## S3 method for class 'summary.Uniform' print(x, ...)
x |
An |
... |
Additional parameters for |
None
print.Uniform
,
summary.Uniform
,
and plot.Uniform
TriLines
object
Prints the call
of the object
of class "TriLines"
and also the coefficients
of the line
(in the form: y = slope * x + intercept
),
and the vertices of the triangle
with respect to which the line is defined.
## S3 method for class 'TriLines' print(x, ...)
## S3 method for class 'TriLines' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "TriLines"
,
the coefficients
of the line
(in the form: y = slope * x + intercept
),
and the vertices of the triangle
with respect to which the line is defined.
summary.TriLines
,
print.summary.TriLines
,
and plot.TriLines
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,l=3) lnACM<-lineA2CMinTe(x) lnACM print(lnACM) typeof(lnACM) attributes(lnACM) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,l=3) lnACM<-lineA2CMinTe(x) lnACM print(lnACM) typeof(lnACM) attributes(lnACM) ## End(Not run)
Uniform
object
Prints the call
of the object
of class "Uniform"
and also the type
(i.e. a brief description) of the uniform distribution).
## S3 method for class 'Uniform' print(x, ...)
## S3 method for class 'Uniform' print(x, ...)
x |
A |
... |
Additional arguments for the S3 method |
The call
of the object
of class "Uniform"
and also the type
(i.e. a brief description) of the uniform distribution).
summary.Uniform
,
print.summary.Uniform
,
and plot.Uniform
## Not run: n<-10 #try also 20, 100, and 1000 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) Xdt<-runif.tri(n,Tr) Xdt print(Xdt) typeof(Xdt)) attributes(Xdt) ## End(Not run)
## Not run: n<-10 #try also 20, 100, and 1000 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) Xdt<-runif.tri(n,Tr) Xdt print(Xdt) typeof(Xdt)) attributes(Xdt) ## End(Not run)
Returns the projections from a general center
in Cartesian coordinates
or
in
barycentric coordinates in the interior of a triangle to the edges
on the extension of the lines joining
M
to the vertices (see the examples for an illustration).
See also (Ceyhan (2005, 2010)).
prj.cent2edges(tri, M)
prj.cent2edges(tri, M)
tri |
A |
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 |
Three projection points (stacked row-wise)
from a general center in Cartesian coordinates
or
in barycentric coordinates
in the interior of a triangle to the edges on
the extension of the lines joining
M
to the vertices;
row is the projection point into edge
, for
.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
prj.cent2edges.basic.tri
and prj.nondegPEcent2edges
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) Ds<-prj.cent2edges(Tr,M) #try also prj.cent2edges(Tr,M=c(1,1)) Ds Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Projection of Center M on the edges of a triangle",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.04,-.02) yc<-txt[,2]+c(-.02,.04,.04,-.06) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.0) Ds<-prj.cent2edges(Tr,M) #try also prj.cent2edges(Tr,M=c(1,1)) Ds Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Projection of Center M on the edges of a triangle",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.04,-.02) yc<-txt[,2]+c(-.02,.04,.04,-.06) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Returns the projections
from a general center in Cartesian coordinates
or
in
barycentric coordinates
in the interior of the standard basic triangle form
to the edges on the extension of the lines joining
M
to the vertices (see the examples for an illustration).
In the standard basic triangle form ,
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010)).
prj.cent2edges.basic.tri(c1, c2, M)
prj.cent2edges.basic.tri(c1, c2, M)
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle form
adjacent to the shorter edges; |
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates which serves as a center in the interior of the standard basic triangle form. |
Three projection points (stacked row-wise)
from a general center in Cartesian coordinates
or
in barycentric coordinates
in the interior of a standard basic triangle form to the edges on
the extension of the lines joining
M
to the vertices;
row is the projection point into edge
, for
.
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
prj.cent2edges
and prj.nondegPEcent2edges
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Ds<-prj.cent2edges.basic.tri(c1,c2,M) Ds Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates plot(Tb,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.1,.1),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) L<-rbind(M,M,M); R<-Tb segments(L[,1], L[,2], R[,1], R[,2], lty = 3,col=2) xc<-Tb[,1]+c(-.04,.05,.04) yc<-Tb[,2]+c(.02,.02,.03) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.03,-.03,0) yc<-txt[,2]+c(-.02,.02,.02,-.03) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Ds<-prj.cent2edges.basic.tri(c1,c2,M) Ds Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates plot(Tb,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.1,.1),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) L<-rbind(M,M,M); R<-Tb segments(L[,1], L[,2], R[,1], R[,2], lty = 3,col=2) xc<-Tb[,1]+c(-.04,.05,.04) yc<-Tb[,2]+c(.02,.02,.03) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.03,-.03,0) yc<-txt[,2]+c(-.02,.02,.02,-.03) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Returns the projections
from center cent
to the edges on the extension of the lines
joining cent
to the vertices
in the triangle, tri
. Here M is one of the three centers
which gives nondegenerate asymptotic distribution
of the domination number of PE-PCD for uniform data in tri
for a given expansion parameter r
in .
The center label
cent
values 1,2,3
correspond
to the vertices ,
,
and
(i.e., row numbers in the
output of
center.nondegPE(tri,r)
); default for cent
is 1.
cent
becomes center of mass for
.
See also (Ceyhan (2005); Ceyhan and Priebe (2007); Ceyhan (2011)).
prj.nondegPEcent2edges(tri, r, cent = 1)
prj.nondegPEcent2edges(tri, r, cent = 1)
tri |
A |
r |
A positive real number which serves
as the expansion parameter in PE proximity region;
must be in |
cent |
Index of the center (as |
Three projection points (stacked row-wise)
from one of the centers (as corresponding to
)
which gives nondegenerate asymptotic distribution of
the domination number of PE-PCD for
uniform data in
tri
for expansion parameter r
in .
Elvan Ceyhan
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, 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.
prj.cent2edges.basic.tri
and prj.cent2edges
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); r<-1.35 prj.nondegPEcent2edges(Tr,r,cent=2) Ms<-center.nondegPE(Tr,r) M1=Ms[1,] Ds<-prj.nondegPEcent2edges(Tr,r,cent=1) Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Projections from a non-degeneracy center\n to the edges of the triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Ms,pch=".",col=1) polygon(Ms,lty = 2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(-.02,.04,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-Ms xc<-txt[,1]+c(-.02,.04,-.04) yc<-txt[,2]+c(-.02,.04,.04) txt.str<-c("M1","M2","M3") text(xc,yc,txt.str) points(Ds,pch=4,col=2) L<-rbind(M1,M1,M1); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2,lwd=2,col=4) txt<-Ds xc<-txt[,1]+c(-.02,.04,-.04) yc<-txt[,2]+c(-.02,.04,.04) txt.str<-c("D1","D2","D3") text(xc,yc,txt.str) prj.nondegPEcent2edges(Tr,r,cent=3) #gives an error message if center index, cent, is different from 1, 2 or 3 prj.nondegPEcent2edges(Tr,r=1.49,cent=2) #gives an error message if r>1.5 ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); r<-1.35 prj.nondegPEcent2edges(Tr,r,cent=2) Ms<-center.nondegPE(Tr,r) M1=Ms[1,] Ds<-prj.nondegPEcent2edges(Tr,r,cent=1) Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Projections from a non-degeneracy center\n to the edges of the triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Ms,pch=".",col=1) polygon(Ms,lty = 2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(-.02,.04,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-Ms xc<-txt[,1]+c(-.02,.04,-.04) yc<-txt[,2]+c(-.02,.04,.04) txt.str<-c("M1","M2","M3") text(xc,yc,txt.str) points(Ds,pch=4,col=2) L<-rbind(M1,M1,M1); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2,lwd=2,col=4) txt<-Ds xc<-txt[,1]+c(-.02,.04,-.04) yc<-txt[,2]+c(-.02,.04,.04) txt.str<-c("D1","D2","D3") text(xc,yc,txt.str) prj.nondegPEcent2edges(Tr,r,cent=3) #gives an error message if center index, cent, is different from 1, 2 or 3 prj.nondegPEcent2edges(Tr,r=1.49,cent=2) #gives an error message if r>1.5 ## End(Not run)
Returns the radii of the balls centered at x
points
where radius of an x
point equals to the minimum distance
to y
points (i.e., distance to the closest y
point).
That is, for each x
point .
x
and y
points must be of the same dimension.
radii(x, y)
radii(x, y)
x |
A set of |
y |
A set of |
A list
with three elements
rad |
A |
index.of.clYp |
A |
closest.Yp |
A |
Elvan Ceyhan
## Not run: nx<-10 ny<-5 X<-cbind(runif(nx),runif(nx)) Y<-cbind(runif(ny),runif(ny)) Rad<-radii(X,Y) Rad rd<-Rad$rad Xlim<-range(X[,1]-rd,X[,1]+rd,Y[,1]) Ylim<-range(X[,2]-rd,X[,2]+rd,Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(Y),asp=1,pch=16,col=2,xlab="",ylab="", main="Circles Centered at Class X Points with \n Radius Equal to the Distance to Closest Y Point", axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(rbind(X)) interp::circles(X[,1],X[,2],Rad$rad,lty=1,lwd=1,col=4) #For 1D data nx<-10 ny<-5 Xm<-as.matrix(X) Ym<-as.matrix(Y) radii(Xm,Ym) #this works as Xm and Ym are treated as 1D data sets #but will give error if radii(X,Y) is used #as X and Y are treated as vectors (i.e., points) #For 3D data nx<-10 ny<-5 X<-cbind(runif(nx),runif(nx),runif(nx)) Y<-cbind(runif(ny),runif(ny),runif(ny)) radii(X,Y) ## End(Not run)
## Not run: nx<-10 ny<-5 X<-cbind(runif(nx),runif(nx)) Y<-cbind(runif(ny),runif(ny)) Rad<-radii(X,Y) Rad rd<-Rad$rad Xlim<-range(X[,1]-rd,X[,1]+rd,Y[,1]) Ylim<-range(X[,2]-rd,X[,2]+rd,Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(Y),asp=1,pch=16,col=2,xlab="",ylab="", main="Circles Centered at Class X Points with \n Radius Equal to the Distance to Closest Y Point", axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(rbind(X)) interp::circles(X[,1],X[,2],Rad$rad,lty=1,lwd=1,col=4) #For 1D data nx<-10 ny<-5 Xm<-as.matrix(X) Ym<-as.matrix(Y) radii(Xm,Ym) #this works as Xm and Ym are treated as 1D data sets #but will give error if radii(X,Y) is used #as X and Y are treated as vectors (i.e., points) #For 3D data nx<-10 ny<-5 X<-cbind(runif(nx),runif(nx),runif(nx)) Y<-cbind(runif(ny),runif(ny),runif(ny)) radii(X,Y) ## End(Not run)
Returns the radius for the ball centered
at point p
with radius=min distance to Y
points.
That is, for the point p
(i.e., distance from
p
to the closest Y
point).
The point p
and Y
points must be of same dimension.
radius(p, Y)
radius(p, Y)
p |
A |
Y |
A set of |
A list
with three elements
rad |
Radius value for the point, |
index.of.clYpnt |
Index of the closest |
closest.Ypnt |
The closest |
Elvan Ceyhan
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); ny<-10 Y<-cbind(runif(ny),runif(ny)) radius(A,Y) nx<-10 X<-cbind(runif(nx),runif(nx)) rad<-rep(0,nx) for (i in 1:nx) rad[i]<-radius(X[i,],Y)$rad Xlim<-range(X[,1]-rad,X[,1]+rad,Y[,1]) Ylim<-range(X[,2]-rad,X[,2]+rad,Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(Y),asp=1,pch=16,col=2,xlab="",ylab="", main="Circles Centered at Class X Points with \n Radius Equal to the Distance to Closest Y Point", axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(rbind(X)) interp::circles(X[,1],X[,2],rad,lty=1,lwd=1,col=4) #For 1D data ny<-5 Y<-runif(ny) Ym = as.matrix(Y) radius(1,Ym) #this works as Y is treated as 1D data sets #but will give error if radius(1,Y) is used #as Y is treated as a vector (i.e., points) #For 3D data ny<-5 X<-runif(3) Y<-cbind(runif(ny),runif(ny),runif(ny)) radius(X,Y) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); ny<-10 Y<-cbind(runif(ny),runif(ny)) radius(A,Y) nx<-10 X<-cbind(runif(nx),runif(nx)) rad<-rep(0,nx) for (i in 1:nx) rad[i]<-radius(X[i,],Y)$rad Xlim<-range(X[,1]-rad,X[,1]+rad,Y[,1]) Ylim<-range(X[,2]-rad,X[,2]+rad,Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(rbind(Y),asp=1,pch=16,col=2,xlab="",ylab="", main="Circles Centered at Class X Points with \n Radius Equal to the Distance to Closest Y Point", axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(rbind(X)) interp::circles(X[,1],X[,2],rad,lty=1,lwd=1,col=4) #For 1D data ny<-5 Y<-runif(ny) Ym = as.matrix(Y) radius(1,Ym) #this works as Y is treated as 1D data sets #but will give error if radius(1,Y) is used #as Y is treated as a vector (i.e., points) #For 3D data ny<-5 X<-runif(3) Y<-cbind(runif(ny),runif(ny),runif(ny)) radius(X,Y) ## End(Not run)
An object of class "Patterns"
.
Generates n
2D points uniformly
in
(
and
are denoted as
a1
and b1
as arguments)
where with
being number of
Yp
points
for various values of e
under the association pattern
and is the ball centered at
with radius
e
.
e
must be positive
and very large values of e
provide patterns close to CSR.
a1
is defaulted
to the minimum of the -coordinates of the
Yp
points,
a2
is defaulted
to the maximum of the -coordinates of the
Yp
points,
b1
is defaulted
to the minimum of the -coordinates of the
Yp
points,
b2
is defaulted
to the maximum of the -coordinates of the
Yp
points.
This function is also very similar to rassoc.matern
,
where rassoc.circular
needs the study window to be specified,
while rassoc.matern
does not.
rassoc.circular( n, Yp, e, a1 = min(Yp[, 1]), a2 = max(Yp[, 1]), b1 = min(Yp[, 2]), b2 = max(Yp[, 2]) )
rassoc.circular( n, Yp, e, a1 = min(Yp[, 1]), a2 = max(Yp[, 1]), b1 = min(Yp[, 2]), b2 = max(Yp[, 2]) )
n |
A positive integer representing the number of points to be generated. |
Yp |
A set of 2D points representing the reference points. The generated points are associated (in a circular or radial fashion) with these points. |
e |
A positive real number
representing the radius of the balls centered at |
a1 , a2
|
Real numbers
representing the range of |
b1 , b2
|
Real numbers
representing the range of |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
parameters |
Radial attraction parameter of the association pattern |
ref.points |
The input set of attraction points |
gen.points |
The output set of generated points
associated with |
tri.Yp |
Logical output for triangulation
based on |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The possible range of the |
Elvan Ceyhan
rseg.circular
, rassoc.std.tri
,
rassocII.std.tri
, rassoc.matern
,
and rassoc.multi.tri
## Not run: nx<-100; ny<-4; #try also nx<-1000; ny<-10; e<-.15; #with default bounding box (i.e., unit square) Y<-cbind(runif(ny),runif(ny)) Xdt<-rassoc.circular(nx,Y,e) Xdt summary(Xdt) plot(Xdt,asp=1) Xdt<-Xdt$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Circular Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01), pch=16,col=2,lwd=2) points(Xdt) #with default bounding box (i.e., unit square) Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Circular Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),pch=16, col=2,lwd=2) points(Xdt) #with a rectangular bounding box a1<-0; a2<-10; b1<-0; b2<-5; e<-1.1; #try also e<-5; #pattern very close to CSR! Y<-cbind(runif(ny,a1,a2),runif(ny,b1,b2)) #try also Y<-cbind(runif(ny,a1,a2/2),runif(ny,b1,b2/2)) Xdt<-rassoc.circular(nx,Y,e,a1,a2,b1,b2)$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Circular Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01), pch=16,col=2,lwd=2) points(Xdt) ## End(Not run)
## Not run: nx<-100; ny<-4; #try also nx<-1000; ny<-10; e<-.15; #with default bounding box (i.e., unit square) Y<-cbind(runif(ny),runif(ny)) Xdt<-rassoc.circular(nx,Y,e) Xdt summary(Xdt) plot(Xdt,asp=1) Xdt<-Xdt$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Circular Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01), pch=16,col=2,lwd=2) points(Xdt) #with default bounding box (i.e., unit square) Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Circular Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),pch=16, col=2,lwd=2) points(Xdt) #with a rectangular bounding box a1<-0; a2<-10; b1<-0; b2<-5; e<-1.1; #try also e<-5; #pattern very close to CSR! Y<-cbind(runif(ny,a1,a2),runif(ny,b1,b2)) #try also Y<-cbind(runif(ny,a1,a2/2),runif(ny,b1,b2/2)) Xdt<-rassoc.circular(nx,Y,e,a1,a2,b1,b2)$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Circular Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01), pch=16,col=2,lwd=2) points(Xdt) ## End(Not run)
An object of class "Patterns"
.
Generates n
2D points uniformly in
where
with
being number of
Yp
points
for various values of e
under the association pattern
and is the ball centered
at
with radius
e
.
The pattern resembles the Matern cluster pattern
(see rMatClust
in the
spatstat.random
package for further information
(Baddeley and Turner (2005)).
rMatClust(kappa, scale, mu, win)
in the simplest
case generates a uniform Poisson point process of "parent" points
with intensity kappa
.
Then each parent point is replaced by a random cluster of
"offspring" points, the number of points per cluster
being Poisson(mu
) distributed,
and their positions being placed
and uniformly inside a disc of radius scale centered on the parent point.
The resulting point pattern is a realization of the classical
"stationary Matern cluster process" generated inside the
window win
.
The main difference of rassoc.matern
and rMatClust
is that the parent points are Yp
points
which are given beforehand
and we do not discard them in the end in rassoc.matern
and the offspring points are the points associated
with the reference points, Yp
;
e
must be positive and very large values of e
provide patterns close to CSR.
This function is also very similar to rassoc.circular
,
where rassoc.circular
needs the study window to be specified,
while rassoc.matern
does not.
rassoc.matern(n, Yp, e)
rassoc.matern(n, Yp, e)
n |
A positive integer representing the number of points to be generated. |
Yp |
A set of 2D points representing the reference points. The generated points are associated (in a Matern-cluster like fashion) with these points. |
e |
A positive real number representing the radius of the balls
centered at |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
parameters |
Radial (i.e., circular) attraction parameter of the association pattern. |
ref.points |
The input set of attraction points |
gen.points |
The output set of generated points associated
with |
tri.Yp |
Logical output for triangulation
based on |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The possible ranges of the |
Elvan Ceyhan
Baddeley AJ, Turner R (2005). “spatstat: An R Package for Analyzing Spatial Point Patterns.” Journal of Statistical Software, 12(6), 1-42.
rassoc.circular
, rassoc.std.tri
,
rassocII.std.tri
, rassoc.multi.tri
,
rseg.circular
, and rMatClust
in the spatstat.random
package
## Not run: nx<-100; ny<-4; #try also nx<-1000; ny<-10; e<-.15; #try also e<-1.1; #closer to CSR than association, as e is large #Y points uniform in unit square Y<-cbind(runif(ny),runif(ny)) Xdt<-rassoc.matern(nx,Y,e) Xdt summary(Xdt) plot(Xdt,asp=1) Xdt<-Xdt$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Matern-like Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01), pch=16,col=2,lwd=2) points(Xdt) a1<-0; a2<-10; b1<-0; b2<-5; e<-1.1; #Y points uniform in a rectangle Y<-cbind(runif(ny,a1,a2),runif(ny,b1,b2)) #try also Y<-cbind(runif(ny,a1,a2/2),runif(ny,b1,b2/2)) Xdt<-rassoc.matern(nx,Y,e)$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Matern-like Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),pch=16,col=2,lwd=2) points(Xdt) ## End(Not run)
## Not run: nx<-100; ny<-4; #try also nx<-1000; ny<-10; e<-.15; #try also e<-1.1; #closer to CSR than association, as e is large #Y points uniform in unit square Y<-cbind(runif(ny),runif(ny)) Xdt<-rassoc.matern(nx,Y,e) Xdt summary(Xdt) plot(Xdt,asp=1) Xdt<-Xdt$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Matern-like Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01), pch=16,col=2,lwd=2) points(Xdt) a1<-0; a2<-10; b1<-0; b2<-5; e<-1.1; #Y points uniform in a rectangle Y<-cbind(runif(ny,a1,a2),runif(ny,b1,b2)) #try also Y<-cbind(runif(ny,a1,a2/2),runif(ny,b1,b2/2)) Xdt<-rassoc.matern(nx,Y,e)$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,xlab="x",ylab="y", main="Matern-like Association of X points with Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),pch=16,col=2,lwd=2) points(Xdt) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly in the support
for Type I association in the convex hull of set of points, Yp
.
delta
is the parameter of association
(that is, only % area around each vertex in each Delaunay
triangle is allowed for point generation).
delta
corresponds to eps
in the standard equilateral triangle
as
(see
rseg.std.tri
function).
If Yp
consists only of 3 points,
then the function behaves like the
function rassoc.tri
.
DTmesh
must be the Delaunay triangulation of Yp
and DTr
must be the corresponding Delaunay triangles
(both DTmesh
and DTr
are NULL
by default).
If NULL
, DTmesh
is computed via
tri.mesh
and DTr
is computed via
triangles
function in interp
package.
tri.mesh
function yields
the triangulation nodes with their neighbours,
and creates a triangulation object,
and triangles
function yields
a triangulation data structure from the triangulation object created
by tri.mesh
(the first three columns are the vertex indices of the Delaunay triangles).
See (Ceyhan et al. (2006); Ceyhan et al. (2007); Ceyhan (2011)) for more on the association pattern. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
rassoc.multi.tri(n, Yp, delta, DTmesh = NULL, DTr = NULL)
rassoc.multi.tri(n, Yp, delta, DTmesh = NULL, DTr = NULL)
n |
A positive integer representing the number of points to be generated. |
Yp |
A set of 2D points from which Delaunay triangulation is constructed. |
delta |
A positive real number in |
DTmesh |
Delaunay triangulation of |
DTr |
Delaunay triangles based on |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
parameters |
Attraction parameter, |
ref.points |
The input set of points |
gen.points |
The output set of generated points
associated with |
tri.Y |
Logical output,
|
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
rassoc.circular
, rassoc.std.tri
,
rassocII.std.tri
, and rseg.multi.tri
## Not run: #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) Yp<-cbind(runif(ny),runif(ny)) del<-.4 Xdt<-rassoc.multi.tri(nx,Yp,del) Xdt summary(Xdt) plot(Xdt) #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points TRY<-interp::triangles(DTY)[,1:3]; Xp<-rassoc.multi.tri(nx,Yp,del,DTY,TRY)$g #data under CSR in the convex hull of Ypoints Xlim<-range(Yp[,1]) Ylim<-range(Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points plot(Xp,main="Points from Type I Association \n in Multipe Triangles", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points=TRUE,col="blue") points(Xp,pch=".",cex=3) ## End(Not run)
## Not run: #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) Yp<-cbind(runif(ny),runif(ny)) del<-.4 Xdt<-rassoc.multi.tri(nx,Yp,del) Xdt summary(Xdt) plot(Xdt) #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points TRY<-interp::triangles(DTY)[,1:3]; Xp<-rassoc.multi.tri(nx,Yp,del,DTY,TRY)$g #data under CSR in the convex hull of Ypoints Xlim<-range(Yp[,1]) Ylim<-range(Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points plot(Xp,main="Points from Type I Association \n in Multipe Triangles", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points=TRUE,col="blue") points(Xp,pch=".",cex=3) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly
in the standard equilateral triangle
under the type I association alternative
for
eps
in .
The allowed triangular regions around the vertices are determined
by the parameter
eps
.
In the type I association, the triangular support regions
around the vertices are determined by
the parameter eps
where -
eps
serves as the height of these triangles
(see examples for a sample plot.)
See also (Ceyhan et al. (2006); Ceyhan et al. (2007); Ceyhan (2011)).
rassoc.std.tri(n, eps)
rassoc.std.tri(n, eps)
n |
A positive integer representing the number of points to be generated. |
eps |
A positive real number
representing the parameter of type I association
(where |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
parameters |
The attraction parameter of the association pattern,
|
ref.points |
The input set of points |
gen.points |
The output set of generated points
associated with |
tri.Y |
Logical output for triangulation
based on |
desc.pat |
Description of the point pattern. |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
rseg.circular
, rassoc.circular
,
rsegII.std.tri
, and rseg.multi.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 #try also n<-20 or n<-100 or 1000 eps<-.25 #try also .15, .5, .75 set.seed(1) Xdt<-rassoc.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,pch=".",xlab="",ylab="", main="Type I association in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type I association alternative sr<-(sqrt(3)/3-eps)/(sqrt(3)/2) C1<-C+sr*(A-C); C2<-C+sr*(B-C) A1<-A+sr*(B-A); A2<-A+sr*(C-A) B1<-B+sr*(A-B); B2<-B+sr*(C-B) supp<-rbind(A1,B1,B2,C2,C1,A2) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type I Association", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) if (sr<=.5) { polygon(Te,col=5) polygon(supp,col=0) } else { polygon(Te,col=0,lwd=2.5) polygon(rbind(A,A1,A2),col=5,border=NA) polygon(rbind(B,B1,B2),col=5,border=NA) polygon(rbind(C,C1,C2),col=5,border=NA) } points(Xp) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 #try also n<-20 or n<-100 or 1000 eps<-.25 #try also .15, .5, .75 set.seed(1) Xdt<-rassoc.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,pch=".",xlab="",ylab="", main="Type I association in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type I association alternative sr<-(sqrt(3)/3-eps)/(sqrt(3)/2) C1<-C+sr*(A-C); C2<-C+sr*(B-C) A1<-A+sr*(B-A); A2<-A+sr*(C-A) B1<-B+sr*(A-B); B2<-B+sr*(C-B) supp<-rbind(A1,B1,B2,C2,C1,A2) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type I Association", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) if (sr<=.5) { polygon(Te,col=5) polygon(supp,col=0) } else { polygon(Te,col=0,lwd=2.5) polygon(rbind(A,A1,A2),col=5,border=NA) polygon(rbind(B,B1,B2),col=5,border=NA) polygon(rbind(C,C1,C2),col=5,border=NA) } points(Xp) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly in the support
for Type I association in a given triangle, tri
.
delta
is the parameter of association
(that is, only % area around each vertex in
the triangle is allowed for point generation).
delta
corresponds to eps
in the standard equilateral triangle
as
(see
rseg.std.tri
function).
See (Ceyhan et al. (2006); Ceyhan et al. (2007); Ceyhan (2011)) for more on the association pattern.
rassoc.tri(n, tri, delta)
rassoc.tri(n, tri, delta)
n |
A positive integer representing the number of points
to be generated from the association pattern
in the triangle, |
tri |
A |
delta |
A positive real number in |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
parameters |
Attraction parameter, |
ref.points |
The input set of points,
i.e., vertices of |
gen.points |
The output set of generated points
associated with the vertices of |
tri.Y |
Logical output, |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
rseg.tri
, rassoc.std.tri
,
rassocII.std.tri
, and rassoc.multi.tri
## Not run: n<-100 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) del<-.4 Xdt<-rassoc.tri(n,Tr,del) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Points from Type I Association \n in one Triangle", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.03) txt.str<-c("A","B","C") text(xc,yc,txt.str) ## End(Not run)
## Not run: n<-100 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) del<-.4 Xdt<-rassoc.tri(n,Tr,del) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Points from Type I Association \n in one Triangle", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.03) txt.str<-c("A","B","C") text(xc,yc,txt.str) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly
in the standard equilateral triangle
under the type II association alternative for
eps
in .
In the type II association, the annular allowed regions
around the edges are determined by
the parameter eps
where -
eps
is the distance
from the interior triangle
(i.e., forbidden region for association) to
(see examples for a sample plot.)
rassocII.std.tri(n, eps)
rassocII.std.tri(n, eps)
n |
A positive integer representing the number of points to be generated. |
eps |
A positive real number
representing the parameter of type II association
(where |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
parameters |
The attraction parameter, |
ref.points |
The input set of points |
gen.points |
The output set of generated points associated
with |
tri.Y |
Logical output for triangulation
based on |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
rseg.circular
, rassoc.circular
,
rsegII.std.tri
, and rseg.multi.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 #try also n<-20 or n<-100 or 1000 eps<-.2 #try also .25, .1 set.seed(1) Xdt<-rassocII.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,pch=".",xlab="",ylab="", main="Type II association in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type II association alternative A1<-c(1/2-eps*sqrt(3),sqrt(3)/6-eps); B1<-c(1/2+eps*sqrt(3),sqrt(3)/6-eps); C1<-c(1/2,sqrt(3)/6+2*eps); supp<-rbind(A1,B1,C1) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type II Association", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te,col=5) polygon(supp,col=0) points(Xp) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 #try also n<-20 or n<-100 or 1000 eps<-.2 #try also .25, .1 set.seed(1) Xdt<-rassocII.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,pch=".",xlab="",ylab="", main="Type II association in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type II association alternative A1<-c(1/2-eps*sqrt(3),sqrt(3)/6-eps); B1<-c(1/2+eps*sqrt(3),sqrt(3)/6-eps); C1<-c(1/2,sqrt(3)/6+2*eps); supp<-rbind(A1,B1,C1) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type II Association", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te,col=5) polygon(supp,col=0) points(Xp) ## End(Not run)
Returns the index of the edge
whose region contains point, p
, in
the standard basic triangle form
and edge regions based on center
in Cartesian coordinates
or
in barycentric coordinates
in the interior of the standard basic triangle form
.
Edges are labeled as 3 for edge ,
1 for edge
, and 2 for edge
.
If the point,
p
, is not inside tri
,
then the function yields NA
as output.
Edge region 1 is the triangle ,
edge region 2 is
,
and edge region 3 is
.
In the standard basic triangle form
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
rel.edge.basic.tri(p, c1, c2, M)
rel.edge.basic.tri(p, c1, c2, M)
p |
A 2D point for which |
c1 , c2
|
Positive real numbers
which constitute the upper vertex of the standard basic triangle form
(i.e., the vertex adjacent to the shorter edges of |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard basic triangle form |
A list
with three elements
re |
Index of the |
tri |
The vertices of the triangle,
where row labels are |
desc |
Description of the edge labels |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
rel.edge.triCM
, rel.edge.tri
,
rel.edge.basic.tri
, rel.edge.std.triCM
,
and edge.reg.triCM
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-c(.6,.2) P<-c(.4,.2) rel.edge.basic.tri(P,c1,c2,M) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) re<-vector() for (i in 1:n) re<-c(re,rel.edge.basic.tri(Xp[i,],c1,c2,M)$re) re Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-Tb; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tb,M) xc<-txt[,1]+c(-.03,.03,.02,0) yc<-txt[,2]+c(.02,.02,.02,-.03) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-c(.6,.2) P<-c(.4,.2) rel.edge.basic.tri(P,c1,c2,M) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) re<-vector() for (i in 1:n) re<-c(re,rel.edge.basic.tri(Xp[i,],c1,c2,M)$re) re Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-Tb; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tb,M) xc<-txt[,1]+c(-.03,.03,.02,0) yc<-txt[,2]+c(.02,.02,.02,-.03) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) ## End(Not run)
-edge region
in a standard basic triangle form that contains a pointReturns the index of the edge
whose region contains point, p
, in the
standard basic triangle form
where
is in
,
and
with
edge regions based on center of mass
.
Edges are labeled as 3 for edge ,
1 for edge
, and 2 for edge
.
If the point,
p
, is not inside tri
,
then the function yields NA
as output.
Edge region 1 is the triangle ,
edge region 2 is
,
and edge region 3 is
.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
rel.edge.basic.triCM(p, c1, c2)
rel.edge.basic.triCM(p, c1, c2)
p |
A 2D point for which |
c1 , c2
|
Positive real numbers
which constitute the upper vertex of the standard basic triangle form
(i.e., the vertex adjacent to the shorter edges of |
A list
with three elements
re |
Index of the |
tri |
The vertices of the triangle,
where row labels are |
desc |
Description of the edge labels |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
rel.edge.triCM
, rel.edge.tri
,
rel.edge.basic.tri
, rel.edge.std.triCM
, and edge.reg.triCM
## Not run: c1<-.4; c2<-.6 P<-c(.4,.2) rel.edge.basic.triCM(P,c1,c2) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) CM<-(A+B+C)/3 rel.edge.basic.triCM(A,c1,c2) rel.edge.basic.triCM(B,c1,c2) rel.edge.basic.triCM(C,c1,c2) rel.edge.basic.triCM(CM,c1,c2) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g re<-vector() for (i in 1:n) re<-c(re,rel.edge.basic.triCM(Xp[i,],c1,c2)$re) re Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-Tb; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tb,CM) xc<-txt[,1]+c(-.03,.03,.02,0) yc<-txt[,2]+c(.02,.02,.02,-.04) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6 P<-c(.4,.2) rel.edge.basic.triCM(P,c1,c2) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) CM<-(A+B+C)/3 rel.edge.basic.triCM(A,c1,c2) rel.edge.basic.triCM(B,c1,c2) rel.edge.basic.triCM(C,c1,c2) rel.edge.basic.triCM(CM,c1,c2) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g re<-vector() for (i in 1:n) re<-c(re,rel.edge.basic.triCM(Xp[i,],c1,c2)$re) re Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-Tb; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tb,CM) xc<-txt[,1]+c(-.03,.03,.02,0) yc<-txt[,2]+c(.02,.02,.02,-.04) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) ## End(Not run)
Returns the index of the edge
whose region contains point, p
, in
the standard equilateral triangle
with edge regions based on
center of mass
.
Edges are labeled as 3 for edge ,
1 for edge
,
and 2 for edge
.
If the point,
p
, is not inside tri
,
then the function yields NA
as output.
Edge region 1 is the triangle ,
edge region 2 is
,
and edge region 3 is
.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
rel.edge.std.triCM(p)
rel.edge.std.triCM(p)
p |
A 2D point for which |
A list
with three elements
re |
Index of the |
tri |
The vertices of the standard equilateral triangle |
desc |
Description of the edge labels |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
rel.edge.triCM
, rel.edge.tri
,
rel.edge.basic.triCM
, rel.edge.basic.tri
,
and edge.reg.triCM
## Not run: P<-c(.4,.2) rel.edge.std.triCM(P) A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; CM<-(A+B+C)/3 n<-20 #try also n<-40 Xp<-runif.std.tri(n)$gen.points re<-vector() for (i in 1:n) re<-c(re,rel.edge.std.triCM(Xp[i,])$re) re Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,asp=1,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) points(Xp,pch=".") polygon(Te) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Te,CM) xc<-txt[,1]+c(-.03,.03,.03,-.06) yc<-txt[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) p1<-(A+B+CM)/3 p2<-(B+C+CM)/3 p3<-(A+C+CM)/3 plot(Te,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,CM,p1,p2,p3) xc<-txt[,1]+c(-.03,.03,.03,-.06,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.03,0,0,0) txt.str<-c("A","B","C","CM","re=3","re=1","re=2") text(xc,yc,txt.str) ## End(Not run)
## Not run: P<-c(.4,.2) rel.edge.std.triCM(P) A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; CM<-(A+B+C)/3 n<-20 #try also n<-40 Xp<-runif.std.tri(n)$gen.points re<-vector() for (i in 1:n) re<-c(re,rel.edge.std.triCM(Xp[i,])$re) re Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,asp=1,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) points(Xp,pch=".") polygon(Te) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Te,CM) xc<-txt[,1]+c(-.03,.03,.03,-.06) yc<-txt[,2]+c(.02,.02,.02,.03) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) p1<-(A+B+CM)/3 p2<-(B+C+CM)/3 p3<-(A+C+CM)/3 plot(Te,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) L<-Te; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,CM,p1,p2,p3) xc<-txt[,1]+c(-.03,.03,.03,-.06,0,0,0) yc<-txt[,2]+c(.02,.02,.02,.03,0,0,0) txt.str<-c("A","B","C","CM","re=3","re=1","re=2") text(xc,yc,txt.str) ## End(Not run)
Returns the index of the edge
whose region contains point, p
, in
the triangle tri
with edge regions based on center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the triangle
tri
.
Edges are labeled as 3 for edge ,
1 for edge
, and 2 for edge
.
If the point,
p
, is not inside tri
,
then the function yields NA
as output.
Edge region 1 is the triangle ,
edge region 2 is
,
and edge region 3 is
.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
rel.edge.tri(p, tri, M)
rel.edge.tri(p, tri, M)
p |
A 2D point for which |
tri |
A |
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 |
A list
with three elements
re |
Index of the |
tri |
The vertices of the triangle,
where row labels are |
desc |
Description of the edge labels |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
rel.edge.triCM
, rel.edge.basic.triCM
,
rel.edge.basic.tri
, rel.edge.std.triCM
,
and edge.reg.triCM
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(1.4,1.2) M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) rel.edge.tri(P,Tr,M) n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g re<-vector() for (i in 1:n) re<-c(re,rel.edge.tri(Xp[i,],Tr,M)$re) re Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".") L<-Tr; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tr,M) xc<-txt[,1] yc<-txt[,2] txt.str<-c("A","B","C","M") text(xc,yc,txt.str) p1<-(A+B+M)/3 p2<-(B+C+M)/3 p3<-(A+C+M)/3 plot(Tr,xlab="",ylab="", main="Illustration of M-edge regions in a triangle", axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-Tr; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,M,p1,p2,p3) xc<-txt[,1]+c(-.02,.02,.02,.02,.02,.02,.02) yc<-txt[,2]+c(.02,.02,.04,.05,.02,.02,.02) txt.str<-c("A","B","C","M","re=3","re=1","re=2") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(1.4,1.2) M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) rel.edge.tri(P,Tr,M) n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g re<-vector() for (i in 1:n) re<-c(re,rel.edge.tri(Xp[i,],Tr,M)$re) re Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".") L<-Tr; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tr,M) xc<-txt[,1] yc<-txt[,2] txt.str<-c("A","B","C","M") text(xc,yc,txt.str) p1<-(A+B+M)/3 p2<-(B+C+M)/3 p3<-(A+C+M)/3 plot(Tr,xlab="",ylab="", main="Illustration of M-edge regions in a triangle", axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-Tr; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,M,p1,p2,p3) xc<-txt[,1]+c(-.02,.02,.02,.02,.02,.02,.02) yc<-txt[,2]+c(.02,.02,.04,.05,.02,.02,.02) txt.str<-c("A","B","C","M","re=3","re=1","re=2") text(xc,yc,txt.str) ## End(Not run)
-edge region in a triangle
that contains the pointReturns the index of the edge
whose region contains point, p
, in
the triangle tri
with edge regions based on center of mass
.
Edges are labeled as 3 for edge ,
1 for edge
, and 2 for edge
.
If the point,
p
, is not inside tri
,
then the function yields NA
as output.
Edge region 1 is the triangle ,
edge region 2 is
, and
edge region 3 is
.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
rel.edge.triCM(p, tri)
rel.edge.triCM(p, tri)
p |
A 2D point for which |
tri |
A |
A list
with three elements
re |
Index of the |
tri |
The vertices of the triangle,
where row labels are |
desc |
Description of the edge labels |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
rel.edge.tri
, rel.edge.basic.triCM
,
rel.edge.basic.tri
, rel.edge.std.triCM
,
and edge.reg.triCM
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(1.4,1.2) rel.edge.triCM(P,Tr) P<-c(1.5,1.61) rel.edge.triCM(P,Tr) CM<-(A+B+C)/3 n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g re<-vector() for (i in 1:n) re<-c(re,rel.edge.triCM(Xp[i,],Tr)$re) re Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tr) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tr,CM) xc<-txt[,1] yc<-txt[,2] txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) p1<-(A+B+CM)/3 p2<-(B+C+CM)/3 p3<-(A+C+CM)/3 plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CM,p1,p2,p3) xc<-txt[,1]+c(-.02,.02,.02,.02,.02,.02,.02) yc<-txt[,2]+c(.02,.02,.04,.05,.02,.02,.02) txt.str<-c("A","B","C","CM","re=3","re=1","re=2") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(1.4,1.2) rel.edge.triCM(P,Tr) P<-c(1.5,1.61) rel.edge.triCM(P,Tr) CM<-(A+B+C)/3 n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g re<-vector() for (i in 1:n) re<-c(re,rel.edge.triCM(Xp[i,],Tr)$re) re Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tr) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(re)) txt<-rbind(Tr,CM) xc<-txt[,1] yc<-txt[,2] txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) p1<-(A+B+CM)/3 p2<-(B+C+CM)/3 p3<-(A+C+CM)/3 plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CM,p1,p2,p3) xc<-txt[,1]+c(-.02,.02,.02,.02,.02,.02,.02) yc<-txt[,2]+c(.02,.02,.04,.05,.02,.02,.02) txt.str<-c("A","B","C","CM","re=3","re=1","re=2") text(xc,yc,txt.str) ## End(Not run)
M
-edge regions in a triangle
that contains the points in a give data setReturns the indices of the edges
whose regions contain the points in data set Xp
in
a triangle tri
and edge regions are based on the center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the triangle
tri
(see the plots in the example for illustrations).
The vertices of the triangle tri
are labeled as
,
, and
also
according to the row number the vertex is recorded in
tri
and the corresponding edges are ,
, and
.
If a point in Xp
is not inside tri
,
then the function yields NA
as output for that entry.
The corresponding edge region is the polygon
with the vertex, M
,
and vertices other than the non-adjacent vertex,
i.e., edge region 1 is the triangle
, edge region 2 is
and edge region 3 is
.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
rel.edges.tri(Xp, tri, M)
rel.edges.tri(Xp, tri, M)
Xp |
A set of 2D points representing the set of data points for which indices of the edge regions containing them are to be determined. |
tri |
A |
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 |
A list
with the elements
re |
Indices (i.e., a |
tri |
The vertices of the triangle, where row number corresponds to the vertex index opposite to edge whose index is given in re. |
desc |
Description of the edge labels as
|
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
rel.edges.triCM
, rel.verts.tri
,
and rel.verts.tri.nondegPE
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.2) P<-c(.4,.2) rel.edges.tri(P,Tr,M) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) (re<-rel.edges.tri(Xp,Tr,M)) D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Scatterplot of data points \n and the M-edge regions",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-Tr; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.05,.06,-.05,-.02) yc<-txt[,2]+c(.03,.03,.05,-.08) txt.str<-c("M","re=2","re=3","re=1") text(xc,yc,txt.str) text(Xp,labels=factor(re$re)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.2) P<-c(.4,.2) rel.edges.tri(P,Tr,M) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) #try also M<-c(1.6,1.2) (re<-rel.edges.tri(Xp,Tr,M)) D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Scatterplot of data points \n and the M-edge regions",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-Tr; R<-rbind(M,M,M) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.05,.06,-.05,-.02) yc<-txt[,2]+c(.03,.03,.05,-.08) txt.str<-c("M","re=2","re=3","re=1") text(xc,yc,txt.str) text(Xp,labels=factor(re$re)) ## End(Not run)
-edge regions in a triangle
that contains the points in a give data setReturns the indices of the edges
whose regions contain the points in data set Xp
in
a triangle tri
and edge regions are based on the center of mass
of
tri
.
(see the plots in the example for illustrations).
The vertices of the triangle tri
are labeled as
,
, and
also
according to the row number the vertex is recorded in
tri
and the corresponding edges are ,
, and
.
If a point in Xp
is not inside tri
,
then the function yields NA
as output for that entry.
The corresponding edge region is the polygon
with the vertex, ,
and vertices other than the non-adjacent vertex,
i.e., edge region 1 is the triangle
,
edge region 2 is
and edge region 3 is
.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2007)).
rel.edges.triCM(Xp, tri)
rel.edges.triCM(Xp, tri)
Xp |
A set of 2D points representing the set of data points for which indices of the edge regions containing them are to be determined. |
tri |
A |
A list
with the elements
re |
Indices (i.e., a |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
desc |
Description of the edge labels as
|
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
rel.edges.tri
, rel.verts.tri
,
and rel.verts.tri.nondegPE
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) rel.edges.triCM(P,Tr) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g re<-rel.edges.triCM(Xp,Tr) re CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,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=".",col=1) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(CM,Ds) xc<-txt[,1]+c(.05,.06,-.05,-.02) yc<-txt[,2]+c(.03,.03,.05,-.08) txt.str<-c("CM","re=2","re=3","re=1") text(xc,yc,txt.str) text(Xp,labels=factor(re$re)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) rel.edges.triCM(P,Tr) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g re<-rel.edges.triCM(Xp,Tr) re CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,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=".",col=1) L<-Tr; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.02,.03,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) txt<-rbind(CM,Ds) xc<-txt[,1]+c(.05,.06,-.05,-.02) yc<-txt[,2]+c(.03,.03,.05,-.08) txt.str<-c("CM","re=2","re=3","re=1") text(xc,yc,txt.str) text(Xp,labels=factor(re$re)) ## End(Not run)
Returns the index of the related vertex
in the standard basic triangle form
whose region contains point p
.
The standard basic triangle form is
where
is in
,
and
..
Vertex regions are based on the general center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the standard basic triangle form
.
Vertices of the standard basic triangle form
are labeled
according to the row number the
vertex is recorded, i.e., as 1=(0,0), 2=(1,0),and
.
If the point, p
, is not inside ,
then the function yields
NA
as output.
The corresponding vertex region is the polygon
with the vertex, M
, and projections from M
to the edges on the lines joining vertices and M
.
That is, rv=1
has vertices ;
rv=2
has vertices ; and
has vertices
(see the illustration in the examples).
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010)).
rel.vert.basic.tri(p, c1, c2, M)
rel.vert.basic.tri(p, c1, c2, M)
p |
A 2D point for which |
c1 , c2
|
Positive real numbers
which constitute the vertex of the standard basic triangle form
adjacent to the shorter edges;
|
M |
A 2D point in Cartesian coordinates or a 3D point in barycentric coordinates which serves as a center in the interior of the standard basic triangle form. |
A list
with two elements
rv |
Index of the vertex whose region contains point, |
tri |
The vertices of the standard basic triangle form, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.vert.basic.triCM
, rel.vert.tri
,
rel.vert.triCC
, rel.vert.basic.triCC
,
rel.vert.triCM
, and rel.vert.std.triCM
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-c(.6,.2) P<-c(.4,.2) rel.vert.basic.tri(P,c1,c2,M) n<-20 #try also n<-40 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Rv<-vector() for (i in 1:n) { Rv<-c(Rv,rel.vert.basic.tri(Xp[i,],c1,c2,M)$rv)} Rv Ds<-prj.cent2edges.basic.tri(c1,c2,M) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates plot(Tb,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.1,.1),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tb[,1]+c(-.04,.05,.04) yc<-Tb[,2]+c(.02,.02,.03) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.03,0) yc<-txt[,2]+c(-.02,.02,.02,-.03) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); M<-c(.6,.2) P<-c(.4,.2) rel.vert.basic.tri(P,c1,c2,M) n<-20 #try also n<-40 set.seed(1) Xp<-runif.basic.tri(n,c1,c2)$g M<-as.numeric(runif.basic.tri(1,c1,c2)$g) #try also M<-c(.6,.2) Rv<-vector() for (i in 1:n) { Rv<-c(Rv,rel.vert.basic.tri(Xp[i,],c1,c2,M)$rv)} Rv Ds<-prj.cent2edges.basic.tri(c1,c2,M) Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tb)} #need to run this when M is given in barycentric coordinates plot(Tb,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.1,.1),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tb[,1]+c(-.04,.05,.04) yc<-Tb[,2]+c(.02,.02,.03) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.03,0) yc<-txt[,2]+c(-.02,.02,.02,-.03) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
-vertex region
in a standard basic triangle form that contains a pointReturns the index of the vertex
whose region contains point p
in
the standard basic triangle form
where
is in
,
and
and vertex regions are
based on the circumcenter
of
.
(see the plots in the example for illustrations).
The vertices of the standard basic triangle form are labeled as
,
,and
also according to the row number the vertex is recorded in
.
If the point,
p
, is not inside ,
then the function yields
NA
as output.
The corresponding vertex region is the polygon
whose interior points are closest to that vertex.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010)).
rel.vert.basic.triCC(p, c1, c2)
rel.vert.basic.triCC(p, c1, c2)
p |
A 2D point for which |
c1 , c2
|
Positive real numbers
which constitute the upper vertex of the standard basic triangle form
(i.e., the vertex adjacent to the shorter edges of |
A list
with two elements
rv |
Index of the |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.vert.triCM
, rel.vert.tri
,
rel.vert.triCC
, rel.vert.basic.triCM
,
rel.vert.basic.tri
, and rel.vert.std.triCM
## Not run: c1<-.4; c2<-.6; #try also c1<-.5; c2<-.5; P<-c(.3,.2) rel.vert.basic.triCC(P,c1,c2) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,asp=1,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,0.02,-.01,.05,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,.06,.03,.03,-.03) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) RV1<-(A+D3+CC+D2)/4 RV2<-(B+D3+CC+D1)/4 RV3<-(C+D2+CC+D1)/4 txt<-rbind(RV1,RV2,RV3) xc<-txt[,1] yc<-txt[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.basic.triCC(Xp[i,],c1,c2)$rv) Rv Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,asp=1,xlab="",pch=".",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,0.02,-.01,.05,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,.06,.03,.03,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6; #try also c1<-.5; c2<-.5; P<-c(.3,.2) rel.vert.basic.triCC(P,c1,c2) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) CC<-circumcenter.basic.tri(c1,c2) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,asp=1,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,0.02,-.01,.05,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,.06,.03,.03,-.03) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) RV1<-(A+D3+CC+D2)/4 RV2<-(B+D3+CC+D1)/4 RV3<-(C+D2+CC+D1)/4 txt<-rbind(RV1,RV2,RV3) xc<-txt[,1] yc<-txt[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.basic.triCC(Xp[i,],c1,c2)$rv) Rv Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,asp=1,xlab="",pch=".",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tb,CC,Ds) xc<-txt[,1]+c(-.03,.03,0.02,-.01,.05,-.05,.01) yc<-txt[,2]+c(.02,.02,.03,.06,.03,.03,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
-vertex region
in a standard basic triangle form that contains a pointReturns the index of the vertex
whose region contains point p
in
the standard basic triangle form
where
is in
,
and
and vertex regions are
based on the center of mass CM=((1+c1)/3,c2/3) of
.
(see the plots in the example for illustrations).
The vertices of the standard basic triangle form
are labeled as
,
,and
also according to the row number the vertex is recorded in
.
If the point,
p
, is not inside ,
then the function yields
NA
as output.
The corresponding vertex region is the polygon with the vertex, , and
midpoints of the edges adjacent to the vertex.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
See also (Ceyhan (2005, 2010); Ceyhan et al. (2006))
rel.vert.basic.triCM(p, c1, c2)
rel.vert.basic.triCM(p, c1, c2)
p |
A 2D point for which |
c1 , c2
|
Positive real numbers
which constitute the upper vertex of the standard basic triangle form
(i.e., the vertex adjacent to the shorter edges of |
A list
with two elements
rv |
Index of the |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
#' @author Elvan Ceyhan
rel.vert.triCM
, rel.vert.tri
, rel.vert.triCC
,
rel.vert.basic.triCC
, rel.vert.basic.tri
, and rel.vert.std.triCM
## Not run: c1<-.4; c2<-.6 P<-c(.4,.2) rel.vert.basic.triCM(P,c1,c2) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.basic.triCM(Xp[i,],c1,c2)$rv) Rv Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",axes="T",pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-Ds; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tb,CM,Ds) xc<-txt[,1]+c(-.03,.03,.02,-.01,.06,-.05,.0) yc<-txt[,2]+c(.02,.02,.02,.04,.02,.02,-.03) txt.str<-c("A","B","C","CM","D1","D2","D3") text(xc,yc,txt.str) plot(Tb,xlab="",ylab="",axes="T",pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-Ds; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) RV1<-(A+D3+CM+D2)/4 RV2<-(B+D3+CM+D1)/4 RV3<-(C+D2+CM+D1)/4 txt<-rbind(RV1,RV2,RV3) xc<-txt[,1] yc<-txt[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(Tb,CM,Ds) xc<-txt[,1]+c(-.03,.03,.02,-.01,.04,-.03,.0) yc<-txt[,2]+c(.02,.02,.02,.04,.02,.02,-.03) txt.str<-c("A","B","C","CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: c1<-.4; c2<-.6 P<-c(.4,.2) rel.vert.basic.triCM(P,c1,c2) A<-c(0,0);B<-c(1,0);C<-c(c1,c2); Tb<-rbind(A,B,C) CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) n<-20 #try also n<-40 Xp<-runif.basic.tri(n,c1,c2)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.basic.triCM(Xp[i,],c1,c2)$rv) Rv Xlim<-range(Tb[,1],Xp[,1]) Ylim<-range(Tb[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",axes="T",pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xp,pch=".") polygon(Tb) L<-Ds; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tb,CM,Ds) xc<-txt[,1]+c(-.03,.03,.02,-.01,.06,-.05,.0) yc<-txt[,2]+c(.02,.02,.02,.04,.02,.02,-.03) txt.str<-c("A","B","C","CM","D1","D2","D3") text(xc,yc,txt.str) plot(Tb,xlab="",ylab="",axes="T",pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tb) L<-Ds; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) RV1<-(A+D3+CM+D2)/4 RV2<-(B+D3+CM+D1)/4 RV3<-(C+D2+CM+D1)/4 txt<-rbind(RV1,RV2,RV3) xc<-txt[,1] yc<-txt[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(Tb,CM,Ds) xc<-txt[,1]+c(-.03,.03,.02,-.01,.04,-.03,.0) yc<-txt[,2]+c(.02,.02,.02,.04,.02,.02,-.03) txt.str<-c("A","B","C","CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
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
(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 or
for the interval
.
Then if
, then
rv=1
and if ,
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)).
rel.vert.end.int(p, int)
rel.vert.end.int(p, int)
p |
A 1D point whose end interval region is provided by the function. |
int |
A |
A list
with two elements
rv |
Index of the end vertex whose region contains point, |
int |
The vertices of the interval as a |
Elvan Ceyhan
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.
## Not run: 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")) ## End(Not run)
## Not run: 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")) ## End(Not run)
Returns the index of the vertex
whose region contains point p
in
the interval int
(vertex 1,vertex 2)
with (parameterized) center
associated with
the centrality parameter
;
vertices of interval are labeled as 1 and 2 according to their
order in the interval
int
.
If the point, p
, is not inside int
,
then the function yields NA
as output.
The corresponding vertex region is the interval
as
and
where
.
See also (Ceyhan (2012, 2016)).
rel.vert.mid.int(p, int, c = 0.5)
rel.vert.mid.int(p, int, c = 0.5)
p |
A 1D point. The vertex region |
int |
A |
c |
A positive real number in |
A list
with two elements
rv |
Index of the vertex in the interval |
int |
The vertices of the interval as a |
Elvan Ceyhan
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.
## Not run: c<-.4 a<-0; b<-10; int = c(a,b) Mc<-centerMc(int,c) rel.vert.mid.int(6,int,c) n<-20 #try also n<-40 xr<-range(a,b,Mc) xf<-(int[2]-int[1])*.5 Xp<-runif(n,a,b) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.mid.int(Xp[i],int,c)$rv) Rv jit<-.1 yjit<-runif(n,-jit,jit) Xlim<-range(a,b,Xp) xd<-Xlim[2]-Xlim[1] plot(cbind(Mc,0),main="vertex region indices for the points", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*range(yjit),pch=".",cex=3) abline(h=0) points(Xp,yjit) abline(v=c(a,b,Mc),lty = 2,col=c(1,1,2)) text(Xp,yjit,labels=factor(Rv)) text(cbind(c(a,b,Mc),.02),c("rv=1","rv=2","Mc")) ## End(Not run)
## Not run: c<-.4 a<-0; b<-10; int = c(a,b) Mc<-centerMc(int,c) rel.vert.mid.int(6,int,c) n<-20 #try also n<-40 xr<-range(a,b,Mc) xf<-(int[2]-int[1])*.5 Xp<-runif(n,a,b) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.mid.int(Xp[i],int,c)$rv) Rv jit<-.1 yjit<-runif(n,-jit,jit) Xlim<-range(a,b,Xp) xd<-Xlim[2]-Xlim[1] plot(cbind(Mc,0),main="vertex region indices for the points", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*range(yjit),pch=".",cex=3) abline(h=0) points(Xp,yjit) abline(v=c(a,b,Mc),lty = 2,col=c(1,1,2)) text(Xp,yjit,labels=factor(Rv)) text(cbind(c(a,b,Mc),.02),c("rv=1","rv=2","Mc")) ## End(Not run)
Returns the index of the vertex
whose region contains point p
in standard equilateral triangle
with vertex regions are constructed with center
in Cartesian coordinates or
in barycentric coordinates in the interior of
.
(see the plots in the example for illustrations).
The vertices of triangle, , are labeled as
according to the row number the vertex is recorded in
.
If the point,
p
, is not inside ,
then the function yields
NA
as output.
The corresponding vertex region is the polygon with the vertex, M
, and
projections from M
to the edges on the lines
joining vertices and M
.
See also (Ceyhan (2005, 2010)).
rel.vert.std.tri(p, M)
rel.vert.std.tri(p, M)
p |
A 2D point for which |
M |
A 2D point in Cartesian coordinates
or a 3D point in barycentric coordinates
which serves as a center
in the interior of the standard equilateral triangle |
A list
with two elements
rv |
Index of the vertex whose region contains point, |
tri |
The vertices of the triangle, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.vert.std.triCM
, rel.vert.tri
, rel.vert.triCC
,
rel.vert.basic.triCC
, rel.vert.triCM
,
and rel.vert.basic.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-20 #try also n<-40 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) rel.vert.std.tri(Xp[1,],M) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.std.tri(Xp[i,],M)$rv) Rv Ds<-prj.cent2edges(Te,M) Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Te)} #need to run this when M is given in barycentric coordinates plot(Te,asp=1,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,M) xc<-txt[,1]+c(-.02,.03,.02,0) yc<-txt[,2]+c(.02,.02,.03,.05) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-20 #try also n<-40 set.seed(1) Xp<-runif.std.tri(n)$gen.points M<-as.numeric(runif.std.tri(1)$g) #try also M<-c(.6,.2) rel.vert.std.tri(Xp[1,],M) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.std.tri(Xp[i,],M)$rv) Rv Ds<-prj.cent2edges(Te,M) Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Te)} #need to run this when M is given in barycentric coordinates plot(Te,asp=1,pch=".",xlab="",ylab="",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,M) xc<-txt[,1]+c(-.02,.03,.02,0) yc<-txt[,2]+c(.02,.02,.03,.05) txt.str<-c("A","B","C","M") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
-vertex region
in the standard equilateral triangle that contains a given pointReturns the index of the vertex
whose region contains point p
in standard equilateral triangle
with vertex regions are constructed with center of mass CM
(see the plots in the example for illustrations).
The vertices of triangle, , are labeled as
according to the row number the vertex is recorded in
.
If the point,
p
, is not inside , then the
function yields
NA
as output.
The corresponding vertex region is the polygon with the vertex, , and
midpoints of the edges adjacent to the vertex.
See also (Ceyhan (2005, 2010)).
rel.vert.std.triCM(p)
rel.vert.std.triCM(p)
p |
A 2D point for which |
A list
with two elements
rv |
Index of the vertex whose region contains point, |
tri |
The vertices of the triangle, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.vert.basic.triCM
, rel.vert.tri
,
rel.vert.triCC
, rel.vert.basic.triCC
,
rel.vert.triCM
, and rel.vert.basic.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-20 #try also n<-40 set.seed(1) Xp<-runif.std.tri(n)$gen.points rel.vert.std.triCM(Xp[1,]) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.std.triCM(Xp[i,])$rv) Rv CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,asp=1,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".",col=1) L<-matrix(rep(CM,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,CM) xc<-txt[,1]+c(-.02,.03,.02,0) yc<-txt[,2]+c(.02,.02,.03,.05) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) n<-20 #try also n<-40 set.seed(1) Xp<-runif.std.tri(n)$gen.points rel.vert.std.triCM(Xp[1,]) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.std.triCM(Xp[i,])$rv) Rv CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,asp=1,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Te) points(Xp,pch=".",col=1) L<-matrix(rep(CM,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Te,CM) xc<-txt[,1]+c(-.02,.03,.02,0) yc<-txt[,2]+c(.02,.02,.03,.05) txt.str<-c("A","B","C","CM") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
-vertex region in a tetrahedron
that contains a pointReturns the index of the vertex
whose region contains point p
in
a tetrahedron
and vertex regions are based on the circumcenter
of
th
.
(see the plots in the example for illustrations).
The vertices of the tetrahedron th
are labeled as
,
,
, and
also
according to the row number the vertex is recorded in
th
.
If the point, p
, is not inside th
,
then the function yields NA
as output.
The corresponding vertex region is the polygon
whose interior points are closest to that vertex.
If th
is regular tetrahedron,
then and
(center of mass) coincide.
See also (Ceyhan (2005, 2010)).
rel.vert.tetraCC(p, th)
rel.vert.tetraCC(p, th)
p |
A 3D point for which |
th |
A |
A list
with two elements
rv |
Index of the |
tri |
The vertices of the tetrahedron,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
rel.vert.tetraCM
and rel.vert.triCC
## Not run: set.seed(123) A<-c(0,0,0)+runif(3,-.2,.2); B<-c(1,0,0)+runif(3,-.2,.2); C<-c(1/2,sqrt(3)/2,0)+runif(3,-.2,.2); D<-c(1/2,sqrt(3)/6,sqrt(6)/3)+runif(3,-.2,.2); tetra<-rbind(A,B,C,D) n<-20 #try also n<-40 Xp<-runif.tetra(n,tetra)$g rel.vert.tetraCC(Xp[1,],tetra) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.tetraCC(Xp[i,],tetra)$rv) Rv CC<-circumcenter.tetra(tetra) CC Xlim<-range(tetra[,1],Xp[,1],CC[1]) Ylim<-range(tetra[,2],Xp[,2],CC[2]) Zlim<-range(tetra[,3],Xp[,3],CC[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(tetra[,1],tetra[,2],tetra[,3], phi =0,theta=40, bty = "g", main="Scatterplot of data points \n and CC-vertex regions", xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) #add the data points plot3D::points3D(Xp[,1],Xp[,2],Xp[,3],pch=".",cex=3, add=TRUE) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) plot3D::text3D(CC[1],CC[2],CC[3], labels=c("CC"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CC,6),ncol=3,byrow=TRUE) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty = 2) F1<-intersect.line.plane(A,CC,B,C,D) L<-matrix(rep(F1,4),ncol=3,byrow=TRUE); R<-rbind(D4,D5,D6,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=2, add=TRUE,lty = 2) F2<-intersect.line.plane(B,CC,A,C,D) L<-matrix(rep(F2,4),ncol=3,byrow=TRUE); R<-rbind(D2,D3,D6,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=3, add=TRUE,lty = 2) F3<-intersect.line.plane(C,CC,A,B,D) L<-matrix(rep(F3,4),ncol=3,byrow=TRUE); R<-rbind(D3,D5,D6,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=4, add=TRUE,lty = 2) F4<-intersect.line.plane(D,CC,A,B,C) L<-matrix(rep(F4,4),ncol=3,byrow=TRUE); R<-rbind(D1,D2,D4,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=5, add=TRUE,lty = 2) plot3D::text3D(Xp[,1],Xp[,2],Xp[,3], labels=factor(Rv), add=TRUE) ## End(Not run)
## Not run: set.seed(123) A<-c(0,0,0)+runif(3,-.2,.2); B<-c(1,0,0)+runif(3,-.2,.2); C<-c(1/2,sqrt(3)/2,0)+runif(3,-.2,.2); D<-c(1/2,sqrt(3)/6,sqrt(6)/3)+runif(3,-.2,.2); tetra<-rbind(A,B,C,D) n<-20 #try also n<-40 Xp<-runif.tetra(n,tetra)$g rel.vert.tetraCC(Xp[1,],tetra) Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.tetraCC(Xp[i,],tetra)$rv) Rv CC<-circumcenter.tetra(tetra) CC Xlim<-range(tetra[,1],Xp[,1],CC[1]) Ylim<-range(tetra[,2],Xp[,2],CC[2]) Zlim<-range(tetra[,3],Xp[,3],CC[3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(tetra[,1],tetra[,2],tetra[,3], phi =0,theta=40, bty = "g", main="Scatterplot of data points \n and CC-vertex regions", xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) #add the data points plot3D::points3D(Xp[,1],Xp[,2],Xp[,3],pch=".",cex=3, add=TRUE) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) plot3D::text3D(CC[1],CC[2],CC[3], labels=c("CC"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CC,6),ncol=3,byrow=TRUE) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty = 2) F1<-intersect.line.plane(A,CC,B,C,D) L<-matrix(rep(F1,4),ncol=3,byrow=TRUE); R<-rbind(D4,D5,D6,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=2, add=TRUE,lty = 2) F2<-intersect.line.plane(B,CC,A,C,D) L<-matrix(rep(F2,4),ncol=3,byrow=TRUE); R<-rbind(D2,D3,D6,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=3, add=TRUE,lty = 2) F3<-intersect.line.plane(C,CC,A,B,D) L<-matrix(rep(F3,4),ncol=3,byrow=TRUE); R<-rbind(D3,D5,D6,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=4, add=TRUE,lty = 2) F4<-intersect.line.plane(D,CC,A,B,C) L<-matrix(rep(F4,4),ncol=3,byrow=TRUE); R<-rbind(D1,D2,D4,CC) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=5, add=TRUE,lty = 2) plot3D::text3D(Xp[,1],Xp[,2],Xp[,3], labels=factor(Rv), add=TRUE) ## End(Not run)
-vertex region in a tetrahedron
that contains a pointReturns the index of the vertex
whose region contains point p
in
a tetrahedron
and vertex regions are
based on the center of mass
of
th
.
(see the plots in the example for illustrations).
The vertices of the tetrahedron th
are labeled as
,
,
, and
also
according to the row number the vertex is recorded in
th
.
If the point, p
, is not inside th
,
then the function yields NA
as output.
The corresponding vertex region is the simplex with the vertex, , and
midpoints of the edges adjacent to the vertex.
See also (Ceyhan (2005, 2010)).
rel.vert.tetraCM(p, th)
rel.vert.tetraCM(p, th)
p |
A 3D point for which |
th |
A |
A list
with two elements
rv |
Index of the |
th |
The vertices of the tetrahedron,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
rel.vert.tetraCC
and rel.vert.triCM
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-20 #try also n<-40 Xp<-runif.std.tetra(n)$g rel.vert.tetraCM(Xp[1,],tetra) Rv<-vector() for (i in 1:n) Rv<-c(Rv, rel.vert.tetraCM(Xp[i,],tetra)$rv ) Rv Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] CM<-apply(tetra,2,mean) plot3D::scatter3D(tetra[,1],tetra[,2],tetra[,3], phi =0,theta=40, bty = "g", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) #add the data points plot3D::points3D(Xp[,1],Xp[,2],Xp[,3],pch=".",cex=3, add=TRUE) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) plot3D::text3D(CM[1],CM[2],CM[3], labels=c("CM"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CM,6),ncol=3,byrow=TRUE) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty = 2) F1<-intersect.line.plane(A,CM,B,C,D) L<-matrix(rep(F1,4),ncol=3,byrow=TRUE); R<-rbind(D4,D5,D6,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=2, add=TRUE,lty = 2) F2<-intersect.line.plane(B,CM,A,C,D) L<-matrix(rep(F2,4),ncol=3,byrow=TRUE); R<-rbind(D2,D3,D6,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=3, add=TRUE,lty = 2) F3<-intersect.line.plane(C,CM,A,B,D) L<-matrix(rep(F3,4),ncol=3,byrow=TRUE); R<-rbind(D3,D5,D6,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=4, add=TRUE,lty = 2) F4<-intersect.line.plane(D,CM,A,B,C) L<-matrix(rep(F4,4),ncol=3,byrow=TRUE); R<-rbind(D1,D2,D4,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=5, add=TRUE,lty = 2) plot3D::text3D(Xp[,1],Xp[,2],Xp[,3], labels=factor(Rv), add=TRUE) ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-20 #try also n<-40 Xp<-runif.std.tetra(n)$g rel.vert.tetraCM(Xp[1,],tetra) Rv<-vector() for (i in 1:n) Rv<-c(Rv, rel.vert.tetraCM(Xp[i,],tetra)$rv ) Rv Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] CM<-apply(tetra,2,mean) plot3D::scatter3D(tetra[,1],tetra[,2],tetra[,3], phi =0,theta=40, bty = "g", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) #add the data points plot3D::points3D(Xp[,1],Xp[,2],Xp[,3],pch=".",cex=3, add=TRUE) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) plot3D::text3D(CM[1],CM[2],CM[3], labels=c("CM"), add=TRUE) D1<-(A+B)/2; D2<-(A+C)/2; D3<-(A+D)/2; D4<-(B+C)/2; D5<-(B+D)/2; D6<-(C+D)/2; L<-rbind(D1,D2,D3,D4,D5,D6); R<-matrix(rep(CM,6),ncol=3,byrow=TRUE) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lty = 2) F1<-intersect.line.plane(A,CM,B,C,D) L<-matrix(rep(F1,4),ncol=3,byrow=TRUE); R<-rbind(D4,D5,D6,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=2, add=TRUE,lty = 2) F2<-intersect.line.plane(B,CM,A,C,D) L<-matrix(rep(F2,4),ncol=3,byrow=TRUE); R<-rbind(D2,D3,D6,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=3, add=TRUE,lty = 2) F3<-intersect.line.plane(C,CM,A,B,D) L<-matrix(rep(F3,4),ncol=3,byrow=TRUE); R<-rbind(D3,D5,D6,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=4, add=TRUE,lty = 2) F4<-intersect.line.plane(D,CM,A,B,C) L<-matrix(rep(F4,4),ncol=3,byrow=TRUE); R<-rbind(D1,D2,D4,CM) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3],col=5, add=TRUE,lty = 2) plot3D::text3D(Xp[,1],Xp[,2],Xp[,3], labels=factor(Rv), add=TRUE) ## End(Not run)
Returns the index of the related vertex
in the triangle, tri
,
whose region contains point p
.
Vertex regions are based on the general center
in Cartesian coordinates or
in barycentric coordinates
in the interior of the triangle
tri
.
Vertices of the triangle tri
are labeled
according to the row number the vertex is recorded.
If the point, p
, is not inside tri
,
then the function yields NA
as output.
The corresponding vertex region is the polygon
with the vertex, M
, and projections from M
to the edges on the lines joining vertices
and M
(see the illustration in the examples).
See also (Ceyhan (2005, 2010)).
rel.vert.tri(p, tri, M)
rel.vert.tri(p, tri, M)
p |
A 2D point for which |
tri |
A |
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 |
A list
with two elements
rv |
Index of the vertex whose region contains point, |
tri |
The vertices of the triangle, |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.vert.triCM
, rel.vert.triCC
,
rel.vert.basic.triCC
, rel.vert.basic.triCM
,
rel.vert.basic.tri
, and rel.vert.std.triCM
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.0) P<-c(1.5,1.6) rel.vert.tri(P,Tr,M) #try also rel.vert.tri(P,Tr,M=c(2,2)) #center is not in the interior of the triangle n<-20 #try also n<-40 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) Rv<-vector() for (i in 1:n) {Rv<-c(Rv,rel.vert.tri(Xp[i,],Tr,M)$rv)} Rv Ds<-prj.cent2edges(Tr,M) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Illustration of M-Vertex Regions\n in a Triangle",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.04,0) yc<-txt[,2]+c(-.02,.04,.05,-.08) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.0) P<-c(1.5,1.6) rel.vert.tri(P,Tr,M) #try also rel.vert.tri(P,Tr,M=c(2,2)) #center is not in the interior of the triangle n<-20 #try also n<-40 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) Rv<-vector() for (i in 1:n) {Rv<-c(Rv,rel.vert.tri(Xp[i,],Tr,M)$rv)} Rv Ds<-prj.cent2edges(Tr,M) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Illustration of M-Vertex Regions\n in a Triangle",axes=TRUE, xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(-.02,.04,-.04,0) yc<-txt[,2]+c(-.02,.04,.05,-.08) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(Rv)) ## End(Not run)
-vertex region in a triangle
that contains a pointReturns the index of the vertex
whose region contains point p
in
a triangle tri
and vertex regions are based on the circumcenter
of
tri
.
(see the plots in the example for illustrations).
The vertices of the triangle tri
are labeled as
,
, and
also
according to the row number the vertex is recorded in
tri
.
If the point, p
, is not inside tri
,
then the function yields NA
as output.
The corresponding vertex region is the polygon
whose interior points are closest to that vertex.
If tri
is equilateral triangle,
then and
(center of mass) coincide.
See also (Ceyhan (2005, 2010)).
rel.vert.triCC(p, tri)
rel.vert.triCC(p, tri)
p |
A 2D point for which |
tri |
A |
A list
with two elements
rv |
Index of the |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.vert.tri
, rel.vert.triCM
,
rel.vert.basic.triCM
, rel.vert.basic.triCC
,
rel.vert.basic.tri
, and rel.vert.std.triCM
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(1.3,1.2) rel.vert.triCC(P,Tr) CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],CC[1]) Ylim<-range(Tr[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,asp=1,xlab="",ylab="",pch=".",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.07,.08,.06,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) RV1<-(A+.5*(D3-A)+A+.5*(D2-A))/2 RV2<-(B+.5*(D3-B)+B+.5*(D1-B))/2 RV3<-(C+.5*(D2-C)+C+.5*(D1-C))/2 txt<-rbind(RV1,RV2,RV3) xc<-txt[,1] yc<-txt[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.triCC(Xp[i,],Tr)$rv) Rv Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,asp=1,xlab="",ylab="", main="Illustration of CC-Vertex Regions\n in a Triangle", pch=".",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".") L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.07,.08,.06,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(1.3,1.2) rel.vert.triCC(P,Tr) CC<-circumcenter.tri(Tr) #the circumcenter D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],CC[1]) Ylim<-range(Tr[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,asp=1,xlab="",ylab="",pch=".",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.07,.08,.06,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) RV1<-(A+.5*(D3-A)+A+.5*(D2-A))/2 RV2<-(B+.5*(D3-B)+B+.5*(D1-B))/2 RV3<-(C+.5*(D2-C)+C+.5*(D1-C))/2 txt<-rbind(RV1,RV2,RV3) xc<-txt[,1] yc<-txt[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.triCC(Xp[i,],Tr)$rv) Rv Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,asp=1,xlab="",ylab="", main="Illustration of CC-Vertex Regions\n in a Triangle", pch=".",axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".") L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tr,CC,Ds) xc<-txt[,1]+c(-.07,.08,.06,.12,-.1,-.1,-.09) yc<-txt[,2]+c(.02,-.02,.03,.0,.02,.06,-.04) txt.str<-c("A","B","C","CC","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
-vertex region in a triangle that contains a given pointReturns the index of the vertex
whose region contains point p
in
the triangle tri
with vertex regions are constructed with center of mass
(see the plots in the example for illustrations).
The vertices of triangle, tri
,
are labeled as
according to the row number the vertex is recorded in
tri
.
If the point, p
, is not inside tri
,
then the function yields NA
as output.
The corresponding vertex region is the polygon with the vertex, ,
and midpoints of the edges adjacent to the vertex.
See (Ceyhan (2005, 2010))
rel.vert.triCM(p, tri)
rel.vert.triCM(p, tri)
p |
A 2D point for which |
tri |
A |
A list
with two elements
rv |
Index of the |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.vert.tri
, rel.vert.triCC
, rel.vert.basic.triCM
,
rel.vert.basic.triCC
, rel.vert.basic.tri
, and rel.vert.std.triCM
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.6,2); Tr<-rbind(A,B,C); P<-c(1.4,1.2) rel.vert.triCM(P,Tr) n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.triCM(Xp[i,],Tr)$rv) Rv CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".") L<-Ds; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tr,CM,D1,D2,D3) xc<-txt[,1]+c(-.02,.02,.02,-.02,.02,-.01,-.01) yc<-txt[,2]+c(-.02,-.04,.06,-.02,.02,.06,-.06) txt.str<-c("rv=1","rv=2","rv=3","CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.6,2); Tr<-rbind(A,B,C); P<-c(1.4,1.2) rel.vert.triCM(P,Tr) n<-20 #try also n<-40 Xp<-runif.tri(n,Tr)$g Rv<-vector() for (i in 1:n) Rv<-c(Rv,rel.vert.triCM(Xp[i,],Tr)$rv) Rv CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,xlab="",ylab="",axes=TRUE,pch=".",xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".") L<-Ds; R<-matrix(rep(CM,3),ncol=2,byrow=TRUE) segments(L[,1], L[,2], R[,1], R[,2], lty = 2) text(Xp,labels=factor(Rv)) txt<-rbind(Tr,CM,D1,D2,D3) xc<-txt[,1]+c(-.02,.02,.02,-.02,.02,-.01,-.01) yc<-txt[,2]+c(-.02,-.04,.06,-.02,.02,.06,-.06) txt.str<-c("rv=1","rv=2","rv=3","CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
Returns the indices of the vertices
whose regions contain the points in data set Xp
in
a triangle tri
.
Vertex regions are based on center
in Cartesian coordinates or
in barycentric coordinates in the interior of the triangle
to the edges on the extension of the lines joining
M
to the vertices
or based on the circumcenter of tri
.
Vertices of triangle tri
are labeled as
according to the row number the vertex is recorded.
If a point in Xp
is not inside tri
,
then the function yields NA
as output for that entry.
The corresponding vertex region is the polygon with the vertex, M
, and
projection points from M
to the edges crossing the vertex
(as the output of prj.cent2edges(Tr,M)
)
or -vertex region
(see the examples for an illustration).
See also (Ceyhan (2005, 2011)).
rel.verts.tri(Xp, tri, M)
rel.verts.tri(Xp, tri, M)
Xp |
A set of 2D points representing the set of data points for which indices of the vertex regions containing them are to be determined. |
tri |
A |
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 |
A list
with two elements
rv |
Indices of the vertices
whose regions contains points in |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.verts.triCM
, rel.verts.triCC
,
and rel.verts.tri.nondegPE
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.0) P<-c(.4,.2) rel.verts.tri(P,Tr,M) n<-20 #try also n<-40 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) rel.verts.tri(Xp,Tr,M) rel.verts.tri(rbind(Xp,c(2,2)),Tr,M) rv<-rel.verts.tri(Xp,Tr,M) rv ifelse(identical(M,circumcenter.tri(Tr)), Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2),Ds<-prj.cent2edges(Tr,M)) Xlim<-range(Tr[,1],M[1],Xp[,1]) Ylim<-range(Tr[,2],M[2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Scatterplot of data points \n and M-vertex regions in a triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.02,.04,-.03,0) yc<-txt[,2]+c(.07,.04,.05,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.0) P<-c(.4,.2) rel.verts.tri(P,Tr,M) n<-20 #try also n<-40 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) rel.verts.tri(Xp,Tr,M) rel.verts.tri(rbind(Xp,c(2,2)),Tr,M) rv<-rel.verts.tri(Xp,Tr,M) rv ifelse(identical(M,circumcenter.tri(Tr)), Ds<-rbind((B+C)/2,(A+C)/2,(A+B)/2),Ds<-prj.cent2edges(Tr,M)) Xlim<-range(Tr[,1],M[1],Xp[,1]) Ylim<-range(Tr[,2],M[2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] if (dimension(M)==3) {M<-bary2cart(M,Tr)} #need to run this when M is given in barycentric coordinates plot(Tr,pch=".",xlab="",ylab="", main="Scatterplot of data points \n and M-vertex regions in a triangle", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.02,.04,-.03,0) yc<-txt[,2]+c(.07,.04,.05,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
Returns the indices of the vertices
whose regions contain the points in data set Xp
in
a triangle tri
and vertex regions are based on the center
cent
which yields nondegenerate asymptotic
distribution of the domination number of PE-PCD
for uniform data in tri
for expansion parameter r
in .
Vertices of triangle tri
are labeled as
according to the row number the vertex is recorded
if a point in
Xp
is not inside tri
,
then the function yields NA
as output for that entry.
The corresponding vertex region is the polygon with the vertex, cent
,
and projection points on the edges.
The center label cent
values 1,2,3
correspond to the vertices ,
, and
;
with default 1 (see the examples for an illustration).
See also (Ceyhan (2005, 2011)).
rel.verts.tri.nondegPE(Xp, tri, r, cent = 1)
rel.verts.tri.nondegPE(Xp, tri, r, cent = 1)
Xp |
A set of 2D points representing the set of data points for which indices of the vertex regions containing them are to be determined. |
tri |
A |
r |
A positive real number
which serves as the expansion parameter in PE proximity region;
must be in |
cent |
Index of the center
(as |
A list
with two elements
rv |
Indices (i.e., a |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.verts.triCM
, rel.verts.triCC
,
and rel.verts.tri
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); r<-1.35 cent<-2 P<-c(1.4,1.0) rel.verts.tri.nondegPE(P,Tr,r,cent) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g rel.verts.tri.nondegPE(Xp,Tr,r,cent) rel.verts.tri.nondegPE(rbind(Xp,c(2,2)),Tr,r,cent) rv<-rel.verts.tri.nondegPE(Xp,Tr,r,cent) M<-center.nondegPE(Tr,r)[cent,]; Ds<-prj.nondegPEcent2edges(Tr,r,cent) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,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=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.03,.05,.05) yc<-Tr[,2]+c(-.06,.02,.05) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.02,.04,-.03,0) yc<-txt[,2]+c(.07,.03,.05,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); r<-1.35 cent<-2 P<-c(1.4,1.0) rel.verts.tri.nondegPE(P,Tr,r,cent) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g rel.verts.tri.nondegPE(Xp,Tr,r,cent) rel.verts.tri.nondegPE(rbind(Xp,c(2,2)),Tr,r,cent) rv<-rel.verts.tri.nondegPE(Xp,Tr,r,cent) M<-center.nondegPE(Tr,r)[cent,]; Ds<-prj.nondegPEcent2edges(Tr,r,cent) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,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=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.03,.05,.05) yc<-Tr[,2]+c(-.06,.02,.05) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.02,.04,-.03,0) yc<-txt[,2]+c(.07,.03,.05,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
-vertex regions in a triangle
that contains the points in a give data set.Returns the indices of the vertices
whose regions contain the points in data set Xp
in
a triangle tri
and vertex regions are based on the circumcenter
of
tri
.
(see the plots in the example for illustrations).
The vertices of the triangle tri
are labeled as
,
, and
also
according to the row number the vertex is recorded in
tri
.
If a point in Xp
is not inside tri
,
then the function yields NA
as output.
The corresponding vertex region is the polygon
whose interior points are closest to that vertex.
If tri
is equilateral triangle,
then and
(center of mass) coincide.
See also (Ceyhan (2005, 2010)).
rel.verts.triCC(Xp, tri)
rel.verts.triCC(Xp, tri)
Xp |
A set of 2D points representing the set of data points for which indices of the vertex regions containing them are to be determined. |
tri |
A |
A list
with two elements
rv |
Indices (i.e., a |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.verts.triCM
, rel.verts.tri
,
and rel.verts.tri.nondegPE
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) rel.verts.triCC(P,Tr) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g rel.verts.triCC(Xp,Tr) rel.verts.triCC(rbind(Xp,c(2,2)),Tr) (rv<-rel.verts.triCC(Xp,Tr)) CC<-circumcenter.tri(Tr) D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1],CC[1]) Ylim<-range(Tr[,2],Xp[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",asp=1,xlab="",ylab="", main="Scatterplot of data points \n and the CC-vertex regions", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(CC,Ds) xc<-txt[,1]+c(.04,.04,-.03,0) yc<-txt[,2]+c(-.07,.04,.06,-.08) txt.str<-c("CC","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) rel.verts.triCC(P,Tr) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g rel.verts.triCC(Xp,Tr) rel.verts.triCC(rbind(Xp,c(2,2)),Tr) (rv<-rel.verts.triCC(Xp,Tr)) CC<-circumcenter.tri(Tr) D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1],CC[1]) Ylim<-range(Tr[,2],Xp[,2],CC[2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",asp=1,xlab="",ylab="", main="Scatterplot of data points \n and the CC-vertex regions", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp,pch=".",col=1) L<-matrix(rep(CC,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1] yc<-Tr[,2] txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(CC,Ds) xc<-txt[,1]+c(.04,.04,-.03,0) yc<-txt[,2]+c(-.07,.04,.06,-.08) txt.str<-c("CC","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
-vertex regions in a triangle
that contains the points in a give data setReturns the indices of the vertices
whose regions contain the points in data set Xp
in
a triangle tri
and vertex regions are based on the center of mass
of
tri
.
(see the plots in the example for illustrations).
The vertices of the triangle tri
are labeled as
,
, and
also
according to the row number the vertex is recorded in
tri
.
If a point in Xp
is not inside tri
,
then the function yields NA
as output for that entry.
The corresponding vertex region is the polygon
with the vertex, ,
and midpoints the edges crossing the vertex.
See also (Ceyhan (2005, 2010)).
rel.verts.triCM(Xp, tri)
rel.verts.triCM(Xp, tri)
Xp |
A set of 2D points representing the set of data points for which indices of the vertex regions containing them are to be determined. |
tri |
A |
A list
with two elements
rv |
Indices (i.e., a |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
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 (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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.
rel.verts.tri
, rel.verts.triCC
,
and rel.verts.tri.nondegPE
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) rel.verts.triCM(P,Tr) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g rv<-rel.verts.triCM(Xp,Tr) rv CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,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=".",col=1) L<-matrix(rep(CM,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.04,.05,.05) yc<-Tr[,2]+c(-.05,.05,.03) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(CM,Ds) xc<-txt[,1]+c(.04,.04,-.03,0) yc<-txt[,2]+c(-.07,.04,.06,-.08) txt.str<-c("CM","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); P<-c(.4,.2) rel.verts.triCM(P,Tr) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g rv<-rel.verts.triCM(Xp,Tr) rv CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) Xlim<-range(Tr[,1],Xp[,1]) Ylim<-range(Tr[,2],Xp[,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=".",col=1) L<-matrix(rep(CM,3),ncol=2,byrow=TRUE); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.04,.05,.05) yc<-Tr[,2]+c(-.05,.05,.03) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(CM,Ds) xc<-txt[,1]+c(.04,.04,-.03,0) yc<-txt[,2]+c(-.07,.04,.06,-.08) txt.str<-c("CM","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
An alternative function to the function rel.verts.tri
when the center M is not the circumcenter falling outside the triangle.
This function only works for a center in the interior of the triangle,
with the projections of
to the edges
along the lines joining
to the vertices.
rel.verts.triM(Xp, tri, M)
rel.verts.triM(Xp, tri, M)
Xp |
A set of 2D points representing the set of data points for which indices of the vertex regions containing them are to be determined. |
tri |
A |
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 |
A list
with two elements
rv |
Indices of the vertices
whose regions contains points in |
tri |
The vertices of the triangle,
where row number corresponds to the vertex index in |
Elvan Ceyhan
There are no references for Rd macro \insertAllCites
on this help page.
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.0) P<-c(.4,.2) rel.verts.triM(P,Tr,M) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-c(1.6,1.0) #try also M<-c(1.3,1.3) (rv<-rel.verts.tri(Xp,Tr,M)) rel.verts.triM(rbind(Xp,c(2,2)),Tr,M) Ds<-prj.cent2edges(Tr,M) Xlim<-range(Tr[,1]) Ylim<-range(Tr[,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=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.03,.05,.05) yc<-Tr[,2]+c(-.06,.02,.05) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.02,.04,-.03,0) yc<-txt[,2]+c(.07,.03,.05,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); M<-c(1.6,1.0) P<-c(.4,.2) rel.verts.triM(P,Tr,M) n<-20 #try also n<-40 set.seed(1) Xp<-runif.tri(n,Tr)$g M<-c(1.6,1.0) #try also M<-c(1.3,1.3) (rv<-rel.verts.tri(Xp,Tr,M)) rel.verts.triM(rbind(Xp,c(2,2)),Tr,M) Ds<-prj.cent2edges(Tr,M) Xlim<-range(Tr[,1]) Ylim<-range(Tr[,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=".",col=1) L<-rbind(M,M,M); R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty = 2) xc<-Tr[,1]+c(-.03,.05,.05) yc<-Tr[,2]+c(-.06,.02,.05) txt.str<-c("rv=1","rv=2","rv=3") text(xc,yc,txt.str) txt<-rbind(M,Ds) xc<-txt[,1]+c(.02,.04,-.03,0) yc<-txt[,2]+c(.07,.03,.05,-.07) txt.str<-c("M","D1","D2","D3") text(xc,yc,txt.str) text(Xp,labels=factor(rv$rv)) ## End(Not run)
An object of class "Patterns"
.
Generates n
2D points uniformly
in
(
and
are denoted as
a1
and b1
as arguments) where
with
being number of
Yp
points
for various values of e
under the segregation pattern
and is the ball centered at
with radius
e
.
Positive values of e
yield realizations from the segregation pattern
and nonpositive values of e
provide
a type of complete spatial randomness (CSR),
e
should not be too large
to make the support of generated points empty,
a1
is defaulted
to the minimum of the -coordinates of the
Yp
points,
a2
is defaulted
to the maximum of the -coordinates of the
Yp
points,
b1
is defaulted
to the minimum of the -coordinates of the
Yp
points,
b2
is defaulted
to the maximum of the -coordinates of the
Yp
points.
rseg.circular( n, Yp, e, a1 = min(Yp[, 1]), a2 = max(Yp[, 1]), b1 = min(Yp[, 2]), b2 = max(Yp[, 2]) )
rseg.circular( n, Yp, e, a1 = min(Yp[, 1]), a2 = max(Yp[, 1]), b1 = min(Yp[, 2]), b2 = max(Yp[, 2]) )
n |
A positive integer representing the number of points to be generated. |
Yp |
A set of 2D points representing the reference points. The generated points are segregated (in a circular or radial fashion) from these points. |
e |
A positive real number
representing the radius of the balls centered at |
a1 , a2
|
Real numbers representing
the range of |
b1 , b2
|
Real numbers representing
the range of |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
parameters |
Radial (i.e., circular) exclusion parameter of the segregation pattern |
ref.points |
The input set of reference points |
gen.points |
The output set of generated points segregated
from |
tri.Yp |
Logical output for triangulation
based on |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The possible ranges of the |
Elvan Ceyhan
rassoc.circular
, rseg.std.tri
,
rsegII.std.tri
, and rseg.multi.tri
## Not run: nx<-100; ny<-4; #try also nx<-1000; ny<-10 e<-.15; #try also e<- -.1; #a negative e provides a CSR realization #with default bounding box (i.e., unit square) Y<-cbind(runif(ny),runif(ny)) Xdt<-rseg.circular(nx,Y,e) Xdt summary(Xdt) plot(Xdt,asp=1) #with default bounding box (i.e., unit square) Y<-cbind(runif(ny),runif(ny)) Xdt<-Xdt$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,pch=16,col=2,lwd=2, xlab="x",ylab="y", main="Circular Segregation of X points from Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) points(Xdt) #with a rectangular bounding box a1<-0; a2<-10; b1<-0; b2<-5; e<-1.5; Y<-cbind(runif(ny,a1,a2),runif(ny,b1,b2)) #try also Y<-cbind(runif(ny,a1,a2/2),runif(ny,b1,b2/2)) Xdt<-rseg.circular(nx,Y,e,a1,a2,b1,b2)$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) plot(Y,pch=16,asp=1,col=2,lwd=2, xlab="x",ylab="y", main="Circular Segregation of X points from Y Points", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xdt) ## End(Not run)
## Not run: nx<-100; ny<-4; #try also nx<-1000; ny<-10 e<-.15; #try also e<- -.1; #a negative e provides a CSR realization #with default bounding box (i.e., unit square) Y<-cbind(runif(ny),runif(ny)) Xdt<-rseg.circular(nx,Y,e) Xdt summary(Xdt) plot(Xdt,asp=1) #with default bounding box (i.e., unit square) Y<-cbind(runif(ny),runif(ny)) Xdt<-Xdt$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Y,asp=1,pch=16,col=2,lwd=2, xlab="x",ylab="y", main="Circular Segregation of X points from Y Points", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) points(Xdt) #with a rectangular bounding box a1<-0; a2<-10; b1<-0; b2<-5; e<-1.5; Y<-cbind(runif(ny,a1,a2),runif(ny,b1,b2)) #try also Y<-cbind(runif(ny,a1,a2/2),runif(ny,b1,b2/2)) Xdt<-rseg.circular(nx,Y,e,a1,a2,b1,b2)$gen.points Xlim<-range(Xdt[,1],Y[,1]); Ylim<-range(Xdt[,2],Y[,2]) plot(Y,pch=16,asp=1,col=2,lwd=2, xlab="x",ylab="y", main="Circular Segregation of X points from Y Points", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) points(Xdt) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly in the support
for Type I segregation in the convex hull of
set of points, Yp
.
delta
is the parameter of segregation
(that is, % of the area around each vertex
in each Delaunay
triangle is forbidden for point generation).
delta
corresponds to eps
in the standard equilateral triangle
as
(see
rseg.std.tri
function).
If Yp
consists only of 3 points,
then the function behaves like the
function rseg.tri
.
DTmesh
must be the Delaunay triangulation of Yp
and DTr
must be the corresponding Delaunay triangles
(both DTmesh
and DTr
are NULL
by default).
If NULL
, DTmesh
is computed
via tri.mesh
and DTr
is computed via triangles
function in interp
package.
tri.mesh
function yields the triangulation nodes
with their neighbours,
and creates a triangulation object,
and triangles
function
yields a triangulation data structure
from the triangulation object created
by tri.mesh
(the first three columns are
the vertex indices of the Delaunay triangles.)
See (Ceyhan et al. (2006); Ceyhan et al. (2007); Ceyhan (2011)) for more on the segregation pattern. Also, see (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
rseg.multi.tri(n, Yp, delta, DTmesh = NULL, DTr = NULL)
rseg.multi.tri(n, Yp, delta, DTmesh = NULL, DTr = NULL)
n |
A positive integer representing the number of points to be generated. |
Yp |
A set of 2D points from which Delaunay triangulation is constructed. |
delta |
A positive real number in |
DTmesh |
Delaunay triangulation of |
DTr |
Delaunay triangles based on |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
parameters |
Exclusion parameter, |
ref.points |
The input set of points |
gen.points |
The output set of generated points segregated
from |
tri.Y |
Logical output, |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
rseg.circular
, rseg.std.tri
,
rsegII.std.tri
, and rassoc.multi.tri
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-4; #try also nx<-1000; ny<-10; set.seed(1) Yp<-cbind(runif(ny),runif(ny)) del<-.4 Xdt<-rseg.multi.tri(nx,Yp,del) Xdt summary(Xdt) plot(Xdt) #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points TRY<-interp::triangles(DTY)[,1:3]; Xp<-rseg.multi.tri(nx,Yp,del,DTY,TRY)$gen.points #data under CSR in the convex hull of Ypoints Xlim<-range(Yp[,1]) Ylim<-range(Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points par(pty="s") plot(Xp,main="Points from Type I Segregation \n in Multipe Triangles", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points=TRUE,col="blue") points(Xp,pch=".",cex=3) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-4; #try also nx<-1000; ny<-10; set.seed(1) Yp<-cbind(runif(ny),runif(ny)) del<-.4 Xdt<-rseg.multi.tri(nx,Yp,del) Xdt summary(Xdt) plot(Xdt) #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points TRY<-interp::triangles(DTY)[,1:3]; Xp<-rseg.multi.tri(nx,Yp,del,DTY,TRY)$gen.points #data under CSR in the convex hull of Ypoints Xlim<-range(Yp[,1]) Ylim<-range(Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points par(pty="s") plot(Xp,main="Points from Type I Segregation \n in Multipe Triangles", xlab=" ", ylab=" ",xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points=TRUE,col="blue") points(Xp,pch=".",cex=3) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly
in the standard equilateral triangle
under the type I segregation alternative for
eps
in .
In the type I segregation, the triangular forbidden regions
around the vertices are determined by
the parameter eps
which serves as the height of these triangles
(see examples for a sample plot.)
See also (Ceyhan et al. (2006); Ceyhan et al. (2007); Ceyhan (2011)).
rseg.std.tri(n, eps)
rseg.std.tri(n, eps)
n |
A positive integer representing the number of points to be generated. |
eps |
A positive real number representing the parameter of type I segregation (which is the height of the triangular forbidden regions around the vertices). |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
parameters |
The exclusion parameter, |
ref.points |
The input set of points |
gen.points |
The output set of generated points segregated
from |
tri.Y |
Logical output for triangulation
based on |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
rseg.circular
, rassoc.circular
,
rsegII.std.tri
, and rseg.multi.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 eps<-.3 #try also .15, .5, .75 set.seed(1) Xdt<-rseg.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,asp=1,pch=".",xlab="",ylab="", main="Type I segregation in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type I segregation alternative sr<-eps/(sqrt(3)/2) C1<-C+sr*(A-C); C2<-C+sr*(B-C) A1<-A+sr*(B-A); A2<-A+sr*(C-A) B1<-B+sr*(A-B); B2<-B+sr*(C-B) supp<-rbind(A1,B1,B2,C2,C1,A2) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type I Segregation", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) if (sr<=.5) { polygon(Te) polygon(supp,col=5) } else { polygon(Te,col=5,lwd=2.5) polygon(rbind(A,A1,A2),col=0,border=NA) polygon(rbind(B,B1,B2),col=0,border=NA) polygon(rbind(C,C1,C2),col=0,border=NA) } points(Xp) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 eps<-.3 #try also .15, .5, .75 set.seed(1) Xdt<-rseg.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,asp=1,pch=".",xlab="",ylab="", main="Type I segregation in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type I segregation alternative sr<-eps/(sqrt(3)/2) C1<-C+sr*(A-C); C2<-C+sr*(B-C) A1<-A+sr*(B-A); A2<-A+sr*(C-A) B1<-B+sr*(A-B); B2<-B+sr*(C-B) supp<-rbind(A1,B1,B2,C2,C1,A2) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type I Segregation", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) if (sr<=.5) { polygon(Te) polygon(supp,col=5) } else { polygon(Te,col=5,lwd=2.5) polygon(rbind(A,A1,A2),col=0,border=NA) polygon(rbind(B,B1,B2),col=0,border=NA) polygon(rbind(C,C1,C2),col=0,border=NA) } points(Xp) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly in the support
for Type I segregation in a given triangle, tri
.
delta
is the parameter of segregation (that is,
% of the area around each vertex
in the triangle is forbidden for point generation).
delta
corresponds to eps
in the
standard equilateral triangle as
(see
rseg.std.tri
function).
See (Ceyhan et al. (2006); Ceyhan et al. (2007); Ceyhan (2011)) for more on the segregation pattern.
rseg.tri(n, tri, delta)
rseg.tri(n, tri, delta)
n |
A positive integer representing the number of points
to be generated from the segregation pattern
in the triangle, |
tri |
A |
delta |
A positive real number in |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
parameters |
Exclusion parameter, |
ref.points |
The input set of points, i.e., vertices of |
gen.points |
The output set of generated points segregated
from the vertices of |
tri.Y |
Logical output,
if |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
rassoc.tri
, rseg.std.tri
,
rsegII.std.tri
, and rseg.multi.tri
## Not run: n<-100 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) del<-.4 Xdt<-rseg.tri(n,Tr,del) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Points from Type I Segregation \n in one Triangle", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.03) txt.str<-c("A","B","C") text(xc,yc,txt.str) ## End(Not run)
## Not run: n<-100 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) del<-.4 Xdt<-rseg.tri(n,Tr,del) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="", main="Points from Type I Segregation \n in one Triangle", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.03) txt.str<-c("A","B","C") text(xc,yc,txt.str) ## End(Not run)
An object of class "Patterns"
.
Generates n
points uniformly
in the standard equilateral triangle
under the type II segregation alternative
for
eps
in .
In the type II segregation, the annular forbidden regions
around the edges are determined by
the parameter eps
which is the distance from the interior triangle
(i.e., support for the segregation)
to (see examples for a sample plot.)
rsegII.std.tri(n, eps)
rsegII.std.tri(n, eps)
n |
A positive integer representing the number of points to be generated. |
eps |
A positive real number
representing the parameter of type II segregation (which is the
distance from the interior triangle points to the boundary of |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
parameters |
The exclusion parameter,
|
ref.points |
The input set of points |
gen.points |
The output set of generated points
segregated from |
tri.Y |
Logical output for triangulation
based on |
desc.pat |
Description of the point pattern |
num.points |
The |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
rseg.circular
, rassoc.circular
,
rseg.std.tri
, and rseg.multi.tri
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 #try also n<-20 or n<-100 or 1000 eps<-.15 #try also .2 set.seed(1) Xdt<-rsegII.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,pch=".",xlab="",ylab="", main="Type II segregation in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type II segregation alternative C1<-c(1/2,sqrt(3)/2-2*eps); A1<-c(eps*sqrt(3),eps); B1<-c(1-eps*sqrt(3),eps); supp<-rbind(A1,B1,C1) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type II Segregation", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) polygon(supp,col=5) points(Xp)
A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-10 #try also n<-20 or n<-100 or 1000 eps<-.15 #try also .2 set.seed(1) Xdt<-rsegII.std.tri(n,eps) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-Xdt$gen.points plot(Te,pch=".",xlab="",ylab="", main="Type II segregation in the \n standard equilateral triangle", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) #The support for the Type II segregation alternative C1<-c(1/2,sqrt(3)/2-2*eps); A1<-c(eps*sqrt(3),eps); B1<-c(1-eps*sqrt(3),eps); supp<-rbind(A1,B1,C1) plot(Te,asp=1,pch=".",xlab="",ylab="", main="Support of the Type II Segregation", xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01)) polygon(Te) polygon(supp,col=5) points(Xp)
An object of class "Uniform"
.
Generates n
points uniformly
in the standard basic triangle
where
is in
,
and
.
Any given triangle can be mapped to the basic triangle by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle (Ceyhan (2005); Ceyhan et al. (2007); Ceyhan et al. (2006)). Hence, standard basic triangle is useful for simulation studies under the uniformity hypothesis.
runif.basic.tri(n, c1, c2)
runif.basic.tri(n, c1, c2)
n |
A positive integer representing the number of uniform points to be generated in the standard basic triangle. |
c1 , c2
|
Positive real numbers representing the top vertex
in standard basic triangle
|
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
tess.points |
The vertices of the support
of the uniformly generated points,
it is the standard basic triangle |
gen.points |
The output set of generated points uniformly in the standard basic triangle |
out.region |
The outer region which contains the support region,
|
desc.pat |
Description of the point pattern from which points are to be generated |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
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, Priebe CE, Marchette DJ (2007).
“A new family of random graphs for testing spatial segregation.”
Canadian Journal of Statistics, 35(1), 27-50.
Ceyhan E, Priebe CE, Wierman JC (2006).
“Relative density of the random -factor proximity catch digraphs for testing spatial patterns of segregation and association.”
Computational Statistics & Data Analysis, 50(8), 1925-1964.
runif.std.tri
, runif.tri
,
and runif.multi.tri
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); n<-100 set.seed(1) runif.basic.tri(1,c1,c2) Xdt<-runif.basic.tri(n,c1,c2) Xdt summary(Xdt) plot(Xdt) Xp<-runif.basic.tri(n,c1,c2)$g Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01),type="n") polygon(Tb) points(Xp) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); Tb<-rbind(A,B,C); n<-100 set.seed(1) runif.basic.tri(1,c1,c2) Xdt<-runif.basic.tri(n,c1,c2) Xdt summary(Xdt) plot(Xdt) Xp<-runif.basic.tri(n,c1,c2)$g Xlim<-range(Tb[,1]) Ylim<-range(Tb[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tb,xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01),type="n") polygon(Tb) points(Xp) ## End(Not run)
An object of class "Uniform"
.
Generates n
points uniformly
in the Convex Hull of set of points, Yp
.
That is, generates uniformly in each of the triangles
in the Delaunay triangulation of Yp
, i.e.,
in the multiple triangles partitioning the convex hull of Yp
.
If Yp
consists only of 3 points,
then the function behaves like the
function runif.tri
.
DTmesh
is the Delaunay triangulation of Yp
,
default is DTmesh=NULL
.
DTmesh
yields triangulation nodes with neighbours
(result of tri.mesh
function
from interp
package).
See (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
runif.multi.tri(n, Yp, DTmesh = NULL)
runif.multi.tri(n, Yp, DTmesh = NULL)
n |
A positive integer
representing the number of uniform points to be generated
in the convex hull of the point set |
Yp |
A set of 2D points whose convex hull is the support of the uniform points to be generated. |
DTmesh |
Triangulation nodes with neighbours
(result of |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
tess.points |
The points which constitute the vertices of the triangulation and whose convex hull determines the support of the generated points. |
gen.points |
The output set of generated points uniformly
in the convex hull of |
out.region |
The outer region which contains the support region,
|
desc.pat |
Description of the point pattern from which points are to be generated |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
runif.tri
, runif.std.tri
,
and runif.basic.tri
,
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-4; #try also nx<-1000; ny<-10; set.seed(1) Yp<-cbind(runif(ny,0,10),runif(ny,0,10)) Xdt<-runif.multi.tri(nx,Yp) #data under CSR in the convex hull of Ypoints Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points Xp<-runif.multi.tri(nx,Yp,DTY)$g #data under CSR in the convex hull of Ypoints Xlim<-range(Yp[,1]) Ylim<-range(Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation plot(Xp, xlab=" ", ylab=" ", main="Uniform Points in Convex Hull of Y Points", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points = TRUE,pch=16,col="blue") points(Xp,pch=".",cex=3) Yp<-rbind(c(.3,.2),c(.4,.5),c(.14,.15)) runif.multi.tri(nx,Yp) ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-100; ny<-4; #try also nx<-1000; ny<-10; set.seed(1) Yp<-cbind(runif(ny,0,10),runif(ny,0,10)) Xdt<-runif.multi.tri(nx,Yp) #data under CSR in the convex hull of Ypoints Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g #or use DTY<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") #Delaunay triangulation based on Y points Xp<-runif.multi.tri(nx,Yp,DTY)$g #data under CSR in the convex hull of Ypoints Xlim<-range(Yp[,1]) Ylim<-range(Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] #plot of the data in the convex hull of Y points together with the Delaunay triangulation plot(Xp, xlab=" ", ylab=" ", main="Uniform Points in Convex Hull of Y Points", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),type="n") interp::plot.triSht(DTY, add=TRUE, do.points = TRUE,pch=16,col="blue") points(Xp,pch=".",cex=3) Yp<-rbind(c(.3,.2),c(.4,.5),c(.14,.15)) runif.multi.tri(nx,Yp) ## End(Not run)
An object of class "Uniform"
.
Generates n
points uniformly in the standard regular tetrahedron
.
runif.std.tetra(n)
runif.std.tetra(n)
n |
A positive integer
representing the number of uniform points to be generated in the
standard regular tetrahedron |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
tess.points |
The vertices of the support region
of the uniformly generated points, it is the
standard regular tetrahedron |
gen.points |
The output set of generated points uniformly
in the standard regular tetrahedron |
out.region |
The outer region which contains the support region,
|
desc.pat |
Description of the point pattern from which points are to be generated |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit , zlimit
|
The ranges of the |
Elvan Ceyhan
runif.tetra
, runif.tri
,
and runif.multi.tri
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-100 set.seed(1) Xdt<-runif.std.tetra(n) Xdt summary(Xdt) plot(Xdt) Xp<-runif.std.tetra(n)$g Xlim<-range(tetra[,1]) Ylim<-range(tetra[,2]) Zlim<-range(tetra[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =20,theta=15, bty = "g", pch = 20, cex = 1, ticktype = "detailed", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05)) #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1]+c(.05,0,0,0),tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) ## End(Not run) ## Not run: #need to install scatterplot3d package and call "library(scatterplot3d)" s3d<-scatterplot3d(Xp, highlight.3d=TRUE,xlab="x", ylab="y",zlab="z", col.axis="blue", col.grid="lightblue", main="3D Scatterplot of the data", pch=20) s3d$points3d(tetra,pch=20,col="blue") ## End(Not run)
## Not run: A<-c(0,0,0); B<-c(1,0,0); C<-c(1/2,sqrt(3)/2,0); D<-c(1/2,sqrt(3)/6,sqrt(6)/3) tetra<-rbind(A,B,C,D) n<-100 set.seed(1) Xdt<-runif.std.tetra(n) Xdt summary(Xdt) plot(Xdt) Xp<-runif.std.tetra(n)$g Xlim<-range(tetra[,1]) Ylim<-range(tetra[,2]) Zlim<-range(tetra[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], phi =20,theta=15, bty = "g", pch = 20, cex = 1, ticktype = "detailed", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05)) #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1]+c(.05,0,0,0),tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) ## End(Not run) ## Not run: #need to install scatterplot3d package and call "library(scatterplot3d)" s3d<-scatterplot3d(Xp, highlight.3d=TRUE,xlab="x", ylab="y",zlab="z", col.axis="blue", col.grid="lightblue", main="3D Scatterplot of the data", pch=20) s3d$points3d(tetra,pch=20,col="blue") ## End(Not run)
An object of class "Uniform"
.
Generates n
points uniformly
in the standard equilateral triangle
with vertices
,
, and
.
runif.std.tri(n)
runif.std.tri(n)
n |
A positive integer representing the number of uniform points
to be generated in the standard equilateral triangle |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
tess.points |
The vertices of the support region of
the uniformly generated points, it is the
standard equilateral triangle |
gen.points |
The output set of generated points uniformly
in the standard equilateral triangle |
out.region |
The outer region which contains the support region,
|
desc.pat |
Description of the point pattern from which points are to be generated |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
runif.basic.tri
, runif.tri
,
and runif.multi.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 set.seed(1) Xdt<-runif.std.tri(n) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-runif.std.tri(n)$gen.points plot(Te,asp=1,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); n<-100 set.seed(1) Xdt<-runif.std.tri(n) Xdt summary(Xdt) plot(Xdt,asp=1) Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xp<-runif.std.tri(n)$gen.points plot(Te,asp=1,pch=".",xlab="",ylab="",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01)) polygon(Te) points(Xp) ## End(Not run)
An object of class "Uniform"
.
Generates n
points uniformly
in the first 1/6th of the standard equilateral triangle
with vertices with
;
,
(see the examples below).
The first 1/6th of the standard equilateral triangle is the triangle with vertices
,
,
.
runif.std.tri.onesixth(n)
runif.std.tri.onesixth(n)
n |
a positive integer representing number of uniform points
to be generated
in the first one-sixth of |
A list
with the elements
type |
The type of the point pattern |
mtitle |
The |
support |
The vertices of the support of the uniformly generated points |
gen.points |
The output set of uniformly generated points in the first 1/6th of the standard equilateral triangle. |
out.region |
The outer region for the one-sixth of |
desc.pat |
Description of the point pattern |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
runif.std.tri
, runif.basic.tri
,
runif.tri
, and runif.multi.tri
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); CM<-(A+B+C)/3; D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) nx<-100 #try also nx<-1000 #data generation step set.seed(1) Xdt<-runif.std.tri.onesixth(nx) Xdt summary(Xdt) plot(Xdt,asp=1) Xd<-Xdt$gen.points #plot of the data with the regions in the equilateral triangle Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,asp=1,pch=".",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01),xlab=" ",ylab=" ", main="first 1/6th of the \n standard equilateral triangle") polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) polygon(rbind(A,D3,CM),col=5) points(Xd) #letter annotation of the plot txt<-rbind(A,B,C,CM,D1,D2,D3) xc<-txt[,1]+c(-.02,.02,.02,.04,.05,-.03,0) yc<-txt[,2]+c(.02,.02,.02,.03,0,.03,-.03) txt.str<-c("A","B","C","CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C); CM<-(A+B+C)/3; D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) nx<-100 #try also nx<-1000 #data generation step set.seed(1) Xdt<-runif.std.tri.onesixth(nx) Xdt summary(Xdt) plot(Xdt,asp=1) Xd<-Xdt$gen.points #plot of the data with the regions in the equilateral triangle Xlim<-range(Te[,1]) Ylim<-range(Te[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Te,asp=1,pch=".",xlim=Xlim+xd*c(-.01,.01), ylim=Ylim+yd*c(-.01,.01),xlab=" ",ylab=" ", main="first 1/6th of the \n standard equilateral triangle") polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) polygon(rbind(A,D3,CM),col=5) points(Xd) #letter annotation of the plot txt<-rbind(A,B,C,CM,D1,D2,D3) xc<-txt[,1]+c(-.02,.02,.02,.04,.05,-.03,0) yc<-txt[,2]+c(.02,.02,.02,.03,0,.03,-.03) txt.str<-c("A","B","C","CM","D1","D2","D3") text(xc,yc,txt.str) ## End(Not run)
An object of class "Uniform"
.
Generates n
points uniformly
in the general tetrahedron th
whose vertices are stacked row-wise.
runif.tetra(n, th)
runif.tetra(n, th)
n |
A positive integer representing the number of uniform points to be generated in the tetrahedron. |
th |
A |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
tess.points |
The vertices of the support of
the uniformly generated points,
it is the tetrahedron' |
gen.points |
The output set of generated points uniformly
in the tetrahedron, |
out.region |
The outer region
which contains the support region,
|
desc.pat |
Description of the point pattern from which points are to be generated |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit , zlimit
|
The ranges of the |
Elvan Ceyhan
## Not run: A<-sample(1:12,3); B<-sample(1:12,3); C<-sample(1:12,3); D<-sample(1:12,3) tetra<-rbind(A,B,C,D) n<-100 set.seed(1) Xdt<-runif.tetra(n,tetra) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], theta =225, phi = 30, bty = "g", main="Uniform Points in a Tetrahedron", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) #need to install scatterplot3d package and call "library(scatterplot3d)" s3d<-scatterplot3d(Xp, highlight.3d=TRUE, xlab="x",ylab="y",zlab="z", col.axis="blue", col.grid="lightblue", main="3D Scatterplot of the data", pch=20) s3d$points3d(tetra,pch=20,col="blue") ## End(Not run)
## Not run: A<-sample(1:12,3); B<-sample(1:12,3); C<-sample(1:12,3); D<-sample(1:12,3) tetra<-rbind(A,B,C,D) n<-100 set.seed(1) Xdt<-runif.tetra(n,tetra) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(tetra[,1],Xp[,1]) Ylim<-range(tetra[,2],Xp[,2]) Zlim<-range(tetra[,3],Xp[,3]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] zd<-Zlim[2]-Zlim[1] plot3D::scatter3D(Xp[,1],Xp[,2],Xp[,3], theta =225, phi = 30, bty = "g", main="Uniform Points in a Tetrahedron", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05), zlim=Zlim+zd*c(-.05,.05), pch = 20, cex = 1, ticktype = "detailed") #add the vertices of the tetrahedron plot3D::points3D(tetra[,1],tetra[,2],tetra[,3], add=TRUE) L<-rbind(A,A,A,B,B,C); R<-rbind(B,C,D,C,D,D) plot3D::segments3D(L[,1], L[,2], L[,3], R[,1], R[,2],R[,3], add=TRUE,lwd=2) plot3D::text3D(tetra[,1],tetra[,2],tetra[,3], labels=c("A","B","C","D"), add=TRUE) #need to install scatterplot3d package and call "library(scatterplot3d)" s3d<-scatterplot3d(Xp, highlight.3d=TRUE, xlab="x",ylab="y",zlab="z", col.axis="blue", col.grid="lightblue", main="3D Scatterplot of the data", pch=20) s3d$points3d(tetra,pch=20,col="blue") ## End(Not run)
An object of class "Uniform"
.
Generates n
points uniformly in a given triangle, tri
runif.tri(n, tri)
runif.tri(n, tri)
n |
A positive integer representing the number of uniform points to be generated in the triangle. |
tri |
A |
A list
with the elements
type |
The type of the pattern from which points are to be generated |
mtitle |
The |
tess.points |
The vertices of the support of
the uniformly generated points, it is the triangle
|
gen.points |
The output set of generated points uniformly
in the triangle, |
out.region |
The outer region which contains the support region,
|
desc.pat |
Description of the point pattern from which points are to be generated |
num.points |
The |
txt4pnts |
Description of the two numbers in |
xlimit , ylimit
|
The ranges of the |
Elvan Ceyhan
runif.std.tri
, runif.basic.tri
,
and runif.multi.tri
## Not run: n<-100 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) Xdt<-runif.tri(n,Tr) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="",main="Uniform Points in One Triangle", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) ## End(Not run)
## Not run: n<-100 A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C) Xdt<-runif.tri(n,Tr) Xdt summary(Xdt) plot(Xdt) Xp<-Xdt$g Xlim<-range(Tr[,1]) Ylim<-range(Tr[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(Tr,pch=".",xlab="",ylab="",main="Uniform Points in One Triangle", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) points(Xp) xc<-Tr[,1]+c(-.02,.02,.02) yc<-Tr[,2]+c(.02,.02,.04) txt.str<-c("A","B","C") text(xc,yc,txt.str) ## End(Not run)
Returns the triangle whose intersection
with a general triangle gives the support for
type I segregation given the delta
(i.e., % area of a triangle around the
vertices is chopped off).
See the plot in the examples.
Caveat: the vertices of this triangle may be
outside the triangle, tri
, depending on the value of
delta
(i.e., for small values of delta
).
seg.tri.support(delta, tri)
seg.tri.support(delta, tri)
delta |
A positive real number between 0 and 1 that determines the percentage of area of the triangle around the vertices forbidden for point generation. |
tri |
A |
the vertices of the triangle (stacked row-wise)
whose intersection with a general triangle
gives the support for type I segregation for the given delta
Elvan Ceyhan
rseg.std.tri
and rseg.multi.tri
## Not run: #for a general triangle A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); delta<-.3 #try also .5,.75,.85 Tseg<-seg.tri.support(delta,Tr) Xlim<-range(Tr[,1],Tseg[,1]) Ylim<-range(Tr[,2],Tseg[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] par(pty="s") plot(Tr,pch=".",xlab="",ylab="", main="segregation support is the intersection\n of these two triangles", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) polygon(Tseg,lty=2) txt<-rbind(Tr,Tseg) xc<-txt[,1]+c(-.03,.03,.03,.06,.04,-.04) yc<-txt[,2]+c(.02,.02,.04,-.03,0,0) txt.str<-c("A","B","C","T1","T2","T3") text(xc,yc,txt.str) ## End(Not run)
## Not run: #for a general triangle A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); delta<-.3 #try also .5,.75,.85 Tseg<-seg.tri.support(delta,Tr) Xlim<-range(Tr[,1],Tseg[,1]) Ylim<-range(Tr[,2],Tseg[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] par(pty="s") plot(Tr,pch=".",xlab="",ylab="", main="segregation support is the intersection\n of these two triangles", axes=TRUE,xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05)) polygon(Tr) polygon(Tseg,lty=2) txt<-rbind(Tr,Tseg) xc<-txt[,1]+c(-.03,.03,.03,.06,.04,-.04) yc<-txt[,2]+c(.02,.02,.04,-.03,0,0) txt.str<-c("A","B","C","T1","T2","T3") text(xc,yc,txt.str) ## End(Not run)
An object of class "Extrema"
.
Returns the six closest points among the data set, Xp
,
in the standard equilateral triangle
in half edge regions.
In particular,
in regions
and
,
it finds the closest point
in each region to the line segment
in regions
and
,
it finds the closest point
in each region to the line segment
and
in regions
and
,
it finds the closest point
in each region to the line segment
where
is the center of mass.
See the example for this function or example for
index.six.Te
function.
If there is no data point in region ,
then it returns "
NA
NA
" for -th row in the extrema.
ch.all.intri
is for checking
whether all data points are in (default is
FALSE
).
six.extremaTe(Xp, ch.all.intri = FALSE)
six.extremaTe(Xp, ch.all.intri = FALSE)
Xp |
A set of 2D points among which the closest points in the standard equilateral triangle to the median lines in 6 half edge regions. |
ch.all.intri |
A logical argument
for checking whether all data points are in |
A list
with the elements
txt1 |
Region labels as r1-r6 (correspond to row number in Extremum Points). |
txt2 |
A short description of the distances
as |
type |
Type of the extrema points |
mtitle |
The |
ext |
The extrema points, here,
closest points in each of regions |
X |
The input data, |
num.points |
The number of data points, i.e., size of |
supp |
Support of the data points, here, it is |
cent |
The center point used for construction of edge regions. |
ncent |
Name of the center, |
regions |
The six regions, |
region.names |
Names of the regions
as |
region.centers |
Centers of mass of the regions |
dist2ref |
Distances from closest points
in each of regions |
Elvan Ceyhan
index.six.Te
and cl2edges.std.tri
## Not run: n<-20 #try also n<-100 Xp<-runif.std.tri(n)$gen.points Ext<-six.extremaTe(Xp) Ext summary(Ext) plot(Ext) sixt<-Ext A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) h1<-c(1/2,sqrt(3)/18); h2<-c(2/3, sqrt(3)/9); h3<-c(2/3, 2*sqrt(3)/9); h4<-c(1/2, 5*sqrt(3)/18); h5<-c(1/3, 2*sqrt(3)/9); h6<-c(1/3, sqrt(3)/9); r1<-(h1+h6+CM)/3;r2<-(h1+h2+CM)/3;r3<-(h2+h3+CM)/3; r4<-(h3+h4+CM)/3;r5<-(h4+h5+CM)/3;r6<-(h5+h6+CM)/3; Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) polygon(rbind(h1,h2,h3,h4,h5,h6)) points(Xp) points(sixt$ext,pty=2,pch=4,col="red") txt<-rbind(Te,r1,r2,r3,r4,r5,r6) xc<-txt[,1]+c(-.02,.02,.02,0,0,0,0,0,0) yc<-txt[,2]+c(.02,.02,.03,0,0,0,0,0,0) txt.str<-c("A","B","C","1","2","3","4","5","6") text(xc,yc,txt.str) ## End(Not run)
## Not run: n<-20 #try also n<-100 Xp<-runif.std.tri(n)$gen.points Ext<-six.extremaTe(Xp) Ext summary(Ext) plot(Ext) sixt<-Ext A<-c(0,0); B<-c(1,0); C<-c(0.5,sqrt(3)/2); Te<-rbind(A,B,C) CM<-(A+B+C)/3 D1<-(B+C)/2; D2<-(A+C)/2; D3<-(A+B)/2; Ds<-rbind(D1,D2,D3) h1<-c(1/2,sqrt(3)/18); h2<-c(2/3, sqrt(3)/9); h3<-c(2/3, 2*sqrt(3)/9); h4<-c(1/2, 5*sqrt(3)/18); h5<-c(1/3, 2*sqrt(3)/9); h6<-c(1/3, sqrt(3)/9); r1<-(h1+h6+CM)/3;r2<-(h1+h2+CM)/3;r3<-(h2+h3+CM)/3; r4<-(h3+h4+CM)/3;r5<-(h4+h5+CM)/3;r6<-(h5+h6+CM)/3; Xlim<-range(Te[,1],Xp[,1]) Ylim<-range(Te[,2],Xp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] plot(A,pch=".",xlab="",ylab="",axes=TRUE,xlim=Xlim+xd*c(-.05,.05), ylim=Ylim+yd*c(-.05,.05)) polygon(Te) L<-Te; R<-Ds segments(L[,1], L[,2], R[,1], R[,2], lty=2) polygon(rbind(h1,h2,h3,h4,h5,h6)) points(Xp) points(sixt$ext,pty=2,pch=4,col="red") txt<-rbind(Te,r1,r2,r3,r4,r5,r6) xc<-txt[,1]+c(-.02,.02,.02,0,0,0,0,0,0) yc<-txt[,2]+c(.02,.02,.03,0,0,0,0,0,0) txt.str<-c("A","B","C","1","2","3","4","5","6") text(xc,yc,txt.str) ## End(Not run)
Returns the slope of the line
joining two distinct 2D points a
and b
.
slope(a, b)
slope(a, b)
a , b
|
2D points that determine the straight line (i.e., through which the straight line passes). |
Slope of the line joining 2D points a
and b
Elvan Ceyhan
A<-c(-1.22,-2.33); B<-c(2.55,3.75) slope(A,B) slope(c(1,2),c(2,3))
A<-c(-1.22,-2.33); B<-c(2.55,3.75) slope(A,B) slope(c(1,2),c(2,3))
Extrema
object
Returns the below information about the object
:
call
of the function defining the object
,
the type
of the extrema (i.e. the description
of the extrema), extrema points,
distances from extrema to the reference object
(e.g. boundary of a triangle),
some of the data points (from which extrema is found).
## S3 method for class 'Extrema' summary(object, ...)
## S3 method for class 'Extrema' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "Extrema"
,
the type
of the extrema (i.e. the description
of the extrema), extrema points,
distances from extrema to the reference object
(e.g. boundary of a triangle),
some of the data points (from which extrema is found).
print.Extrema
,
print.summary.Extrema
,
and plot.Extrema
## Not run: n<-10 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext summary(Ext) ## End(Not run)
## Not run: n<-10 Xp<-runif.std.tri(n)$gen.points Ext<-cl2edges.std.tri(Xp) Ext summary(Ext) ## End(Not run)
Lines
object
Returns the below information about the object
:
call
of the function defining the object
,
the defining points
, selected
and
points on the line,
equation of the line, and
coefficients
of the line.
## S3 method for class 'Lines' summary(object, ...)
## S3 method for class 'Lines' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "Lines"
,
the defining points
, selected
and
points on the line,
equation of the line, and
coefficients
of the line
(in the form: y = slope * x + intercept
).
print.Lines
, print.summary.Lines
,
and plot.Lines
A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=3) #try also l=10, 20 or 100 lnAB<-Line(A,B,x) lnAB summary(lnAB)
A<-c(-1.22,-2.33); B<-c(2.55,3.75) xr<-range(A,B); xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=3) #try also l=10, 20 or 100 lnAB<-Line(A,B,x) lnAB summary(lnAB)
Lines3D
object
Returns the below information about the object
:
call
of the function defining the object
, the defining vectors (i.e., initial and direction vectors),
selected ,
, and
points on the line,
equation of the line (in parametric form), and
coefficients
of the line.
## S3 method for class 'Lines3D' summary(object, ...)
## S3 method for class 'Lines3D' summary(object, ...)
object |
An |
... |
Additional parameters for |
call
of the function defining the object
,
the defining vectors (i.e., initial and direction vectors),
selected ,
, and
points on the line,
equation of the line (in parametric form),
and
coefficients
of the line
(for the form: x=x0 + A*t
, y=y0 + B*t
,
and z=z0 + C*t
).
print.Lines3D
,
print.summary.Lines3D
,
and plot.Lines3D
## Not run: P<-c(1,10,3); Q<-c(1,1,3); vecs<-rbind(P,Q) Line3D(P,Q,.1) Line3D(P,Q,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=3) #try also l=10, 20 or 100 lnPQ3D<-Line3D(P,Q,tsq) lnPQ3D summary(lnPQ3D) ## End(Not run)
## Not run: P<-c(1,10,3); Q<-c(1,1,3); vecs<-rbind(P,Q) Line3D(P,Q,.1) Line3D(P,Q,.1,dir.vec=FALSE) tr<-range(vecs); tf<-(tr[2]-tr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate tsq<-seq(-tf*10-tf,tf*10+tf,l=3) #try also l=10, 20 or 100 lnPQ3D<-Line3D(P,Q,tsq) lnPQ3D summary(lnPQ3D) ## End(Not run)
NumArcs
object
Returns the below information about the object
:
call
of the function defining the object
,
the description of the proximity catch digraph (PCD), desc
.
In the one Delaunay cell case, the function provides
the total number of arcs in the digraph,
vertices of Delaunay cell, and
indices of target points in the Delaunay cell.
In the multiple Delaunay cell case, the function provides total number of arcs in the digraph, number of arcs for the induced digraphs for points in the Delaunay cells, vertices of Delaunay cells or indices of points that form the the Delaunay cells, indices of target points in the convex hull of nontarget points, indices of Delaunay cells in which points reside, and area or length of the the Delaunay cells.
## S3 method for class 'NumArcs' summary(object, ...)
## S3 method for class 'NumArcs' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "NumArcs"
,
the desc
of the proximity catch digraph (PCD),
total number of arcs in the digraph.
Moreover, in the one Delaunay cell case, the function also provides
vertices of Delaunay cell, and
indices of target points in the Delaunay cell;
and in the multiple Delaunay cell case, it also provides
number of arcs for the induced digraphs for points in the Delaunay cells,
vertices of Delaunay cells or indices of points that form the the Delaunay cells,
indices of target points in the convex hull of nontarget points,
indices of Delaunay cells in which points reside,
and area or length of the the Delaunay cells.
print.NumArcs
, print.summary.NumArcs
,
and plot.NumArcs
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs summary(Arcs) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs summary(Arcs) ## End(Not run)
Patterns
object
Returns the below information
about the object
:
call
of the function defining the object
,
the type
of the pattern, parameters
of the pattern,
study window, some sample points from the generated pattern,
reference points (if any for the bivariate pattern),
and number of points for each class
## S3 method for class 'Patterns' summary(object, ...)
## S3 method for class 'Patterns' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "Patterns"
,
the type
of the pattern, parameters
of the pattern,
study window, some sample points from the generated pattern,
reference points (if any for the bivariate pattern),
and number of points for each class
print.Patterns
,
print.summary.Patterns
,
and plot.Patterns
## Not run: nx<-10; #try also 10, 100, and 1000 ny<-5; #try also 1 e<-.15; Y<-cbind(runif(ny),runif(ny)) #with default bounding box (i.e., unit square) Xdt<-rseg.circular(nx,Y,e) Xdt summary(Xdt) ## End(Not run)
## Not run: nx<-10; #try also 10, 100, and 1000 ny<-5; #try also 1 e<-.15; Y<-cbind(runif(ny),runif(ny)) #with default bounding box (i.e., unit square) Xdt<-rseg.circular(nx,Y,e) Xdt summary(Xdt) ## End(Not run)
PCDs
object
Returns the below information about the object
:
call
of the function defining the object
,
the type
of the proximity catch digraph (PCD),
(i.e. the description of the PCD),
some of the partition
(i.e. intervalization in the 1D case and triangulation
in the 2D case) points
(i.e., vertices of the intervals or the triangles),
parameter(s) of the PCD, and various quantities
(number of vertices,
number of arcs and arc density of the PCDs,
number of vertices for the partition and number of partition cells
(i.e., intervals or triangles)).
## S3 method for class 'PCDs' summary(object, ...)
## S3 method for class 'PCDs' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "PCDs"
,
the type
of the proximity catch digraph (PCD),
(i.e. the description of the PCD), some of the partition
(i.e. intervalization in the 1D case and triangulation
in the 2D case) points
(i.e., vertices of the intervals or the triangles),
parameter(s) of the PCD, and various quantities
(number of vertices,
number of arcs and arc density of the PCDs,
number of vertices for the partition
and number of partition cells
(i.e., intervals or triangles)).
print.PCDs
,
print.summary.PCDs
,
and plot.PCDs
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs summary(Arcs) ## End(Not run)
## Not run: A<-c(1,1); B<-c(2,0); C<-c(1.5,2); Tr<-rbind(A,B,C); n<-10 Xp<-runif.tri(n,Tr)$g M<-as.numeric(runif.tri(1,Tr)$g) Arcs<-arcsAStri(Xp,Tr,M) Arcs summary(Arcs) ## End(Not run)
Planes
object
Returns the below information about the object
:
call
of the function defining the object
,
the defining 3D points
, selected ,
,
and
points on
the plane, equation of the plane, and
coefficients
of the plane.
## S3 method for class 'Planes' summary(object, ...)
## S3 method for class 'Planes' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "Planes"
,
the defining 3D points
, selected ,
,
and
points on the plane,
equation of the plane, and
coefficients
of the plane
(in the form: z = A*x + B*y + C
).
print.Planes
,
print.summary.Planes
,
and plot.Planes
## Not run: P<-c(1,10,3); Q<-c(1,1,3); C<-c(3,9,12) pts<-rbind(P,Q,C) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20 or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20 or 100 plPQC<-Plane(P,Q,C,x,y) plPQC summary(plPQC) ## End(Not run)
## Not run: P<-c(1,10,3); Q<-c(1,1,3); C<-c(3,9,12) pts<-rbind(P,Q,C) xr<-range(pts[,1]); yr<-range(pts[,2]) xf<-(xr[2]-xr[1])*.1 #how far to go at the lower and upper ends in the x-coordinate yf<-(yr[2]-yr[1])*.1 #how far to go at the lower and upper ends in the y-coordinate x<-seq(xr[1]-xf,xr[2]+xf,l=5) #try also l=10, 20 or 100 y<-seq(yr[1]-yf,yr[2]+yf,l=5) #try also l=10, 20 or 100 plPQC<-Plane(P,Q,C,x,y) plPQC summary(plPQC) ## End(Not run)
TriLines
object
Returns the below information about the object
:
call
of the function defining the object
,
the defining points
,
selected and
points on the line,
equation of the line, together with the vertices of the triangle,
and
coefficients
of the line.
## S3 method for class 'TriLines' summary(object, ...)
## S3 method for class 'TriLines' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "TriLines"
,
the defining points
,
selected and
points on the line,
equation of the line,
together with the vertices of the triangle,
and
coefficients
of the line
(in the form: y = slope * x + intercept
).
print.TriLines
,
print.summary.TriLines
,
and plot.TriLines
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,l=3) lnACM<-lineA2CMinTe(x) lnACM summary(lnACM) ## End(Not run)
## Not run: A<-c(0,0); B<-c(1,0); C<-c(1/2,sqrt(3)/2); Te<-rbind(A,B,C) xfence<-abs(A[1]-B[1])*.25 #how far to go at the lower and upper ends in the x-coordinate x<-seq(min(A[1],B[1])-xfence,max(A[1],B[1])+xfence,l=3) lnACM<-lineA2CMinTe(x) lnACM summary(lnACM) ## End(Not run)
Uniform
object
Returns the below information about the object
:
call
of the function defining the object
,
the type
of the pattern (i.e. the description
of the uniform distribution), study window,
vertices of the support of the Uniform distribution,
some sample points generated from the uniform distribution,
and the number of points (i.e., number of generated
points and the number of vertices of the support
of the uniform distribution.)
## S3 method for class 'Uniform' summary(object, ...)
## S3 method for class 'Uniform' summary(object, ...)
object |
An |
... |
Additional parameters for |
The call
of the object
of class "Uniform"
,
the type
of the pattern (i.e. the description
of the uniform distribution), study window,
vertices of the support of the Uniform distribution,
some sample points generated from the uniform distribution,
and the number of points (i.e., number of generated
points and the number of vertices of
the support of the uniform distribution.)
print.Uniform
,
print.summary.Uniform
,
and plot.Uniform
## Not run: n<-10 #try also 20, 100, and 1000 A<-c(1,1); B<-c(2,0); R<-c(1.5,2); Tr<-rbind(A,B,R) Xdt<-runif.tri(n,Tr) Xdt summary(Xdt) ## End(Not run)
## Not run: n<-10 #try also 20, 100, and 1000 A<-c(1,1); B<-c(2,0); R<-c(1.5,2); Tr<-rbind(A,B,R) Xdt<-runif.tri(n,Tr) Xdt summary(Xdt) ## End(Not run)
Locations and species classification of trees in a plot in the Savannah River, SC, USA.
Locations are given in meters, rounded to the nearest 0.1 decimal.
The data come from a one-hectare (200-by-50m) plot in the Savannah River Site.
The 734 mapped stems included 156 Carolina ashes (Fraxinus caroliniana),
215 water tupelos (Nyssa aquatica), 205 swamp tupelos (Nyssa sylvatica), 98 bald cypresses (Taxodium distichum)
and 60 stems from 8 additional three species (labeled as Others (OT)).
The plots were set up by Bill Good and their spatial patterns described in (Good and Whipple (1982)),
the plots have been maintained and resampled by Rebecca Sharitz and her colleagues of the Savannah River
Ecology Laboratory. The data and some of its description are borrowed from the swamp data entry in the dixon
package in the CRAN repository.
See also (Good and Whipple (1982); Jones et al. (1994); Dixon (2002)).
data(swamptrees)
data(swamptrees)
A data frame with 734 rows and 4 variables
Text describing the variable (i.e., column) names in the data set.
x,y: x and y (i.e., Cartesian) coordinates of the trees
live: a categorical variable that indicates the tree is alive (labeled as 1) or dead (labeled as 0)
sp: species label of the trees:
FX: Carolina ash (Fraxinus caroliniana)
NS: Swamp tupelo (Nyssa sylvatica)
NX: Water tupelo (Nyssa aquatica)
TD: Bald cypress (Taxodium distichum)
OT: Other species
Dixon PM (2002).
“Nearest-neighbor contingency table analysis of spatial segregation for several species.”
Ecoscience, 9(2), 142-151.
Good BJ, Whipple SA (1982).
“Tree spatial patterns: South Carolina bottomland and swamp forests.”
Bulletin of the Torrey Botanical Club, 109(4), 529-536.
Jones RH, Sharitz RR, James SM, Dixon PM (1994).
“Tree population dynamics in seven South Carolina mixed-species forests.”
Bulletin of the Torrey Botanical Club, 121(4), 360-368.
data(swamptrees) plot(swamptrees$x,swamptrees$y, col=as.numeric(swamptrees$sp),pch=19, xlab='',ylab='',main='Swamp Trees')
data(swamptrees) plot(swamptrees$x,swamptrees$y, col=as.numeric(swamptrees$sp),pch=19, xlab='',ylab='',main='Swamp Trees')
This function transforms any triangle, tri
,
to the standard basic triangle form.
The standard basic triangle form is
where
is in
,
and
.
Any given triangle can be mapped to the standard basic triangle form by a combination of rigid body motions (i.e., translation, rotation and reflection) and scaling, preserving uniformity of the points in the original triangle. Hence, standard basic triangle form is useful for simulation studies under the uniformity hypothesis.
tri2std.basic.tri(tri)
tri2std.basic.tri(tri)
tri |
A |
A list
with two elements
Cvec |
The nontrivial vertex |
orig.order |
Row order of the input triangle, |
Elvan Ceyhan
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); tri2std.basic.tri(rbind(A,B,C)) tri2std.basic.tri(rbind(B,C,A)) A<-c(1,1); B<-c(2,0); C<-c(1.5,2); tri2std.basic.tri(rbind(A,B,C)) tri2std.basic.tri(rbind(A,C,B)) tri2std.basic.tri(rbind(B,A,C)) ## End(Not run)
## Not run: c1<-.4; c2<-.6 A<-c(0,0); B<-c(1,0); C<-c(c1,c2); tri2std.basic.tri(rbind(A,B,C)) tri2std.basic.tri(rbind(B,C,A)) A<-c(1,1); B<-c(2,0); C<-c(1.5,2); tri2std.basic.tri(rbind(A,B,C)) tri2std.basic.tri(rbind(A,C,B)) tri2std.basic.tri(rbind(B,A,C)) ## End(Not run)
Given two 2D data sets, Xp
and Yp
,
it returns the Xp
points
inside the convex hull of Yp
points.
See (Okabe et al. (2000); Ceyhan (2010); Sinclair (2016)) for more on Delaunay triangulation and the corresponding algorithm.
Xin.convex.hullY(Xp, Yp)
Xin.convex.hullY(Xp, Yp)
Xp |
A set of 2D points which constitute the data set. |
Yp |
A set of 2D points which constitute the vertices of the Delaunay triangles. |
Xp
points inside the convex hull of Yp
points
Elvan Ceyhan
Ceyhan E (2010).
“Extension of One-Dimensional Proximity Regions to Higher Dimensions.”
Computational Geometry: Theory and Applications, 43(9), 721-748.
Okabe A, Boots B, Sugihara K, Chiu SN (2000).
Spatial Tessellations: Concepts and Applications of Voronoi Diagrams.
Wiley, New York.
Sinclair D (2016).
“S-hull: a fast radial sweep-hull routine for Delaunay triangulation.”
1604.01428.
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) DT<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") Xlim<-range(Xp[,1],Yp[,1]) Ylim<-range(Xp[,2],Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xch<-Xin.convex.hullY(Xp,Yp) plot(Xp,main=" ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),pch=".",cex=3) interp::convex.hull(DT,plot.it = TRUE, add = TRUE) # or try polygon(Yp[ch$i,]) points(Xch,pch=4,col="red") ## End(Not run)
## Not run: #nx is number of X points (target) and ny is number of Y points (nontarget) nx<-20; ny<-5; #try also nx<-40; ny<-10 or nx<-1000; ny<-10; set.seed(1) Xp<-cbind(runif(nx,0,1),runif(nx,0,1)) Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1)) #try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1)) DT<-interp::tri.mesh(Yp[,1],Yp[,2],duplicate="remove") Xlim<-range(Xp[,1],Yp[,1]) Ylim<-range(Xp[,2],Yp[,2]) xd<-Xlim[2]-Xlim[1] yd<-Ylim[2]-Ylim[1] Xch<-Xin.convex.hullY(Xp,Yp) plot(Xp,main=" ", xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=Ylim+yd*c(-.05,.05),pch=".",cex=3) interp::convex.hull(DT,plot.it = TRUE, add = TRUE) # or try polygon(Yp[ch$i,]) points(Xch,pch=4,col="red") ## End(Not run)