rassoc.multi.tri {pcds} | R Documentation |
Generation of points associated (in a Type I fashion) with a given set of points
Description
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 \delta 100
% area around each vertex in each Delaunay
triangle is allowed for point generation).
delta
corresponds to eps
in the standard equilateral triangle
T_e
as delta=4eps^2/3
(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.
Usage
rassoc.multi.tri(n, Yp, delta, DTmesh = NULL, DTr = NULL)
Arguments
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 |
Value
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 |
Author(s)
Elvan Ceyhan
References
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 r
-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.
See Also
rassoc.circular
, rassoc.std.tri
,
rassocII.std.tri
, and rseg.multi.tri
Examples
#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)