1 #ifndef _SURFACEINSPECTOR_MATHS_STATISTICS_HPP_
2 #define _SURFACEINSPECTOR_MATHS_STATISTICS_HPP_
8 #include <surfaceinspector/util/Object.hpp>
9 #include <surfaceinspector/util/draggers/IDragger.hpp>
16 namespace SurfaceInspector{
namespace maths {
34 template <
typename T>
static T
mean(vector<T>
const &vals);
42 template <
typename T>
static T
variance(vector<T>
const &vals);
60 static T
stdev(vector<T>
const &vals);
70 static T
stdev(vector<T>
const &vals, T
const mean);
98 bool besselCorrection=
false
119 template <
typename T>
125 bool besselCorrection=
false
148 template <
typename T>
150 vector<vector<T>> dataset,
151 bool besselCorrection=
false
176 template <
typename T>
178 vector<vector<T>> dataset,
180 bool besselCorrection=
false
192 template <
typename T>
203 template <
typename T>
205 vector<T>
const &data,
229 template <
typename T>
233 double filterFactor=1.5
285 template <
typename T>
291 size_t * discardsCount =
nullptr
297 template <
typename T>
303 size_t * discardsCount =
nullptr
318 IDragger<
double, vector<double>> &drg,
320 size_t * discardsCount =
nullptr
326 #include <surfaceinspector/maths/Statistics.tpp>
Class providing common statistics operations.
Definition: Statistics.hpp:24
static bool findTrustableMin(vector< T > const &S, size_t const m, T const tau, T &g, size_t *discardsCount=nullptr)
Obtain the trustable minimum between all elements in given collection .
static arma::Mat< T > covarianceMatrix(vector< vector< T >> dataset, vector< T > means, bool besselCorrection=false)
Compute matrix of covariances.
static T stdev(vector< T > const &vals)
Compute the standard deviation of given values, which requires to previously compute the variance.
static T covariance(vector< T > const &X, vector< T > const &Y, T xMean, T yMean, bool besselCorrection=false)
Compute the covariance between X and Y, considering provided means.
static vector< T > quantiles(vector< T > const &data, size_t nQuantiles=3)
Like quantiles(armas::vec, size_t) function but receiving data as a standard vector instead of an arm...
static size_t quantileFiltering(vector< T > &values, size_t nQuantiles=3, double filterFactor=1.5)
Remove those values which are considered outliers.
static T variance(vector< T > const &vals, T const mean)
Compute the variance of given values, considering provided mean.
static T variance(vector< T > const &vals)
Compute the variance of given values, which requires to previously compute the mean.
static vector< T > quantiles(arma::Col< T > data, size_t nQuantiles=3)
Compute quantiles.
static T stdev(vector< T > const &vals, T const mean)
Compute the standard deviation of given values, considering provided mean.
static T mean(vector< T > const &vals)
Compute the mean of given values.
static bool _findTrustable(vector< T > const &S, size_t const m, T const tau, IDragger< double, vector< double >> &drg, T &g, size_t *discardsCount=nullptr)
Common mechanics for find trustable methods.
static T covariance(vector< T > const &X, vector< T > const &Y, bool besselCorrection=false)
Compute the covariance between X and Y.
static T stdev(T const variance)
Compute the standard deviation for given variance.
Definition: Statistics.hpp:77
static arma::Mat< T > covarianceMatrix(vector< vector< T >> dataset, bool besselCorrection=false)
Compute matrix of covariances.
static bool findTrustableMax(vector< T > const &S, size_t const m, T const tau, T &g, size_t *discardsCount=nullptr)
Like findTrustableMin but with maximum value instead of minimum.
Class representing an object. All surface inspector classes must extend Object.
Definition: Object.hpp:12
Dragger interface provide methods to drag elements from a given collection following a certain order....
Definition: IDragger.hpp:21