Other functions
- is_PD(matrix: Array, tol: float = 1e-10) bool[source]
Check if a matrix is positive definite.
Parameters
- matrixjnp.ndarray
The matrix to validate.
- tolfloat, default 1e-10
Tolerance for symmetry check.
Returns
- bool
True if the matrix is a valid covariance matrix.
- shrink_estim(x, mse=True)[source]
Shrinkage of the covariance matrix
Shrinkage of the covariance matrix according to Schafer and Strimmer (2005).
Parameters
x: ndarrayA numeric matrix containing the residuals.
mse: bool, default TrueWhen True, residual moments are not mean-corrected (i.e., MSE rather than unbiased variance). When False, apply mean correction.
Returns
A shrunk covariance matrix.
References
Schafer, J.L. and Strimmer, K. (2005), A shrinkage approach to large-scale covariance matrix estimation and implications for functional genomics, Statistical Applications in Genetics and Molecular Biology, 4, 1
See Also