1.4.0
CCC
 
Classical.hpp File Reference
#include "gstlearn_export.hpp"
#include "Enum/EStatOption.hpp"
#include "Matrix/MatrixSquareSymmetric.hpp"
#include "Basic/VectorNumT.hpp"
#include "Basic/NamingConvention.hpp"

Functions

GSTLEARN_EXPORT VectorString statOptionToName (const std::vector< EStatOption > &opers)
 
GSTLEARN_EXPORT std::vector< EStatOption > KeysToStatOptions (const VectorString &opers)
 
GSTLEARN_EXPORT Table dbStatisticsMono (Db *db, const VectorString &names, const std::vector< EStatOption > &opers=EStatOption::fromKeys({ "MEAN" }), bool flagIso=true, double proba=TEST, double vmin=TEST, double vmax=TEST, const String &title="")
 
GSTLEARN_EXPORT Table dbStatisticsCorrel (Db *db, const VectorString &names, bool flagIso=true, const String &title="")
 
GSTLEARN_EXPORT void dbStatisticsPrint (const Db *db, const VectorString &names, const std::vector< EStatOption > &opers=EStatOption::fromKeys({ "MEAN" }), bool flagIso=false, bool flagCorrel=false, const String &title="", const String &radix="")
 
GSTLEARN_EXPORT Table dbStatisticsMulti (Db *db, const VectorString &names, const EStatOption &oper=EStatOption::fromKey("MEAN"), bool flagMono=true, const String &title="")
 
GSTLEARN_EXPORT VectorDouble dbStatisticsPerCell (Db *db, DbGrid *dbgrid, const EStatOption &oper, const String &name1, const String &name2="", const VectorDouble &cuts=VectorDouble())
 
GSTLEARN_EXPORT int statisticsProportion (DbGrid *dbin, DbGrid *dbout, int pos, int nfacies, int radius)
 
GSTLEARN_EXPORT int statisticsTransition (DbGrid *dbin, DbGrid *dbout, int pos, int nfacies, int radius, int orient)
 
GSTLEARN_EXPORT VectorDouble dbStatisticsFacies (Db *db)
 
GSTLEARN_EXPORT double dbStatisticsIndicator (Db *db)
 
GSTLEARN_EXPORT MatrixSquareGeneralsphering (const AMatrix *X)
 
GSTLEARN_EXPORT VectorVectorInt correlationPairs (Db *db1, Db *db2, const String &name1, const String &name2, bool flagFrom1=false, bool verbose=false)
 
GSTLEARN_EXPORT VectorVectorInt hscatterPairs (Db *db, const String &name1, const String &name2, VarioParam *varioparam, int ipas=0, int idir=0, bool verbose=false)
 
GSTLEARN_EXPORT int correlationIdentify (Db *db1, Db *db2, int icol1, int icol2, Polygons *polygon)
 
GSTLEARN_EXPORT VectorVectorDouble condexp (Db *db1, Db *db2, int icol1, int icol2, double mini, double maxi, int nclass, bool verbose=false)
 
GSTLEARN_EXPORT std::map< int, int > contingencyTable (const VectorInt &values)
 
GSTLEARN_EXPORT std::map< int, std::map< int, int > > contingencyTable2 (const VectorInt &values, const VectorInt &bins)
 
GSTLEARN_EXPORT void dbStatisticsVariables (Db *db, const VectorString &names, const std::vector< EStatOption > &opers, int iptr0, double proba=TEST, double vmin=TEST, double vmax=TEST)
 
GSTLEARN_EXPORT int dbStatisticsInGridTool (Db *db, DbGrid *dbgrid, const VectorString &names, const EStatOption &oper, int radius, int iptr0)
 

Function Documentation

◆ condexp()

GSTLEARN_EXPORT VectorVectorDouble condexp ( Db db1,
Db db2,
int  icol1,
int  icol2,
double  mini,
double  maxi,
int  nclass,
bool  verbose 
)

Evaluate the experimental conditional expectation

Parameters
[in]db1Db descriptor (for target variable)
[in]db2Db descriptor (for auxiliary variables)
[in]icol1Rank of the target variable
[in]icol2Rank of the explanatory variable
[in]miniMinimum value for the explanaroty variable
[in]maxiMaximum value for the explanaroty variable
[in]nclassNumber of classes
[in]verboseVerbose flag

◆ contingencyTable()

GSTLEARN_EXPORT std::map<int, int> contingencyTable ( const VectorInt values)

◆ contingencyTable2()

GSTLEARN_EXPORT std::map<int, std::map<int,int> > contingencyTable2 ( const VectorInt values,
const VectorInt bins 
)

◆ correlationIdentify()

GSTLEARN_EXPORT int correlationIdentify ( Db db1,
Db db2,
int  icol1,
int  icol2,
Polygons polygon 
)

Identify samples from scatter plot when included within a polygon

