getCluster: Get the cluster structure of the HGMND estimate

Description Usage Arguments Value Examples

View source: R/getCluster.R

Description

After estimating the conditional dependence matrices of the multiple datasets using the HGMND method, the cluster structure can be revealed by comparison of these matrices.

Usage

1
  getCluster(est.HGMND, method = "F", tol = 1e-5)

Arguments

est.HGMND

a list, the result of the function HGMND with class "est.HGMND".

method

the method of evaluating the difference of two conditional dependence matrices. The function norm from the base package is used to calculate the matrix norm of the element-wise difference of two matrices. It must be chosen from "O", "I", "F", "M", "2", corresponding to the same settings in the function norm. Default to "F", the Frobenius norm.

tol

tolerance in evaluating the difference of two conditional dependence matrices. If the calculated difference is no larger than tol, they are regarded as in one cluster. Default to 1e-5.

Value

the function getCluster returns the clustering structure of the multiple conditional dependence matrices.

mat.comapre

a matrix of 0 or 1. If the element on the ith row and jth column of the matrix is 1, the ith and the jth conditional dependence matrices are in the same cluster, 0 otherwise.

est.cluster

a vector with length same as the number of conditional dependence matrices indicating the cluster label of each matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# This is an example of HGMND with simulated data
data(HGMND_SimuData)
h              <- genscore::get_h_hp("mcp", 1, 5)
HGMND_SimuData <- lapply(HGMND_SimuData, function(x) scale(x, center = FALSE))
mat.chain      <- diag(length(HGMND_SimuData))
diag(mat.chain[-nrow(mat.chain), -1]) <- 1

result <- HGMND(x        = HGMND_SimuData,
                setting  = "gaussian",
                h        = h,
                centered = FALSE,
                mat.adj  = mat.chain,
                lambda1  = 0.086,
                lambda2  = 3.6,
                gamma    = 1,
                tol      = 1e-3,
                silent  = TRUE)
Theta       <- result[["Theta"]]
res.cluster <- getCluster(result)

HGMND documentation built on April 19, 2021, 9:05 a.m.

Related to getCluster in HGMND...