Builds a symmetrised Gaussian affinity matrix from a gene distance matrix and projects any negative eigenvalues up to a small positive threshold to ensure positive semi-definiteness.

ComputeGraphOperator(gene.dist.mat, knn = 10, shrink_thred = 1e-10)

Arguments

gene.dist.mat

A square numeric distance matrix (e.g., from LoadGeneEMD()).

knn

Integer. Number of nearest neighbours used to set the adaptive kernel bandwidth. Default 10.

shrink_thred

Numeric. Eigenvalues below this threshold are replaced by this value. Default 1e-10.

Value

A symmetric positive semi-definite matrix (the graph operator) with the same row/column names as gene.dist.mat.

Examples

if (FALSE) {
G <- ComputeGraphOperator(gene.dist.mat, knn = 10)
}