Title: | Empirical Bayes estimate of block diagonal covariance matrices |
---|---|
Description: | Using bayesian methods to estimate correlation matrices assuming that they can be written and estimated as block diagonal matrices. These block diagonal matrices are determined using shrinkage parameters that values below this parameter to zero. |
Authors: | C. Pacini |
Maintainer: | C. Pacini <[email protected]> |
License: | GPL-3 |
Version: | 1.33.0 |
Built: | 2024-10-30 05:33:36 UTC |
Source: | https://github.com/bioc/covEB |
Using bayesian methods to estimate correlation matrices assuming that they can be written and estimated as block diagonal matrices. These block diagonal matrices are determined using shrinkage parameters that values below this parameter to zero.
The DESCRIPTION file:
Package: | covEB |
Type: | Package |
Title: | Empirical Bayes estimate of block diagonal covariance matrices |
Version: | 1.33.0 |
Date: | 2017-01-29 |
Author: | C. Pacini |
Maintainer: | C. Pacini <[email protected]> |
Description: | Using bayesian methods to estimate correlation matrices assuming that they can be written and estimated as block diagonal matrices. These block diagonal matrices are determined using shrinkage parameters that values below this parameter to zero. |
License: | GPL-3 |
Depends: | R (>= 3.3), mvtnorm, igraph, gsl, Biobase, stats, LaplacesDemon, Matrix |
Suggests: | curatedBladderData |
biocViews: | ImmunoOncology, Bayesian, Microarray, RNASeq, Preprocessing, Software, GeneExpression, StatisticalMethod |
Repository: | https://bioc.r-universe.dev |
RemoteUrl: | https://github.com/bioc/covEB |
RemoteRef: | HEAD |
RemoteSha: | 9ca408eda9ab3cdea75a628dcf78d38972621c9d |
Index of help topics:
EBsingle Empirical Bayes estimate of block diagonal correlation matrix covEB Empirical Bayes estimate of block diagonal correlation matrix covEB-package Empirical Bayes estimate of block diagonal covariance matrices
The function for this package is EBsingle that calculates an empirical Bayes estimate of a given covariance matrix assuming that is has a block diagonal structure.
C. Pacini
Maintainer: C. Pacini <[email protected]>
Assuming a block diagonal structure of the correlation matrix, the function calculates and empirical Bayes estimate of the original covariance matrix. The aim is to reduce false discovery rates by pooling information on the levels of correlations between elements in the same blocks. The blocks can have different levels of true correlation between them. The algorithm searches the space of possible correlation values and estimates the final correlation by and average of all non zero estimates.
covEB(Covmat, delta = 0.1, shift = 0.05, cutoff = NULL, startlambda = 0.5,n)
covEB(Covmat, delta = 0.1, shift = 0.05, cutoff = NULL, startlambda = 0.5,n)
Covmat |
A sample covariance matrix. Must be positive semi-definite, is converted to a correlation matrix in the algorithm. |
delta |
This parameter gives the size of the range of correlation values that are considered in one iteration. The larger the value the more the values will be pooled to the overall correlation of the full matrix. Default 0.1 |
shift |
The shift parameter determines how much the lower bound of the range of correlation values is moved by through each iteration. The larger the value the fewer iterations. Default 0.05. |
cutoff |
Optional - If the average correlations for a given block are below this value then the prior for this block is set to be the independence prior. |
startlambda |
This determines a lower noise level for the correlations, for example, it defaults to 0.5. This means that all correlation values below 0.5 will be set to zero (assumed to be noise). |
n |
The number of samples (replicates) used to calculate Covmat |
Returns the estimated correlation matrix.
C. Pacini
Champion, C. J. (2003). Empirical Bayesian estimation of normal variances and covariances. Journal of Multivariate Analysis, 87(1), 60-79
sigma <- matrix(c(4,2,2,3), ncol=2) x <- rmvnorm(n=500, mean=c(1,2), sigma=sigma) samplecov<-cov(x) test<-covEB(samplecov,delta=0.05,shift=0.025,startlambda=0.4,n=500)
sigma <- matrix(c(4,2,2,3), ncol=2) x <- rmvnorm(n=500, mean=c(1,2), sigma=sigma) samplecov<-cov(x) test<-covEB(samplecov,delta=0.05,shift=0.025,startlambda=0.4,n=500)
Assuming a block diagonal structure of the correlation matrix, the function calculates and empirical Bayes estimate of the original covariance matrix. The algorithm assumes a single block diagonal prior with one shrinkage threshold determining significance of correlations.
EBsingle(Covmat, startlambda = 0.5, n, happrox=FALSE,groups=NULL,aic=FALSE,data=NULL,dist=c("W","N"))
EBsingle(Covmat, startlambda = 0.5, n, happrox=FALSE,groups=NULL,aic=FALSE,data=NULL,dist=c("W","N"))
Covmat |
A sample covariance matrix. Must be positive semi-definite, is converted to a correlation matrix in the algorithm. |
startlambda |
This determines a lower noise level for the correlations, for example, it defaults to 0.5. This means that all correlation values below 0.5 will be set to zero (assumed to be noise). This will be used if groups parameter is not specified. |
n |
The number of samples (replicates) used to calculate Covmat |
happrox |
Logical indicating whether or not to use a hypergeometric distribution estimation of the correlations. The alternative is to take the sample average of the correlations. FALSE by default. |
groups |
Optional list of groups of variables from Covmat that are used to define the block diagonal structure of the prior. |
aic |
Optional logical parameter indicating whether or not the AIC metric should be used to select the threshold parameter from the data. This will replace the value of startlambda. To use the AIC option, the data must also be provided |
data |
Optional data matrix, required when AIC is to be used. The matrix should have observations in rows and variables in the columns. |
dist |
Parameter used when using the AIC option. Either "N" for using the Normal distribution to model the data or "W" to model the sample covariance matrix using a Wishart distribution. Default is "W". |
Returns the estimated correlation matrix.
C. Pacini
Champion, C. J. (2003). Empirical Bayesian estimation of normal variances and covariances. Journal of Multivariate Analysis, 87(1), 60-79
sigma <- matrix(c(4,2,2,3), ncol=2) x <- rmvnorm(n=500, mean=c(1,2), sigma=sigma) samplecov<-cov(x) test<-EBsingle(samplecov,startlambda=0.4,n=500)
sigma <- matrix(c(4,2,2,3), ncol=2) x <- rmvnorm(n=500, mean=c(1,2), sigma=sigma) samplecov<-cov(x) test<-EBsingle(samplecov,startlambda=0.4,n=500)