Package 'stcov'

Title: Stein's Covariance Estimator
Description: Estimates a covariance matrix using Stein's isotonized covariance estimator, or a related estimator suggested by Haff.
Authors: Brett Naul <[email protected]>
Maintainer: Brett Naul <[email protected]>
License: GPL (>= 2)
Version: 0.1.0
Built: 2025-03-10 05:04:38 UTC
Source: https://github.com/cran/stcov

Help Index


Stein/Haff's covariance estimator

Description

Stein/Haff's covariance estimator

Usage

haff_cov(S, n)

Arguments

S

Sample covariance matrix

n

Number of observations

Value

Estimated covariance matrix

References

Haff, L. R. "The Variational Form of Certain Bayes Estimators." The Annals of Statistics 19, no. 3 (1991): 1163-1190.

Lin, S.P. and Perlman, M.D.. "A Monte Carlo comparison of four estimators of a covariance matrix." Multivariate Analysis 6 (1985): 411-429.

Stein, C. "Estimation of a covariance matrix". Rietz Lecture (1975).

Examples

p <- 5
n <- 10
S <- rWishart(1, n, diag(p))[,,1]
haff_cov(S, n)

Stein/Haff's ordered eigenvalue estimates

Description

Stein/Haff's ordered eigenvalue estimates

Usage

haff_eig(l, n)

Arguments

l

Sample eigenvalues

n

Number of observations

Value

Estimated eigenvalues

Examples

p <- 5
n <- 10
S <- rWishart(1, n, diag(p))[,,1]
l <- eigen(S)$val
haff_eig(l, n)

Stein's isotonized covariance estimator

Description

Stein's isotonized covariance estimator

Usage

iso_cov(S, n)

Arguments

S

Sample covariance matrix

n

Number of observations

Value

Estimated covariance matrix

Examples

p <- 5
n <- 10
S <- rWishart(1, n, diag(p))[,,1]
iso_cov(S, n)

Stein's isotonized eigenvalue estimates

Description

Stein's isotonized eigenvalue estimates

Usage

iso_eig(l, n)

Arguments

l

Sample eigenvalues

n

Number of observations

Value

Estimated eigenvalues

Examples

p <- 5
n <- 10
S <- rWishart(1, n, diag(p))[,,1]
l <- eigen(S)$val
iso_eig(l, n)

Stein's raw (unisotonized) eigenvalue estimates

Description

Stein's raw (unisotonized) eigenvalue estimates

Usage

stein_eig(l, n)

Arguments

l

Sample eigenvalues

n

Number of observations

Value

Estimated eigenvalues

Examples

p <- 5
n <- 10
S <- rWishart(1, n, diag(p))[,,1]
l <- eigen(S)$val
stein_eig(l, n)