rseg.multi.tri: Generation of points segregated (in a Type I fashion) from a...

View source: R/PatternGen.R

rseg.multi.triR Documentation

Generation of points segregated (in a Type I fashion) from a given set of points

Description

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, \delta 100 % of the area around each vertex in each Delaunay triangle is forbidden for point generation). delta corresponds to eps in the standard equilateral triangle T_e as delta=4 eps ^2/3 (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 (\insertCiteceyhan:arc-density-PE,ceyhan:arc-density-CS,ceyhan:dom-num-NPE-Spat2011;textualpcds) for more on the segregation pattern. Also, see (\insertCiteokabe:2000,ceyhan:comp-geo-2010,sinclair:2016;textualpcds) for more on Delaunay triangulation and the corresponding algorithm.

Usage

rseg.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 (0,4/9). delta is the parameter of segregation (that is, \delta 100 area around each vertex in each Delaunay triangle is forbidden for point generation).

DTmesh

Delaunay triangulation of Yp, default is NULL, which is computed via tri.mesh function in interp package. tri.mesh function yields the triangulation nodes with their neighbours, and creates a triangulation object.

DTr

Delaunay triangles based on Yp, default is NULL, which is computed via tri.mesh function in interp package. triangles function yields a triangulation data structure from the triangulation object created by tri.mesh.

Value

A list with the elements

type

The type of the pattern from which points are to be generated

mtitle

The "main" title for the plot of the point pattern

parameters

Exclusion parameter, delta, of the Type I segregation pattern. delta is in (0,4/9) \delta 100 % area around each vertex in each Delaunay triangle is forbidden for point generation.

ref.points

The input set of points Yp; reference points, i.e., points from which generated points are segregated.

gen.points

The output set of generated points segregated from Yp points.

tri.Y

Logical output, TRUE, if triangulation based on Yp points should be implemented.

desc.pat

Description of the point pattern

num.points

The vector of two numbers, which are the number of generated points and the number of reference (i.e., Yp) points.

xlimit,ylimit

The ranges of the x- and y-coordinates of the reference points, which are the Yp points

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

rseg.circular, rseg.std.tri, rsegII.std.tri, and rassoc.multi.tri

Examples

## 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)


elvanceyhan/pcds documentation built on June 29, 2023, 8:12 a.m.