gstlearn  1.0.0
CCC
AAnam Class Referenceabstract

#include <AAnam.hpp>

Inheritance diagram for AAnam:
AStringable ASerializable ICloneable AnamContinuous AnamDiscrete AnamEmpirical AnamHermite AnamUser AnamDiscreteDD AnamDiscreteIR

Public Member Functions

 AAnam ()
 
 AAnam (const AAnam &m)
 
AAnamoperator= (const AAnam &m)
 
virtual ~AAnam ()
 
virtual const EAnam & getType () const =0
 Interface for AAnam. More...
 
virtual double getVariance () const
 
virtual bool hasFactor () const
 
virtual int getNFactor () const
 
virtual int getNClass () const
 
virtual bool isChangeSupportDefined () const =0
 
virtual VectorDouble z2factor (double z, const VectorInt &ifqcs) const
 
virtual double computeVariance (double sval) const
 
virtual int updatePointToBlock (double r_coef)
 
virtual bool allowChangeSupport () const
 
virtual bool hasGaussian () const
 
virtual double rawToTransformValue (double z) const
 
virtual double transformToRawValue (double y) const
 
virtual int fitFromArray (const VectorDouble &tab, const VectorDouble &wt=VectorDouble())
 
double invertVariance (double cvv) const
 
VectorDouble rawToTransformVec (const VectorDouble &z) const
 
VectorDouble transformToRawVec (const VectorDouble &z) const
 
int fitFromLocator (Db *db, const ELoc &locatorType=ELoc::fromKey("Z"))
 
int fit (Db *db, const String &name)
 
int rawToGaussianByLocator (Db *db, const NamingConvention &namconv=NamingConvention("Y"))
 
int rawToGaussian (Db *db, const String &name, const NamingConvention &namconv=NamingConvention("Y"))
 
int normalScore (Db *db, const String &name, const NamingConvention &namconv=NamingConvention("Gaussian"))
 
int gaussianToRawByLocator (Db *db, const NamingConvention &namconv=NamingConvention("Z"))
 
int gaussianToRaw (Db *db, const String &name, const NamingConvention &namconv=NamingConvention("Z"))
 
int rawToFactorByRanks (Db *db, const VectorInt &ifacs, const NamingConvention &namconv=NamingConvention("Factor"))
 
int rawToFactor (Db *db, int nfactor, const NamingConvention &namconv=NamingConvention("Factor"))
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (int level) const final
 
- Public Member Functions inherited from ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
virtual ~ASerializable ()
 
bool deserialize (std::istream &is, bool verbose=true)
 
bool serialize (std::ostream &os, bool verbose=true) const
 
bool dumpToNF (const String &neutralFilename, bool verbose=false) const
 
- Public Member Functions inherited from ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 

Protected Member Functions

bool _isSampleSkipped (Db *db, int iech, const VectorInt &cols_est, const VectorInt &cols_std)
 
bool _isFitted () const
 
- Protected Member Functions inherited from ASerializable
virtual bool _deserialize (std::istream &is, bool verbose=false)=0
 
virtual bool _serialize (std::ostream &os, bool verbose=false) const =0
 
virtual String _getNFName () const =0
 
bool _fileOpenWrite (const String &filename, std::ofstream &os, bool verbose=false) const
 
bool _fileOpenRead (const String &filename, std::ifstream &is, bool verbose=false) const
 

Private Member Functions

bool _isNcutValid (int ncut) const
 
bool _isProbaValid (double proba) const
 
void _printQTvars (const char *title, int type, int number) const
 

Private Attributes

bool _flagFitted
 

Additional Inherited Members

- Static Public Member Functions inherited from ASerializable
static String buildFileName (int status, const String &filename, bool ensureDirExist=false)
 
static String getHomeDirectory (const String &sub="")
 
static String getWorkingDirectory ()
 
static String getTestData (const String &subdir, const String &filename)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setContainerName (bool useDefault, const String &containerName="", bool verbose=false)
 
static void unsetContainerName ()
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetContainerName ()
 
static const StringgetPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 
- Static Protected Member Functions inherited from ASerializable
static bool _commentWrite (std::ostream &os, const String &comment)
 
template<typename T >
static bool _recordWrite (std::ostream &os, const String &title, const T &val)
 
template<typename T >
static bool _recordWriteVec (std::ostream &os, const String &title, const VectorT< T > &vec)
 
template<typename T >
static bool _recordRead (std::istream &is, const String &title, T &val)
 
template<typename T >
static bool _recordReadVec (std::istream &is, const String &title, VectorT< T > &vec, int nvalues)
 
static bool _onlyBlanks (char *string)
 
static bool _tableRead (std::istream &is, const String &string, int ntab, double *tab)
 
static bool _tableWrite (std::ostream &os, const String &string, int ntab, const VectorDouble &tab)
 

Constructor & Destructor Documentation

◆ AAnam() [1/2]

AAnam::AAnam ( )

◆ AAnam() [2/2]

AAnam::AAnam ( const AAnam m)

◆ ~AAnam()

AAnam::~AAnam ( )
virtual

Member Function Documentation

◆ _isFitted()

bool AAnam::_isFitted ( ) const
inlineprotected

◆ _isNcutValid()

bool AAnam::_isNcutValid ( int  ncut) const
private

◆ _isProbaValid()

bool AAnam::_isProbaValid ( double  proba) const
private

◆ _isSampleSkipped()

bool AAnam::_isSampleSkipped ( Db db,
int  iech,
const VectorInt cols_est,
const VectorInt cols_std 
)
protected

