The input matrix A is decomposed into its eigen-values and eigen-vectors, The negative eigen-values are projected into the range between zero and the smallest positive eigen-value.

makePD2(A, pn_digits = NULL)

Arguments

A

input matrix

pn_digits

number of digits to be rounded to

Value

Bended positive-definite matrix A

Details

--- title: Check and Transform to Insure Positive Definite of Matrix date: "`r Sys.Date()`" ---

Examples

G<- matrix(c(100,80,20,6,80,50,10,2,20,10,6,1,6,2,1,1), ncol = 4, byrow=TRUE) makePD2(G)
#> [,1] [,2] [,3] [,4] #> [1,] 103.615081 75.499246 18.377481 5.013141 #> [2,] 75.499246 55.603411 12.020026 3.228634 #> [3,] 18.377481 12.020026 6.728218 1.442922 #> [4,] 5.013141 3.228634 1.442922 1.269397