rseg.circular: Generation of points segregated (in a radial or circular...

View source: R/PatternGen.R

rseg.circularR Documentation

Generation of points segregated (in a radial or circular fashion) from a given set of points

Description

An object of class "Patterns". Generates n 2D points uniformly in (a_1-e,a_1+e) \times (a_1-e,a_1+e) \setminus B(y_i,e) (a_1 and b1 are denoted as a1 and b1 as arguments) where Y_p=(y_1,y_2,\ldots,y_{n_y}) with n_y being number of Yp points for various values of e under the segregation pattern and B(y_i,e) is the ball centered at y_i 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 x-coordinates of the Yp points, a2 is defaulted to the maximum of the x-coordinates of the Yp points, b1 is defaulted to the minimum of the y-coordinates of the Yp points, b2 is defaulted to the maximum of the y-coordinates of the Yp points.

Usage

rseg.circular(
  n,
  Yp,
  e,
  a1 = min(Yp[, 1]),
  a2 = max(Yp[, 1]),
  b1 = min(Yp[, 2]),
  b2 = max(Yp[, 2])
)

Arguments

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 Yp points. These balls are forbidden for the generated points (i.e., generated points would be in the complement of union of these balls).

a1, a2

Real numbers representing the range of x-coordinates in the region (default is the range of x-coordinates of the Yp points).

b1, b2

Real numbers representing the range of y-coordinates in the region (default is the range of y-coordinates of the Yp points).

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

Radial (i.e., circular) exclusion parameter of the segregation pattern

ref.points

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

gen.points

The output set of generated points segregated from Yp points

tri.Yp

Logical output for triangulation based on Yp points should be implemented or not. if TRUE triangulation based on Yp 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., Yp) points.

xlimit,ylimit

The possible ranges of the x- and y-coordinates of the generated points

Author(s)

Elvan Ceyhan

See Also

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

Examples

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


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