Description Usage Arguments Details Value
View source: R/main_function.R
Adjust the diagonal of a symmetric square matrix, by the smallest eigenvalue method, in order to make it positive definite.
1 | makePositiveDefinite(M1, M2 = NULL, threshold = 0.1)
|
M1, M2 |
A squared numeric matrix, typically a correlation or a covariance matrix. It must be symmetric. |
threshold |
A correction factor. |
Finds the smallest eigenvalue lambda of M1
(or M1
and M2
if supplied) and adds (threshold-lambda) to the diagonal to make it positive definite.
A list with the corrected input matrices and the correction threshold
-lambda.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.