R: Bayesian information criterion to select the tuning...
bic.netEst.undir
R Documentation
Bayesian information criterion to select the tuning parameters for netEst.undir
Description
This function uses the Bayesian information criterion to select the optimal tuning parameters needed in netEst.undir.
Usage
bic.netEst.undir(X, zero = NULL, one = NULL, lambda, rho = NULL, weight = NULL,
eta = 0, verbose = FALSE, eps = 1e-08)
Arguments
X
The n x p data matrix as in covsel.
zero
(Optional) indices of entries of the matrix to be constrained to be zero. The input should be a matrix of p x p, with 1 at entries to be constrained to be zero and 0 elsewhere. The matrix must be symmetric.
one
(Optional) indices of entries of the matrix to be kept regardless of the regularization parameter for lasso. The input is similar to that of zero and needs to be symmetric.
lambda
(Non-negative) user-supplied lambda sequence.
rho
(Non-negative) numeric scalar representing the regularization parameter for estimating the weights in the inverse covariance matrix.
weight
(Optional) whether to add penalty to known edges. If NULL (default), then the known edges are assumed to be true. If nonzero, then a penalty equal to lambda * weight is added to penalize the known edges to account for possible uncertainty. Only non-negative values are accepted for the weight parameter.
eta
(Non-negative) a small constant added to the diagonal of the empirical covariance matrix of X to ensure it is well conditioned. By default, eta is set to 0.
verbose
Whether to print out information as estimation proceeds. Default=FALSE.
eps
Numeric scalar >=0, indicating the tolerance level for differentiating zero and non-zero edges: entries <eps will be set to 0.
Details
Let hat Σ represent the empirical covariance matrix of data X. For a given λ, denote the estimated inverse covariance matrix by hatΩ_{λ}. the Bayesian information criterion (BIC) is defined as
where df represents the degrees of freedom in the selected model and can be estimated via the number of edges in hatΩ_{λ}. The optimal tuning parameter is selected as the one that minimizes the BIC over the range of lambda.
Note when the penalty parameter lambda is too large, the estimated adjacency matrix may be zero. The function will thus return a warning message.
Value
lambda
The values of lambda used.
weight
The values of weight used.
BIC
If weight=NULL, then a numeric vector of the same length as lambda with the corresponding BIC. If weight is a vector, then a matrix of size length(lambda) by length(weight) with the corresponding BIC.
df
The degrees of freedom corresponding to each BIC.
Author(s)
Jing Ma
References
Ma, J., Shojaie, A. & Michailidis, G. (2014). Network-based pathway enrichment analysis with incomplete network information, submitted. http://arxiv.org/abs/1411.7919.
See Also
netEst.undir
Examples
set.seed(1)
library(MASS)
library(glmnet)
library(glasso)
## Generate the covariance matrix for the AR(1) process
rho <- 0.5
p <- 100
n <- 100
Sigma <- diag(rep(1,p))
Sigma <- rho^(abs(row(Sigma)-col(Sigma)))/(1-rho^2)
## The inverse covariance matrix is sparse
Omega <- solve(Sigma)
## Generate multivariate normal data n by p
X <- mvrnorm(n, mu=rep(0, p), Sigma=Omega)
## Select the tuning parameters
score = bic.netEst.undir(X, lambda = seq(0.1,1,0.1))