rassoc.std.tri: Generation of points associated (in a Type I fashion) with...

View source: R/PatternGen.R

rassoc.std.triR Documentation

Generation of points associated (in a Type I fashion) with 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 association alternative for eps in (0,\sqrt{3}/3=0.5773503]. 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 \sqrt{3}/3-eps 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

rassoc.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 association (where \sqrt{3}/3-eps serves as the height of the triangular support 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 attraction parameter of the association pattern, eps, where \sqrt{3}/3-eps serves as the height of the triangular support regions around the vertices

ref.points

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

gen.points

The output set of generated points associated with 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.

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


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