Title: | Degree Weighted Lasso |
---|---|
Description: | Infers networks with hubs using degree weighted Lasso method. |
Authors: | Nurgazy Sulaimanov, Sunil Kumar and Heinz Koeppl |
Maintainer: | Nurgazy Sulaimanov <[email protected]> |
License: | GPL-2 |
Version: | 1.1 |
Built: | 2024-11-04 06:27:35 UTC |
Source: | CRAN |
This function converts the list of vectors into a symmetric matrix
combined(dat,y)
combined(dat,y)
dat |
An input matrix. The columns represent variables and the rows indicate observations. |
y |
List data that includes estimates from nodewise regression. |
symMat |
Symmetric matrix that represents the inferred network |
This function computes the degree of inferred network
degreeComp(out.mat)
degreeComp(out.mat)
out.mat |
Symmetric matrix that represents the inferred network |
This function computes the degree of estimated networks.
wlasso_norm |
Degree vector computed from the inferred network |
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) # Infer the network using weighted nodewise regression w.mb <- rep(1,p) adj.mat <- MBLasso(dat,lambda=0.4,w.mb) # Compute the degree of the inferred network deg.mat <- degreeComp(adj.mat)
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) # Infer the network using weighted nodewise regression w.mb <- rep(1,p) adj.mat <- MBLasso(dat,lambda=0.4,w.mb) # Compute the degree of the inferred network deg.mat <- degreeComp(adj.mat)
Infers undirected networks with hubs using weighted nodewise regression approach. The method contains two parameters that control hub and overall sparsity, respectively.
DWLasso(X, lambda1 = 0.4, lambda2 = 2, a = 1, tol = 1e-05)
DWLasso(X, lambda1 = 0.4, lambda2 = 2, a = 1, tol = 1e-05)
X |
An input matrix. The columns represent variables and the rows indicate observations. |
lambda1 |
A penalty parameter that controls degree sparsity of the inferred network |
lambda2 |
A penalty parameter that controls overall sparsity of the inferred network |
a |
A parameter of the update equation that controls the convergence of weights |
tol |
Tolerance |
This implements weighted degree lasso using coordinate descent algorithm (implemented in Glmnet package) described in Sulaimanov et al.. The method is based on the weighted nodewise regression approach and infers large undirected networks with hubs in iterative manner in the setting more variables than samples (p>n). Given p variables, the network is inferred by regressing each variable against the remaining (p-1) variables. The penalty parameter, lambda1 controls the degree sparsity of the network, whereas the penalty parameter, lambda2 controls the overall sparsity.The method uses a fast Lasso solver Glmnet (Friedman et al. (2010)) with default settings.
mat |
The estimated matrix corresponding to the inferred network. The diagonal elements of the matrix are zero |
weights |
The estimated weights used to estimate the network. These weights are computed from the degree of estimated networks |
lambda1 |
The value of the penalty parameter controlling degree sparsity of the inferred network. |
lambda2 |
The value of the penalty parameter controlling the overall sparsity |
Nurgazy Sulaimanov, Sunil Kumar, Frederic Burdet, Mark Ibberson, Marco Pagni, Heinz Koeppl.
Maintainer: Nurgazy Sulaimanov, [email protected]
1. 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.
2. Jerome Friedman, Trevor Hastie, Robert Tibshirani (2010). Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, 33(1), 1-22. URL http://www.jstatsoft.org/v33/i01/.
3. Tan, KM., London, P., Mohan, K., Lee, S-I., Fazel, M., and Witten, D. (2014). Learning graphical models with hubs. Journal of Machine Learning Research. 5.1 (2014): 3297-3331.
4. Meinshausen, Nicolai, and Peter Bühlmann. "High-dimensional graphs and variable selection with the lasso." The annals of statistics (2006): 1436-1462.
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) # Run DWLasso out.p <- DWLasso(dat, lambda1 = 0.6, lambda2 = 10) # print out a summary of the output summary(out.p)
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) # Run DWLasso out.p <- DWLasso(dat, lambda1 = 0.6, lambda2 = 10) # print out a summary of the output summary(out.p)
This function infers the network using nodewise regression method by Meinhausen and Buhlmann.
MBLasso(dat,lambda=0.4,w.mb)
MBLasso(dat,lambda=0.4,w.mb)
dat |
An input matrix. The columns represent variables and the rows indicate observations. |
lambda |
A penalty parameter of the weighted Lasso that controls the sparsity of the inferred network. |
w.mb |
An unput weight vector which is computed from the degree of the inferred network. |
Meinshausen, Nicolai, and Peter Bühlmann. "High-dimensional graphs and variable selection with the lasso." The annals of statistics (2006): 1436-1462.
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) # Infer the network using weighted nodewise regression w.mb <- rep(1,p) adj.mat <- MBLasso(dat,lambda=0.4,w.mb)
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) # Infer the network using weighted nodewise regression w.mb <- rep(1,p) adj.mat <- MBLasso(dat,lambda=0.4,w.mb)
This function computes weights from the degree of estimated network using the weighted Lasso approach
weightComp(dat,lam=0.4,w.mb)
weightComp(dat,lam=0.4,w.mb)
dat |
An input matrix. The columns represent variables and the rows indicate observations. |
lam |
A penalty parameter of the weighted Lasso that controls the sparsity of the inferred network. |
w.mb |
An unput weight vector which is computed from the degree of the inferred network. |
d.mb |
Weight vector computed from degree of the inferred network |
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) # Compute weights from the inferred network w.mb <- rep(1,p) w.Mat <- weightComp(dat,lam=0.4,w.mb)
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) # Compute weights from the inferred network w.mb <- rep(1,p) w.Mat <- weightComp(dat,lam=0.4,w.mb)
This function estimates weigths from the degree of the inferred network using iterative procedure. This function is called from the main functon DWLasso.R
weightEstim(dat, lam=0.4, a=1, tol=1e-6)
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.
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)
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)