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