mpd: Coerce a non-positive definite symmetric matrix to positive...

Description Usage Arguments Value

View source: R/utilities.R

Description

This is a wrapper around the Matrix package's nearPD function. If the diagonal of the original matrix is all 1s, this is detected and assumed to indicate the input is a correlation matrix, so the resulting output is converted to a correlation matrix via cov2cor. If the diagonal is not all 1s, this is not applied.

Usage

1
mpd(m, tol = 1e-06)

Arguments

m

a symmetric matrix

tol

the tolerance value determines what eigenvalues are considered essentially zero. the default is 1e-6.

Value

a matrix


abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.