spikedSteinShrinkEst() implements the asymptotically optimal shrinkage estimator with respect to the Stein loss in a spiked covariance matrix model. Informally, this model admits Gaussian data-generating processes whose covariance matrix is a scalar multiple of the identity, save for a few number of large "spikes". A thorough review of this estimator, or more generally spiked covariance matrix estimation, is provided in Donoho et al. (2018) .

spikedSteinShrinkEst(dat, p_n_ratio, num_spikes = NULL, noise = NULL)

Arguments

dat

A numeric data.frame, matrix, or similar object.

p_n_ratio

A numeric between 0 and 1 representing the asymptotic ratio of the number of features, p, and the number of observations, n.

num_spikes

A numeric integer equal to or larger than one which providing the known number of spikes in the population covariance matrix. Defaults to NULL, indicating that this value is not known and must be estimated.

noise

A numeric representing the known scalar multiple of the identity matrix giving the approximate population covariance matrix. Defaults to NULL, indicating that this values is not known and must be estimated.

Value

A matrix corresponding to the covariance matrix estimate.

References

Donoho D, Gavish M, Johnstone I (2018). “Optimal shrinkage of eigenvalues in the spiked covariance model.” The Annals of Statistics, 46(4), 1742 -- 1778.

Examples

spikedFrobeniusShrinkEst(dat = mtcars, p_n_ratio = 0.1, num_spikes = 2L)
#>              [,1]        [,2]        [,3]        [,4]        [,5]        [,6]
#>  [1,]   27.663147  -8.5966480  -633.37176 -320.952507   1.8380080  -4.3684649
#>  [2,]   -8.596648   3.1720621   199.67670  101.953292  -0.5776376   1.3759243
#>  [3,] -633.371758 199.6766974 15360.69990 6721.151917 -47.0759740 107.7048410
#>  [4,] -320.952507 101.9532921  6721.15192 4700.768676 -16.4566826  44.2090633
#>  [5,]    1.838008  -0.5776376   -47.07597  -16.456683   0.6095344  -0.3369659
#>  [6,]   -4.368465   1.3759243   107.70484   44.209063  -0.3369659   1.2155651
#>  [7,]    5.074470  -1.6193679   -96.02672  -86.790194   0.1888899  -0.5990458
#>  [8,]    1.968804  -0.6231265   -44.37709  -24.997643   0.1228698  -0.3019109
#>  [9,]    1.317145  -0.4118828   -36.58027   -8.326957   0.1301915  -0.2692398
#> [10,]    1.700204  -0.5290605   -50.81772   -6.363670   0.1931165  -0.3826658
#> [11,]   -4.468215   1.4298557    79.09401   83.073872  -0.1283000   0.4741877
#>               [,7]         [,8]         [,9]        [,10]       [,11]
#>  [1,]   5.07447019   1.96880419   1.31714549   1.70020351 -4.46821455
#>  [2,]  -1.61936786  -0.62312646  -0.41188281  -0.52906052  1.42985570
#>  [3,] -96.02671828 -44.37709273 -36.58027398 -50.81771930 79.09400796
#>  [4,] -86.79019439 -24.99764286  -8.32695723  -6.36367032 83.07387231
#>  [5,]   0.18888988   0.12286977   0.13019154   0.19311648 -0.12830000
#>  [6,]  -0.59904585  -0.30191093  -0.26923977  -0.38266576  0.47418772
#>  [7,]   2.19518483   0.41942038   0.03326137  -0.08623014 -1.72780065
#>  [8,]   0.41942038   0.60140834   0.08132900   0.09647834 -0.38221201
#>  [9,]   0.03326137   0.08132900   0.57613904   0.19030401  0.02318283
#> [10,]  -0.08623014   0.09647834   0.19030401   0.76682762  0.17556675
#> [11,]  -1.72780065  -0.38221201   0.02318283   0.17556675  2.19784126