Returns
Error return code
Parameters
[in]db1Db descriptor (first variable)
[in]db2Db descriptor (second variable for flag.same=T)
[in]icol1Rank of the first column
[in]icol2Rank of the second column
[in]polygonPolygons structure
Remarks
The two input Db must match exactly (same number of samples with
same set of coordinates and same optional selection)

◆ correlationPairs()

GSTLEARN_EXPORT VectorVectorInt correlationPairs ( Db db1,
Db db2,
const String name1,
const String name2,
bool  flagFrom1,
bool  verbose 
)

Evaluate the correlation Correl(Z1(x) , Z2(x))

Returns
Array of the indices of pairs of samples (or VectorVectorInt())
Parameters
[in]db1Db descriptor (first variable)
[in]db2Db descriptor (second variable for flag.same=T)
[in]name1Name of the first variable
[in]name2Name of the second variable
[in]flagFrom1Start numbering of indices from 1 if True
[in]verboseVerbose flag
Remarks
The two input Db must match exactly (same number of samples with
same set of coordinates and same optional selection)
The returned Vector of Vector of integer 'indices' contain
the set of indices of the pairs of samples.
Its contents is i1,j1,i2,j2,...
The indices are numbered starting from 0

◆ dbStatisticsFacies()

GSTLEARN_EXPORT VectorDouble dbStatisticsFacies ( Db db)

Considering that the Unique variable is a Facies (positive integer) returns the vector of proportions

Returns
The vector of proportions per Facies
Parameters
[in]dbDb structure

◆ dbStatisticsIndicator()

GSTLEARN_EXPORT double dbStatisticsIndicator ( Db db)

Considering that the Unique variable is an Indicator (0 or 1) returns the proportion of 1

Returns
The vector of proportions per Facies
Parameters
[in]dbDb structure

◆ dbStatisticsInGridTool()

GSTLEARN_EXPORT int dbStatisticsInGridTool ( Db db,
DbGrid dbgrid,
const VectorString names,
const EStatOption &  oper,
int  radius,
int  iptr0 
)

Calculates the monovariate statistics within cells of a grid

Returns
Error return code
Parameters
[in]dbDb for the points
[in]dbgridDb for the grid
[in]namesVector of target variable names
[in]operA EStatOption item
[in]radiusNeighborhood radius
[in]iptr0Storage address (first variable)

◆ hscatterPairs()

GSTLEARN_EXPORT VectorVectorInt hscatterPairs ( Db db,
const String name1,
const String name2,
VarioParam varioparam,
int  ipas,
int  idir,
bool  verbose 
)

Evaluate the shifted correlation calculated as follows: Correl(Z1(x) , Z2(x+h))

Returns
Vector of indices (or VectorVectorInt())
Parameters
[in]dbDb descriptor
[in]name1Name of the first variable
[in]name2Name of the second variable
[in]varioparampointer to a VarioParam structure
[in]ipasRank of the lag of interest
[in]idirRank of the direction of interest (within VarioParam)
[in]verboseVerbose flag
Remarks
The returned Vector of Vector of integer 'indices' contain
the set of indices of the pairs of samples.
Its contents is i1,j1,i2,j2,...
The indices are numbered starting from 1

◆ KeysToStatOptions()

GSTLEARN_EXPORT std::vector<EStatOption> KeysToStatOptions ( const VectorString opers)

◆ sphering()

GSTLEARN_EXPORT MatrixSquareGeneral* sphering ( const AMatrix X)

Sphering procedure

Parameters
XInput Data vector
Returns
The Sphering matrix (or nullptr if problem)
Remarks
When performing the (forward) sphering, you must perform the following operation
X <- prodMatMat(X, S)

◆ statisticsProportion()

GSTLEARN_EXPORT int statisticsProportion ( DbGrid dbin,
DbGrid dbout,
int  pos,
int  nfacies,
int  radius 
)

Calculates the "montee" from a grid into a 1-D grid

Returns
Error return code
Parameters
[in]dbinDb for the input grid
[in]dboutDb for the output grid
[in]posRank of the montee axis (starting from 0)
[in]nfaciesNumber of facies
[in]radiusRadius of the neighborhood

◆ statisticsTransition()

GSTLEARN_EXPORT int statisticsTransition ( DbGrid dbin,
DbGrid dbout,
int  pos,
int  nfacies,
int  radius,
int  orient 
)

Calculates the transition from a grid into a 1-D grid

Returns
Error return code
Parameters
[in]dbinDb for the input grid
[in]dboutDb for the output grid
[in]posRank of the montee axis (starting from 0)
[in]nfaciesNumber of facies
[in]radiusRadius of the neighborhood
[in]orientOrientation (+1 or -1)

◆ statOptionToName()

GSTLEARN_EXPORT VectorString statOptionToName ( const std::vector< EStatOption > &  opers)