NeighborOmega {Tlasso} | R Documentation |
Precision Matrix of Nearest-Neighbor Graph
Description
Generate precision matrix of nearest-neighbor network following the set-up in Li and Gui (2006) and Lee and Liu (2006).
Usage
NeighborOmega(p, sd = 1, knn = 4, norm.type = 2)
Arguments
p |
dimension of generated precision matrix. |
sd |
seed for random number generation. Default is 1. |
knn |
sparsity of precision matrix, i.e., matrix is generated from a |
norm.type |
normalization methods of generated precision matrix, i.e., |
Details
For a knn
nearest-neighbor graph, this function first randomly picks p points from a
unit square and computes all pairwise distances among the points. Then it searches for the knn nearest-neighbors
of each point and a pair of symmetric entries in the precision matrix that has a random chosen value from [-1, -0.5] \cup [0.5, 1]
. Finally, to
ensure positive definite property, it normalizes the matrix as \Omega <- \Omega + (\lambda (\Omega) + 0.2 ) 1_p
where
\lambda (\cdot )
refers to the samllest eigenvalue.
Value
A precision matrix generated from the knn
nearest-neighor graph.
Author(s)
Xiang Lyu, Will Wei Sun, Zhaoran Wang, Han Liu, Jian Yang, Guang Cheng.
See Also
Examples
m.vec = c(5,5,5) # dimensionality of a tensor
n = 5 # sample size
knn=4 # sparsity
Omega.true.list = list()
for ( k in 1:length(m.vec)){
Omega.true.list[[k]] = NeighborOmega(m.vec[k],knn=4, sd=k*100,norm.type=2)
}
Omega.true.list # a list of length 3 contains precision matrices from 4-nearnest neighbor graph