estimate_lambda_eb: Estimate shrinkage parameter by empirical Bayes

View source: R/eb_lambda.R

estimate_lambda_ebR Documentation

Estimate shrinkage parameter by empirical Bayes

Description

Estimate shrinkage parameter by empirical Bayes

Usage

estimate_lambda_eb(ev, n, p, nu, lambda = NULL)

Arguments

ev

array of eigen values

n

number of samples

p

number of features

nu

scale of prior covariance matrix

lambda

(default: NULL) If NULL, estimate lambda from data. Else evaluate logML using specified lambda value.

Details

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-λ)\hatΣ + λ ν I, where \hatΣ is the sample covariance matrix, given a value of lambda. A large value of λ indicates more weight on the prior.

Value

value λ indicating the shrinkage between sample and prior covariance matrices.

Examples

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)


GabrielHoffman/mvIC documentation built on Aug. 30, 2022, 7:58 p.m.