Description Usage Arguments Value Author(s) References Examples
This function estimates weigths from the degree of the inferred network using iterative procedure. This function is called from the main functon DWLasso.R
1 | weightEstim(dat, lam=0.4, a=1, tol=1e-6)
|
dat |
An input matrix. The columns represent variables and the rows indicate observations. |
lam |
A penalty parameter that controls degree sparsity of the inferred network |
a |
A parameter of the update equation that controls the convergence of weights |
tol |
Tolerance |
w.dat |
Estimated weight vector from the last iteration at which the algorithm converges |
Nurgazy Sulaimanov, Sunil Kumar and Heinz Koeppl
Nurgazy Sulaimanov, Sunil Kumar, Frederic Burdet, Mark Ibberson, Marco Pagni, Heinz Koeppl. Inferring hub networks using weighted degree Lasso. http://arxiv.org/abs/1710.01912.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(DWLasso)
library(glmnet)
library(hglasso)
# Generate inverse covariance matrix with 3 hubs
# 20 % of the elements within a hub are zero
# 97 % of the elements that are not within hub nodes are zero
p <- 60 # Number of variables
n <- 40 # Number of samples
hub_number = 3 # Number of hubs
# Generate the adjacency matrix
Theta <- HubNetwork(p,0.97,hub_number,0.2)$Theta
# Generate a data matrix
out <- rmvnorm(n,rep(0,p),solve(Theta))
# Standardize the data
dat <- scale(out)
# Estimate weights from the degrees of the inferred network
w.est <- weightEstim(dat, lam=0.4, a=1, tol=1e-6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.