weightToLaplacian {HDMAADMM}R Documentation

Helper function to convert Weight Matrix to Laplacian Matrix

Description

Helper function to convert Weight Matrix to Laplacian Matrix

Usage

weightToLaplacian(W)

Arguments

W

The weight matrix for n nodes which should be nxn matrix.

Value

L nxn Laplacian matrix.

Examples

set.seed(20231201)
p <- 5
W <- matrix(0, nrow = p, ncol = p)
W[lower.tri(W)] <- runif(p*(p-1)/2, 0, 1)
W[upper.tri(W)] <- t(W)[upper.tri(W)]
diag(W) <- 1
(L <- weightToLaplacian(W))

[Package HDMAADMM version 0.0.1 Index]