View source: R/eclairs_corMat.R
eclairs_corMat | R Documentation |
Estimate covariance/correlation with low rank and shrinkage from the correlation matrix
eclairs_corMat(C, n, k = min(n, nrow(C)), lambda = NULL)
C |
sample correlation matrix between features |
n |
number of samples used to estimate the sample correlation matrix |
k |
the rank of the low rank component. Defaults to min of sample size and feature number, |
lambda |
shrinkage parameter. If not specified, it is estimated from the data. |
eclairs object storing:
orthonormal matrix with k columns representing the low rank component
eigen-values so that U diag(d^2) U^T
is the low rank component
shrinkage parameter \lambda
for the scaled diagonal component
standard deviations of input columns
diagonal value, \nu
, of target matrix in shrinkage
number of samples (i.e. rows) in the original data
number of features (i.e. columns) in the original data
rank of low rank component
sample names from the original matrix
features names from the original matrix
method used for decomposition
the function call
library(Rfast)
n <- 800 # number of samples
p <- 200 # number of features
# create correlation matrix
Sigma <- autocorr.mat(p, .9)
# draw data from correlation matrix Sigma
Y <- rmvnorm(n, rep(0, p), sigma = Sigma * 5.1, seed = 1)
rownames(Y) <- paste0("sample_", 1:n)
colnames(Y) <- paste0("gene_", 1:p)
# eclairs decomposition
eclairs(Y, compute = "correlation")
# eclairs decomposition from correlation matrix
eclairs_corMat(cor(Y), n = n)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.