Documentation
¶
Index ¶
- func CovCor(X *mat.Dense, S *mat.SymDense) (F *mat.SymDense, norm float64, err error)
- func FrobeniusNorm(A, B []float64) float64
- func MaxAbsDiff(A, B []float64) float64
- func QuadraticInverseShrinkage(X *mat.Dense, S *mat.SymDense, demeanData bool) (F *mat.Dense, norm float64, err error)
- func SampleCovarianceMatrix(n int, t int, X []float64) []float64
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CovCor ¶
Returns a covariance estimate using linear shrinkage. The target preserves the diagonal of the sample covariance matrix and all correlation coefficients are the same.
Arguments: X *mat.Dense : matrix of n random variables by t observations. The data used to create the covariance matrix. Should be differenced if the covariance matrix is the covariance of the differences.
S *mat.SymDense: nxn covariance matrix. If nil, S will be the sample covariance matrix
Returns: F *mat.SymDense: nxn shrinkage estimator of the covariance matrix norm float64: maximum absolute difference between covariance and shrinkage matrix err error
func FrobeniusNorm ¶
Computes the Frobenius norm between matrices A and B
Arguments: A []float64: matrix A B []float64: matrix B
Returns: float64: Frobenius norm
func MaxAbsDiff ¶
Computes the maximum absolute difference between elements of matrices A and B
Arguments: A []float64: matrix A B []float64: matrix B
Returns: float64: maximum absolute difference between elements
func QuadraticInverseShrinkage ¶
func QuadraticInverseShrinkage(X *mat.Dense, S *mat.SymDense, demeanData bool) (F *mat.Dense, norm float64, err error)
deameanData bool: if true then demean the data, otherwise no demeaning takes place
Returns: F *mat.Dense: the Quadratic-Inverse-Shrinkage covariance estimator norm float64: maximum absolute difference between covariance and shrinkage matrix err error