Estimate shrinkage parameter by empirical Bayes
estimate_lambda_eb(ev, n, p, nu, lambda = NULL)
array of eigen values
number of samples
number of features
scale of prior covariance matrix
(default: NULL) If NULL, estimate lambda from data. Else evaluate logML using specified lambda value.
value \(\lambda\) indicating the shrinkage between sample and prior covariance matrices.
Estimate shrinkage parameter for covariance matrix estimation using empirical Bayes method (Hannart and Naveau, 2014; Leday and Richardson, 2019). The shrinage estimate of the covariance matrix is \((1-\lambda)\hat\Sigma + \lambda \nu I\), where \(\hat\Sigma\) is the sample covariance matrix, given a value of \(lambda\). A large value of \(\lambda\) indicates more weight on the prior.
ev = c(10, 2, 1) # eigen values
n = 12 # samples
p = 3 # features
nu = 2 # scale of target covariance
mvIC:::estimate_lambda_eb(ev, n, p, nu)
#> $lambda
#> [1] 0.03382632
#>
#> $logML
#> [1] -30.95033
#>