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

View source: R/PatternGen.R

rseg.std.triR Documentation

Generation of points segregated (in a Type I fashion) from the vertices of T_e

Description

An object of class "Patterns". Generates n points uniformly in the standard equilateral triangle T_e=T((0,0),(1,0),(1/2,\sqrt{3}/2)) under the type I segregation alternative for eps in (0,\sqrt{3}/3=0.5773503].

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 (\insertCiteceyhan:arc-density-PE,ceyhan:arc-density-CS,ceyhan:dom-num-NPE-Spat2011;textualpcds).

Usage

rseg.std.tri(n, eps)

Arguments

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

Value

A list with the elements

type

The type of the point pattern

mtitle

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

parameters

The exclusion parameter, eps, of the segregation pattern, which is the height of the triangular forbidden regions around the vertices

ref.points

The input set of points Y; reference points, i.e., points from which generated points are segregated (i.e., vertices of T_e).

gen.points

The output set of generated points segregated from Y points (i.e., vertices of T_e).

tri.Y

Logical output for triangulation based on Y points should be implemented or not. if TRUE triangulation based on Y points is to be implemented (default is set to FALSE).

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., Y) points, which is 3 here.

xlimit,ylimit

The ranges of the x- and y-coordinates of the reference points, which are the vertices of T_e here.

Author(s)

Elvan Ceyhan

References

\insertAllCited

See Also

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

Examples

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


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