Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make_psd-matrix-method

Adjust network matrix to be positive semi-definite


Description

Adjust network matrix to be positive semi-definite

Usage

## S4 method for signature 'matrix'
make_psd(x, eps = sqrt(.Machine$double.eps))

Arguments

x

A matrix specifying the network adjacency matrix.

eps

A numeric value, setting the tolance for smallest eigenvalue adjustment

Details

For a matrix N, the closest positive semi-definite matrix is calculated as N* = rho*N + (1+rho)*I, where I is the identity matrix and rho = 1/(1 - lambda) with lambda the smallest eigenvalue of N. For more details check the references.

Value

The matrix x, if it is positive definite and the closest positive semi-definite matrix if x is not positive semi-definite.

Author(s)

Juliane Manitz, Saskia Freytag, Stefanie Friedrichs

References

  • Freytag S, Manitz J, Schlather M, Kneib T, Amos CI, Risch A, Chang-Claude J, Heinrich J, Bickeboeller H: A network-based kernel machine test for the identification of risk pathways in genome-wide association studies. Hum Hered. 2013, 76(2):64-75.

Examples

set.seed(2345)
m <- matrix(data=sample(size=25, c(0,0,1), replace=TRUE),5,5)
m <- m + t(m)
min(eigen(m, only.values = TRUE, symmetric = TRUE)$values)
round(make_psd(m),2)

kangar00

Kernel Approaches for Nonlinear Genetic Association Regression

v1.4
GPL-2
Authors
Juliane Manitz [aut], Stefanie Friedrichs [aut], Patricia Burger [aut], Benjamin Hofner [aut], Ngoc Thuy Ha [aut], Saskia Freytag [ctb], Heike Bickeboeller [ctb]
Initial release
2020-02-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.