Description Usage Arguments Value Author(s) See Also Examples

View source: R/NNCTFunctions.r

Returns the *W=(w_ij)* matrix which is used to compute *Q*, *R* and *T* values in the NN structure.
*w_{ij}=I(* point eqnj is a NN of point *i))* i.e. *w_{ij}=1* if point *j* is a NN of point *i* and 0 otherwise.

The argument `ties`

is a logical argument (default=`FALSE`

) to take ties into account or not. If `TRUE`

the function
takes ties into account by making *w_{ij}=1/m* if point *j* is a NN of point *i*
and there are *m* tied NNs and 0 otherwise. If `FALSE`

, *w_{ij}=1* if point *j* is a NN of point *i* and 0 otherwise.
The matrix *W* is equivalent to *A=(a_{ij})* matrix with *k=1*, i.e., `Wmat(X)=aij.mat(X,k=1)`

.

The argument `is.ipd`

is a logical argument (default=`TRUE`

) to determine the structure of the argument `x`

.
If `TRUE`

, `x`

is taken to be the inter-point distance (IPD) matrix, and if `FALSE`

, `x`

is taken to be the data set
with rows representing the data points.

1 |

`x` |
The IPD matrix (if |

`ties` |
A logical parameter (default= |

`is.ipd` |
A logical parameter (default= |

`...` |
are for further arguments, such as |

The incidence matrix *W=(w_ij)* where *w_{ij}=I(* point eqnj is a NN of point *i))*,
i.e. *w_{ij}=1* if point *j* is a NN of point *i* and 0 otherwise.

Elvan Ceyhan

`aij.mat`

, `aij.nonzero`

, and `aij.theta`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ```
n<-3
X<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(X)
Wmat(ipd)
Wmat(X,is.ipd = FALSE)
n<-5
Y<-matrix(runif(3*n),ncol=3)
ipd<-ipd.mat(Y)
Wmat(ipd)
Wmat(Y,is.ipd = FALSE)
Wmat(Y,is.ipd = FALSE,method="max")
Wmat(Y,is.ipd = FALSE)
aij.mat(Y,k=1)
#1D data points
X<-as.matrix(runif(5)) # need to be entered as a matrix with one column
#(i.e., a column vector), hence X<-runif(5) would not work
ipd<-ipd.mat(X)
Wmat(ipd)
Wmat(X,is.ipd = FALSE)
#with ties=TRUE in the data
Y<-matrix(round(runif(15)*10),ncol=3)
ipd<-ipd.mat(Y)
Wmat(ipd,ties=TRUE)
Wmat(Y,ties=TRUE,is.ipd = FALSE)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.