Learn R Programming

pcds (version 0.1.4)

rasc.matern: Generation of points associated (in a Matern-like fashion) to a given set of points

Description

An object of class "Patterns". Generates n 2D points uniformly in \(\cup B(y_i,e)\) where \(Y=(y_1,y_2,\ldots,y_{n_y})\) with \(n_y\) being number of Y points for various values of e under the association pattern and \(B(y_i,e)\) is the ball centered at \(y_i\) with radius e.

The pattern resembles the Matern cluster pattern (see rMatClust in the spatstat.random package for further information (baddeley:2005;textualpcds). rMatClust(kappa, scale, mu, win) in the simplest case generates a uniform Poisson point process of "parent" points with intensity kappa. Then each parent point is replaced by a random cluster of "offspring" points, the number of points per cluster being Poisson(mu) distributed, and their positions being placed and uniformly inside a disc of radius scale centered on the parent point. The resulting point pattern is a realization of the classical "stationary Matern cluster process" generated inside the window win.

The main difference of rasc.matern and rMatClust is that the parent points are Y points which are given beforehand and we do not discard them in the end in rasc.matern and the offspring points are the points associated with the reference points, Y; e must be positive and very large values of e provide patterns close to CSR.

This function is also very similar to rasc.disc, where rasc.disc needs the study window to be specified, while rasc.matern does not.

Usage

rasc.matern(n, Y, e)

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) attraction parameter of the association pattern.

ref.points

The input set of attraction points Y, i.e., points with which generated points are associated.

gen.points

The output set of generated points associated with Y points.

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 attraction (i.e., Y) points.

xlimit,ylimit

The possible ranges of the \(x\)- and \(y\)-coordinates of the generated points.

Arguments

n

A positive integer representing the number of points to be generated.

Y

A set of 2D points representing the reference points. The generated points are associated (in a Matern-cluster like fashion) with these points.

e

A positive real number representing the radius of the balls centered at Y points. Only these balls are allowed for the generated points (i.e., generated points would be in the union of these balls).

Author

Elvan Ceyhan

References

See Also

rasc.disc, rascTe, rascIITe, rascMT, rseg.disc, and rMatClust in the spatstat.random package

Examples

Run this code
nx<-20; ny<-4;  #try also nx<-1000; ny<-10;

e<-.15;  #try also e<-1.1; #closer to CSR than association, as e is large

#Y points uniform in unit square
Y<-cbind(runif(ny),runif(ny))

Xdt<-rasc.matern(nx,Y,e)
Xdt
summary(Xdt)
plot(Xdt,asp=1)

Xdt<-rasc.matern(nx,Y,e)$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,xlab="x",ylab="y",main="Association of two classes",
     xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),pch=16,col=2,lwd=2)
points(Xdt)

a1<-0; a2<-10;
b1<-0; b2<-5;
e<-1.1;

#Y points uniform in a rectangle
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<-rasc.matern(nx,Y,e)$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,xlab="x",ylab="y",main="association of two classes",
     xlim=Xlim+xd*c(-.01,.01),ylim=Ylim+yd*c(-.01,.01),pch=16,col=2,lwd=2)
points(Xdt)

e<-.15
Y<-data.frame(yp=cbind(runif(ny),runif(ny)) )
Xdt<-rasc.matern(nx,Y,e)

Run the code above in your browser using DataLab