v2.0.0
Loading...
Searching...
No Matches
sts_cov_estimators.h
Go to the documentation of this file.
1//=============================================================================================================
38
39#ifndef STS_COV_ESTIMATORS_H
40#define STS_COV_ESTIMATORS_H
41
42//=============================================================================================================
43// INCLUDES
44//=============================================================================================================
45
46#include "sts_global.h"
47
48//=============================================================================================================
49// EIGEN INCLUDES
50//=============================================================================================================
51
52#include <Eigen/Core>
53
54//=============================================================================================================
55// STL INCLUDES
56//=============================================================================================================
57
58#include <utility>
59#include <vector>
60#include <string>
61
62//=============================================================================================================
63// DEFINE NAMESPACE STSLIB
64//=============================================================================================================
65
66namespace STSLIB {
67
68//=============================================================================================================
79{
80public:
81 //=========================================================================================================
94 static std::pair<Eigen::MatrixXd, double> ledoitWolf(const Eigen::MatrixXd& matData);
95
96 //=========================================================================================================
109 static std::pair<Eigen::MatrixXd, double> oas(const Eigen::MatrixXd& matData);
110
111 //=========================================================================================================
123 static std::pair<Eigen::MatrixXd, double> diagonalFixed(const Eigen::MatrixXd& matData,
124 double dReg = 0.1);
125
126 //=========================================================================================================
140 static std::pair<Eigen::MatrixXd, double> pca(const Eigen::MatrixXd& matData,
141 int iRank = 0);
142
143 //=========================================================================================================
159 static std::pair<Eigen::MatrixXd, double> factorAnalysis(const Eigen::MatrixXd& matData,
160 int iNFactors = 0,
161 int iMaxIter = 200,
162 double dTol = 1e-6);
163
164 //=========================================================================================================
179 static std::pair<Eigen::MatrixXd, double> autoSelect(const Eigen::MatrixXd& matData,
180 int iNFolds = 3);
181
182 //=========================================================================================================
194 static double gaussianLogLikelihood(const Eigen::MatrixXd& matTestData,
195 const Eigen::MatrixXd& matCov);
196};
197
198} // namespace STSLIB
199
200#endif // STS_COV_ESTIMATORS_H
STSLIB shared-library export macro and build-info accessors for the statistical-tests library.
#define STSSHARED_EXPORT
Definition sts_global.h:44
Statistical testing (t-tests, F-tests, cluster permutation, multiple comparison correction).
Regularised covariance estimators (Ledoit-Wolf, OAS, fixed-diagonal, PCA, Factor Analysis,...
static std::pair< Eigen::MatrixXd, double > diagonalFixed(const Eigen::MatrixXd &matData, double dReg=0.1)
Fixed diagonal regularisation.
static std::pair< Eigen::MatrixXd, double > ledoitWolf(const Eigen::MatrixXd &matData)
Ledoit-Wolf optimal shrinkage covariance estimator.
static std::pair< Eigen::MatrixXd, double > autoSelect(const Eigen::MatrixXd &matData, int iNFolds=3)
Auto-select the best covariance estimator via cross-validation.
static std::pair< Eigen::MatrixXd, double > pca(const Eigen::MatrixXd &matData, int iRank=0)
PCA-based rank-reduced covariance estimator.
static std::pair< Eigen::MatrixXd, double > factorAnalysis(const Eigen::MatrixXd &matData, int iNFactors=0, int iMaxIter=200, double dTol=1e-6)
Factor Analysis covariance estimator via EM algorithm.
static double gaussianLogLikelihood(const Eigen::MatrixXd &matTestData, const Eigen::MatrixXd &matCov)
Gaussian log-likelihood of held-out data given a covariance model.
static std::pair< Eigen::MatrixXd, double > oas(const Eigen::MatrixXd &matData)
Oracle Approximating Shrinkage (OAS) covariance estimator.