Learn R Programming

pcds (version 0.1.4)

Gam1PE1D: The indicator for a point being a dominating point for Proportional Edge Proximity Catch Digraphs (PE-PCDs) for an interval

Description

Returns \(I(\)p is a dominating point of the PE-PCD\()\) where the vertices of the PE-PCD are the 1D data set Dt.

PE proximity region is defined with respect to the interval int with an expansion parameter, \(r \ge 1\), and a centrality parameter, \(c \in (0,1)\), so arcs may exist for Dt points inside the interval int\(=(a,b)\).

Vertex regions are based on the center associated with the centrality parameter \(c \in (0,1)\). rv is the index of the vertex region p resides, with default=NULL.

ch.data.pnt is for checking whether point p is a data point in Dt or not (default is FALSE), so by default this function checks whether the point p would be a dominating point if it actually were in the data set.

Usage

Gam1PE1D(p, Dt, r, c, int, rv = NULL, ch.data.pnt = FALSE)

Value

\(I(\)p is a dominating point of the PE-PCD\()\) where the vertices of the PE-PCD are the 1D data set Dt, that is, returns 1 if p is a dominating point, returns 0 otherwise

Arguments

p

A 1D point that is to be tested for being a dominating point or not of the PE-PCD.

Dt

A set of 1D points which constitutes the vertices of the PE-PCD.

r

A positive real number which serves as the expansion parameter in PE proximity region; must be \(\ge 1\).

c

A positive real number in \((0,1)\) parameterizing the center inside int\(=(a,b)\). For the interval, int\(=(a,b)\), the parameterized center is \(M_c=a+c(b-a)\); default c=.5.

int

A vector of two real numbers representing an interval.

rv

Index of the vertex region in which the point resides, either 1,2 or NULL (default is NULL).

ch.data.pnt

A logical argument for checking whether point p is a data point in Dt or not (default is FALSE).

Author

Elvan Ceyhan

See Also

Gam1PEtri

Examples

Run this code
r<-2
c<-.4
a<-0; b<-10; int<-c(a,b)

Mc<-centMc(int,c)

n<-10

set.seed(1)
dat<-runif(n,a,b)

Gam1PE1D(dat[5],dat,r,c,int)

gam.vec<-vector()
for (i in 1:n)
{gam.vec<-c(gam.vec,Gam1PE1D(dat[i],dat,r,c,int))}

ind.gam1<-which(gam.vec==1)
ind.gam1

domset<-dat[ind.gam1]
if (length(ind.gam1)==0)
{domset<-NA}

#or try
Rv<-rv.mid.int(dat[5],c,int)$rv
Gam1PE1D(dat[5],dat,r,c,int,Rv)

Xlim<-range(a,b,dat)
xd<-Xlim[2]-Xlim[1]

plot(cbind(a,0),xlab="",pch=".",xlim=Xlim+xd*c(-.05,.05))
abline(h=0)
points(cbind(dat,0))
abline(v=c(a,b,Mc),col=c(1,1,2),lty=2)
points(cbind(domset,0),pch=4,col=2)
text(cbind(c(a,b,Mc),-0.1),c("a","b","Mc"))

Gam1PE1D(dat[5],dat,r,c,int)

n<-10
dat2<-runif(n,a+b,b+10)
Gam1PE1D(5,dat2,r,c,int)

Gam1PE1D(2,dat,r,c,int,ch.data.pnt = FALSE)
#gives an error message if ch.data.pnt = TRUE since point p is not a data point in Dt

Run the code above in your browser using DataLab