rel.vert.mid.int | R Documentation |
Returns the index of the vertex
whose region contains point p
in
the interval int
=(a,b)=
(vertex 1,vertex 2)
with (parameterized) center M_c
associated with
the centrality parameter c \in (0,1)
;
vertices of interval are labeled as 1 and 2 according to their
order in the interval int
.
If the point, p
, is not inside int
,
then the function yields NA
as output.
The corresponding vertex region is the interval (a,b)
as (a,M_c)
and (M_c,b)
where M_c=a+c(b-a)
.
See also (\insertCiteceyhan:metrika-2012,ceyhan:revstat-2016;textualpcds).
rel.vert.mid.int(p, int, c = 0.5)
p |
A 1D point. The vertex region |
int |
A |
c |
A positive real number in |
A list
with two elements
rv |
Index of the vertex in the interval |
int |
The vertices of the interval as a |
Elvan Ceyhan
rel.vert.end.int
c<-.4
a<-0; b<-10; int = c(a,b)
Mc<-centerMc(int,c)
rel.vert.mid.int(6,int,c)
n<-20 #try also n<-40
xr<-range(a,b,Mc)
xf<-(int[2]-int[1])*.5
Xp<-runif(n,a,b)
Rv<-vector()
for (i in 1:n)
Rv<-c(Rv,rel.vert.mid.int(Xp[i],int,c)$rv)
Rv
jit<-.1
yjit<-runif(n,-jit,jit)
Xlim<-range(a,b,Xp)
xd<-Xlim[2]-Xlim[1]
plot(cbind(Mc,0),main="vertex region indices for the points", xlab=" ",
ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*range(yjit),pch=".",cex=3)
abline(h=0)
points(Xp,yjit)
abline(v=c(a,b,Mc),lty = 2,col=c(1,1,2))
text(Xp,yjit,labels=factor(Rv))
text(cbind(c(a,b,Mc),.02),c("rv=1","rv=2","Mc"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.