View source: R/NNCTFunctions.R
Ninv | R Documentation |
Returns the Qvec
and R
where Qvec=(Q_0,Q_1,\ldots)
with
Q_j
is the number of points shared as a NN
by j
other points i.e., number of points
that are NN of i
points, for i=0,1,2,\ldots
and R
is the number of reflexive pairs
where points A and B are reflexive
iff they are NN to each other.
Ninv(x, is.ipd = TRUE, ...)
x |
The IPD matrix (if |
is.ipd |
A logical parameter (default= |
... |
are for further arguments, such as |
Returns a list
with two elements
Qvec |
vector of |
R |
number of reflexive points |
Elvan Ceyhan
Qval
, Qvec
, sharedNN
,
Rval
, and QRval
#3D data points
n<-20 #or try sample(1:20,1)
Y<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(Y)
W<-Wmat(ipd)
sharedNN(W)
Qvec(W)
Ninv(ipd)
Ninv(Y,is.ipd = FALSE)
Ninv(Y,is.ipd = FALSE,method="max")
#1D data points
n<-15
X<-as.matrix(runif(n))# need to be entered as a matrix with one column
#(i.e., a column vector), hence X<-runif(n) would not work
ipd<-ipd.mat(X)
W<-Wmat(ipd)
sharedNN(W)
Qvec(W)
Ninv(ipd)
#with possible ties in the data
Y<-matrix(round(runif(30)*10),ncol=3)
ny<-nrow(Y)
ipd<-ipd.mat(Y)
W<-Wmat(ipd)
sharedNN(W)
Qvec(W)
Ninv(ipd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.