Check if a sample must be considered or not

Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]iechRank of the target sample
[in]cols_estArray of columns for factor estimation
[in]cols_stdArray of columns for factor st. dev.

◆ _printQTvars()

void AAnam::_printQTvars ( const char *  title,
int  type,
int  number 
) const
private

Print the contents of the qtvars structure

Parameters
[in]titleTitle
[in]type1 for estimation; 2 for stdev
[in]numberNumber of cutoffs

◆ allowChangeSupport()

virtual bool AAnam::allowChangeSupport ( ) const
inlinevirtual

Reimplemented in AnamHermite, AnamDiscreteIR, and AnamDiscreteDD.

◆ computeVariance()

double AAnam::computeVariance ( double  sval) const
virtual

Calculates the block variance

Returns
Value of the block variance (as a function of support coefficient)

Reimplemented in AnamHermite, AnamDiscreteIR, and AnamDiscreteDD.

◆ fit()

int AAnam::fit ( Db db,
const String name 
)

◆ fitFromArray()

virtual int AAnam::fitFromArray ( const VectorDouble tab,
const VectorDouble wt = VectorDouble() 
)
inlinevirtual

◆ fitFromLocator()

int AAnam::fitFromLocator ( Db db,
const ELoc &  locatorType = ELoc::fromKey("Z") 
)

◆ gaussianToRaw()

int AAnam::gaussianToRaw ( Db db,
const String name,
const NamingConvention namconv = NamingConvention("Z") 
)

◆ gaussianToRawByLocator()

int AAnam::gaussianToRawByLocator ( Db db,
const NamingConvention namconv = NamingConvention("Z") 
)

◆ getNClass()

virtual int AAnam::getNClass ( ) const
inlinevirtual

Reimplemented in AnamHermite, and AnamDiscrete.

◆ getNFactor()

virtual int AAnam::getNFactor ( ) const
inlinevirtual

Reimplemented in AnamHermite, AnamEmpirical, and AnamDiscreteDD.

◆ getType()

virtual const EAnam& AAnam::getType ( ) const
pure virtual

Interface for AAnam.

Implemented in AnamUser, AnamHermite, AnamEmpirical, AnamDiscreteIR, and AnamDiscreteDD.

◆ getVariance()

virtual double AAnam::getVariance ( ) const
inlinevirtual

Reimplemented in AnamDiscrete, and AnamContinuous.

◆ hasFactor()

virtual bool AAnam::hasFactor ( ) const
inlinevirtual

Reimplemented in AnamHermite, AnamDiscreteIR, and AnamDiscreteDD.

◆ hasGaussian()

virtual bool AAnam::hasGaussian ( ) const
inlinevirtual

Reimplemented in AnamDiscrete, and AnamContinuous.

◆ invertVariance()

double AAnam::invertVariance ( double  cvv) const

Find the coefficient of change of support

Returns
Value for the change of support coefficient
Parameters
[in]cvvMean covariance value over a block

◆ isChangeSupportDefined()

virtual bool AAnam::isChangeSupportDefined ( ) const
pure virtual

◆ normalScore()

int AAnam::normalScore ( Db db,
const String name,
const NamingConvention namconv = NamingConvention("Gaussian") 
)

Transform the target variable inti Gaussian by Normal Score

Returns
Error return code
Parameters
[in]dbDb Structure
[in]nameTarget variable
[in]namconvNaming convention

◆ operator=()

AAnam & AAnam::operator= ( const AAnam m)

◆ rawToFactor()

int AAnam::rawToFactor ( Db db,
int  nfactor,
const NamingConvention namconv = NamingConvention("Factor") 
)

Calculate the factors corresponding to an input data vector

Returns
Error return code
Parameters
[in]dbDb structure
[in]nfactorNumber of first factors
[in]namconvNaming convention

◆ rawToFactorByRanks()

int AAnam::rawToFactorByRanks ( Db db,
const VectorInt ifacs,
const NamingConvention namconv = NamingConvention(                             "Factor") 
)

Calculate the factors corresponding to an input data vector

Returns
Error return code
Parameters
[in]dbDb structure
[in]ifacsArray of factor ranks
[in]namconvNaming convention

◆ rawToGaussian()

int AAnam::rawToGaussian ( Db db,
const String name,
const NamingConvention namconv = NamingConvention("Y") 
)

◆ rawToGaussianByLocator()

int AAnam::rawToGaussianByLocator ( Db db,
const NamingConvention namconv = NamingConvention("Y") 
)

Process the variable(s) stored with locator Z

Parameters
dbDb structure
namconvNaming Convention
Returns

◆ rawToTransformValue()

double AAnam::rawToTransformValue ( double  z) const
virtual

Reimplemented in AnamEmpirical, AnamHermite, and AnamUser.

◆ rawToTransformVec()

VectorDouble AAnam::rawToTransformVec ( const VectorDouble z) const

◆ transformToRawValue()

double AAnam::transformToRawValue ( double  y) const
virtual

Reimplemented in AnamEmpirical, AnamHermite, and AnamUser.

◆ transformToRawVec()

VectorDouble AAnam::transformToRawVec ( const VectorDouble z) const

◆ updatePointToBlock()

int AAnam::updatePointToBlock ( double  r_coef)
virtual

Reimplemented in AnamHermite, AnamDiscreteIR, and AnamDiscreteDD.

◆ z2factor()

VectorDouble AAnam::z2factor ( double  z,
const VectorInt ifqcs 
) const
virtual

Reimplemented in AnamHermite, AnamDiscreteIR, and AnamDiscreteDD.

Member Data Documentation

◆ _flagFitted

bool AAnam::_flagFitted
private

The documentation for this class was generated from the following files: