sparsify {rags2ridges} | R Documentation |
Determine the support of a partial correlation/precision matrix
Description
Function that determines the support of a partial correlation/precision matrix by thresholding and sparsifies it accordingly.
Usage
sparsify(
P,
threshold = c("absValue", "connected", "localFDR", "top"),
absValueCut = 0.25,
FDRcut = 0.9,
top = 10,
output = "heavy",
verbose = TRUE
)
Arguments
P |
(Possibly regularized) precision |
threshold |
A |
absValueCut |
A |
FDRcut |
A |
top |
A |
output |
A |
verbose |
A |
Details
The function transforms the possibly regularized input precision matrix to a
partial correlation matrix. Subsequently, the support of this partial
correlation matrix is determined. Support determination is performed either
by simple thresholding on the absolute values of matrix entries
(threshold = "absValue"
) or by usage of local FDR (threshold =
"localFDR"
). A third option is to retain a prespecified number of matrix
entries based on absolute values. For example, one could wish to retain
those entries representing the ten strongest absolute partial correlations
(threshold = "top"
). As a variation on this theme, a fourth option
(threshold = "connected"
) retains the top edges such that the
resulting graph is connected (this may result in dense graphs in practice).
The argument absValueCut
is only used when threshold =
"absValue"
. The argument top
is only used when threshold =
"top"
. The argument FDRcut
is only used when threshold =
"localFDR"
.
The function is to some extent a wrapper around certain
fdrtool functions when
threshold = "localFDR"
. In that case a mixture model is fitted to the
nonredundant partial correlations by
fdrtool. The decision to
retain elements is then based on the argument FDRcut
. Elements with a
posterior probability \geq
FDRcut (equalling 1 - local FDR) are
retained. See Schaefer and Strimmer (2005) for further details on usage of
local FDR in graphical modeling.
Value
If the input P
is a standardized precision (or partial
correlation) matrix the function returns a sparsified precision (or partial
correlation) matrix
whenever output = "heavy"
. If the input
P
is an unstandardized precision matrix the function returns an
object of class list
whenever output = "heavy"
:
sparseParCor |
A |
sparsePrecision |
A |
When output = "light"
, only the (matrix) positions of the zero and
non-zero elements are returned in an object of class list
:
zeros |
A |
nonzeros |
A |
Author(s)
Carel F.W. Peeters <carel.peeters@wur.nl>, Wessel N. van Wieringen
References
Schaefer, J., and Strimmer, K. (2005). A shrinkage approach to large-scale covariance estimation and implications for functional genomics. Statistical Applications in Genetics and Molecular Biology, 4:32.
See Also
ridgeP
, optPenalty.aLOOCV
,
optPenalty.LOOCV
Examples
## Obtain some (high-dimensional) data
p = 25
n = 10
set.seed(333)
X = matrix(rnorm(n*p), nrow = n, ncol = p)
colnames(X)[1:25] = letters[1:25]
## Obtain regularized precision under optimal penalty
OPT <- optPenalty.LOOCV(X, lambdaMin = .5, lambdaMax = 30, step = 100)
## Determine support regularized (standardized) precision under optimal penalty
sparsify(OPT$optPrec, threshold = "localFDR")