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
69//=============================================================================================================
82{
83public:
84 //=========================================================================================================
97 static std::pair<Eigen::MatrixXd, double> ledoitWolf(const Eigen::MatrixXd& matData);
98
99 //=========================================================================================================
112 static std::pair<Eigen::MatrixXd, double> oas(const Eigen::MatrixXd& matData);
113
114 //=========================================================================================================
126 static std::pair<Eigen::MatrixXd, double> diagonalFixed(const Eigen::MatrixXd& matData,
127 double dReg = 0.1);
128
129 //=========================================================================================================
143 static std::pair<Eigen::MatrixXd, double> pca(const Eigen::MatrixXd& matData,
144 int iRank = 0);
145
146 //=========================================================================================================
162 static std::pair<Eigen::MatrixXd, double> factorAnalysis(const Eigen::MatrixXd& matData,
163 int iNFactors = 0,
164 int iMaxIter = 200,
165 double dTol = 1e-6);
166
167 //=========================================================================================================
182 static std::pair<Eigen::MatrixXd, double> autoSelect(const Eigen::MatrixXd& matData,
183 int iNFolds = 3);
184
185 //=========================================================================================================
197 static double gaussianLogLikelihood(const Eigen::MatrixXd& matTestData,
198 const Eigen::MatrixXd& matCov);
199};
200
201} // namespace STSLIB
202
203#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.