sparsify: Determine the support of a partial correlation/precision...

View source: R/rags2ridges.R

sparsifyR 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 matrix.

threshold

A character signifying type of sparsification by thresholding. Must be one of: "absValue", "connected", "localFDR", "top".

absValueCut

A numeric giving the cut-off for partial correlation element selection based on absolute value thresholding.

FDRcut

A numeric giving the cut-off for partial correlation element selection based on local false discovery rate (FDR) thresholding.

top

A numeric specifying the exact number of partial correlation elements to retain based on absolute value.

output

A character specifying the type of output required. Must be one of: "heavy", "light".

verbose

A logical indicating if intermediate output should be printed on screen.

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 matrix representing the sparsified partial correlation matrix.

sparsePrecision

A matrix representing the sparsified precision matrix.

When output = "light", only the (matrix) positions of the zero and non-zero elements are returned in an object of class list:

zeros

A matrix representing the row and column positions of zero entries.

nonzeros

A matrix representing the row and column positions of non-zero entries.

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")


rags2ridges documentation built on Oct. 14, 2023, 5:06 p.m.