Skip to contents

PD calibration

Usage

nearpdf(cormatrix, pda.method = "shrink", lmin = 0.1)

Arguments

cormatrix

input cormatrix

pda.method

"nearpd" or FALSE

lmin

the min threshold of eigenvalues

Value

cormatrix.pd, the positive-definite adjusted correlation matrix

lmin, the min threshold of eigenvalues

Examples

x = matrix(rnorm(100), ncol = 10)
nearpdf(cor(x), pda.method = "nearpd", lmin = 0.1)
#> $cormatrix.pd
#>               [,1]        [,2]          [,3]        [,4]         [,5]
#>  [1,]  1.041627715 -0.12565959 -0.2133652869 -0.43997906 -0.009425594
#>  [2,] -0.125659593  1.02822184 -0.2850955394  0.06050664  0.735039351
#>  [3,] -0.213365287 -0.28509554  1.0316172446  0.13450826 -0.137024710
#>  [4,] -0.439979062  0.06050664  0.1345082562  1.00308678 -0.383786905
#>  [5,] -0.009425594  0.73503935 -0.1370247103 -0.38378691  1.014802313
#>  [6,] -0.608535673  0.52518813  0.4671622428  0.31915208  0.406616893
#>  [7,] -0.210113085  0.16009149 -0.0001416765  0.51377988 -0.220410255
#>  [8,] -0.245808248  0.20283626  0.0967346515  0.53844095  0.059887824
#>  [9,] -0.371163172  0.27222262  0.5459382412  0.19878558  0.347497738
#> [10,] -0.887233808  0.03740553 -0.0009642327  0.37230450 -0.100016920
#>             [,6]          [,7]        [,8]       [,9]         [,10]
#>  [1,] -0.6085357 -0.2101130846 -0.24580825 -0.3711632 -0.8872338078
#>  [2,]  0.5251881  0.1600914899  0.20283626  0.2722226  0.0374055286
#>  [3,]  0.4671622 -0.0001416765  0.09673465  0.5459382 -0.0009642327
#>  [4,]  0.3191521  0.5137798755  0.53844095  0.1987856  0.3723044998
#>  [5,]  0.4066169 -0.2204102546  0.05988782  0.3474977 -0.1000169195
#>  [6,]  1.0322913  0.2205965542  0.28887650  0.6370030  0.4126567809
#>  [7,]  0.2205966  1.0040915862  0.53415170  0.3556965  0.1709596620
#>  [8,]  0.2888765  0.5341517038  1.00243281  0.5873827  0.1149137316
#>  [9,]  0.6370030  0.3556964623  0.58738275  1.0185237  0.1056773641
#> [10,]  0.4126568  0.1709596620  0.11491373  0.1056774  1.0361715153
#> 
#> $lmin
#> [1] 0.1
#>