![]() |
1.7.2
Geostatistics & Machine Learning toolbox | https://gstlearn.org
|
![]() |
Class containing the Model Information describing the formal Spatial (or Temporal) Characteristics of the (set of) random variable(s) under study. More...
#include <Model.hpp>
Class containing the Model Information describing the formal Spatial (or Temporal) Characteristics of the (set of) random variable(s) under study.
The Model is essentially a container with two main contents:
The additional member CovContext only serves in carrying the following information:
Public Member Functions | |
Model (const CovContext &ctxt=CovContext()) | |
Model (int nvar, int ndim=2) | |
Model (const Model &m) | |
Model & | operator= (const Model &m) |
virtual | ~Model () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. | |
const CovAnisoList * | castInCovAnisoListConst (int icov=-1) const |
const CovLMCTapering * | castInCovLMCTaperingConst () const |
const CovLMGradient * | castInCovLMGradientConst () const |
const CovLMCAnamorphosis * | castInCovLMCAnamorphosisConst () const |
CovAnisoList * | _castInCovAnisoList (int icov=-1) |
CovLMCTapering * | _castInCovLMCTapering () |
CovLMGradient * | _castInCovLMGradient () |
CovLMCAnamorphosis * | _castInCovLMCAnamorphosis () |
int | resetFromDb (const Db *db) |
void | setCovAnisoList (const CovAnisoList *covalist) |
void | addCovAniso (const CovAniso *cov) |
void | addCovFromParam (const ECov &type, double range=EPSILON6, double sill=1., double param=1., const VectorDouble &ranges=VectorDouble(), const MatrixSymmetric &sills=MatrixSymmetric(), const VectorDouble &angles=VectorDouble(), bool flagRange=true) |
void | addCovFromParamOldStyle (const ECov &type, double range=EPSILON6, double sill=1., double param=1., const VectorDouble &ranges=VectorDouble(), const VectorDouble &sills=VectorDouble(), const VectorDouble &angles=VectorDouble(), bool flagRange=true) |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeRangeNoStatDb) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeScaleNoStatDb) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeAngleNoStatDb) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeTensorNoStatDb) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeParamNoStatDb) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeRangeNoStatFunctional) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeScaleNoStatFunctional) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeAngleNoStatFunctional) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeTensorNoStatFunctional) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeParamNoStatFunctional) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeRangeStationary) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeScaleStationary) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeAngleStationary) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeTensorStationary) | |
FORWARD_METHOD_NON_CONST (_castInCovAnisoList, makeParamStationary) | |
int | setAnam (const AAnam *anam, const VectorInt &strcnt=VectorInt()) |
int | unsetAnam () |
bool | isFlagGradient () const |
bool | isFlagGradientNumerical () const |
bool | isFlagGradientFunctional () const |
void | switchToGradient () |
const CovAnisoList * | getCovAnisoList () const |
TODO : to be removed (encapsulation of CovAnisoList) | |
CovAnisoList * | getCovAnisoListModify () |
double | evalCovFromIncr (const VectorDouble &incr, int icov=0, const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
Model * | duplicate () const |
Model * | createReduce (const VectorInt &validVars) const |
int | getNVar () const |
int | fitFromCovIndices (Vario *vario, const VectorECov &types=ECov::fromKeys({"EXPONENTIAL"}), const Constraints &constraints=Constraints(), const Option_VarioFit &optvar=Option_VarioFit(), const Option_AutoFit &mauto=Option_AutoFit(), bool verbose=false) |
int | fit (Vario *vario, const VectorECov &types=ECov::fromKeys({"SPHERICAL"}), const Constraints &constraints=Constraints(), const Option_VarioFit &optvar=Option_VarioFit(), const Option_AutoFit &mauto=Option_AutoFit(), bool verbose=false) |
int | fitFromVMap (DbGrid *dbmap, const VectorECov &types=ECov::fromKeys({"SPHERICAL"}), const Constraints &constraints=Constraints(), const Option_VarioFit &optvar=Option_VarioFit(), const Option_AutoFit &mauto=Option_AutoFit(), bool verbose=false) |
int | stabilize (double percent, bool verbose=false) |
int | standardize (bool verbose=false) |
bool | isValid () const |
![]() | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (int level) const final |
![]() | |
ASerializable () | |
ASerializable (const ASerializable &r) | |
ASerializable & | operator= (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 |
![]() | |
ModelCovList (const CovContext &ctxt=CovContext()) | |
ModelCovList (const ModelCovList &m) | |
ModelCovList & | operator= (const ModelCovList &m) |
virtual | ~ModelCovList () |
const CovList * | getCovList () const |
CovList * | getCovListModify () const |
FORWARD_METHOD_NON_CONST (getCovListModify, setCovFiltered) | |
void | setCovList (CovList *covs) |
virtual void | addCov (const CovBase *cov) |
![]() | |
ModelGeneric (const CovContext &ctxt=CovContext()) | |
ModelGeneric (const ModelGeneric &r) | |
ModelGeneric & | operator= (const ModelGeneric &r) |
virtual | ~ModelGeneric () |
const ACov * | getCov () const |
const CovContext * | getContext () const |
const DriftList * | getDriftList () const |
ACov * | _getCovModify () |
ICloneable interface. | |
CovContext * | _getContextModify () |
DriftList * | _getDriftListModify () |
void | setField (double field) |
bool | isValid () const |
void | setCov (ACov *cova) |
void | setDriftList (const DriftList *driftlist) |
void | setDriftIRF (int order=0, int nfex=0) |
void | addDrift (const ADrift *drift) |
void | setDrifts (const VectorString &driftSymbols) |
double | computeLogLikelihood (const Db *db, bool verbose=false) |
![]() | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
Static Public Member Functions | |
static Model * | create (const CovContext &ctxt=CovContext()) |
static Model * | createFromEnvironment (int nvar, int ndim=2) |
static Model * | createNugget (int nvar, int ndim=2, double sill=1.) |
static Model * | createFromParam (const ECov &type=ECov::fromKey("NUGGET"), double range=1., double sill=1., double param=1., const VectorDouble &ranges=VectorDouble(), const MatrixSymmetric &sills=MatrixSymmetric(), const VectorDouble &angles=VectorDouble(), const ASpaceSharedPtr &space=ASpaceSharedPtr(), bool flagRange=true) |
static Model * | createFromParamOldStyle (const ECov &type=ECov::fromKey("NUGGET"), double range=1., double sill=1., double param=1., const VectorDouble &ranges=VectorDouble(), const VectorDouble &sills=VectorDouble(), const VectorDouble &angles=VectorDouble(), const ASpaceSharedPtr &space=ASpaceSharedPtr(), bool flagRange=true) |
static Model * | createFromDb (const Db *db) |
static Model * | createFromNF (const String &neutralFilename, bool verbose=true) |
static Model * | createFromVario (Vario *vario, const VectorECov &types=ECov::fromKeys({"SPHERICAL"}), const Constraints &constraints=Constraints(), const Option_VarioFit &optvar=Option_VarioFit(), const Option_AutoFit &mauto=Option_AutoFit(), bool verbose=false) |
static Model * | createFillRandom (int ndim, int nvar, const std::vector< ECov > &types=ECov::fromKeys({"SPHERICAL"}), double hmax=1, int order=-1, int nfex=0, int seed=13242) |
static void | gofDisplay (double gof, bool byValue=true, const VectorDouble &thresholds={2., 5., 10., 100}) |
static VectorECov | initCovList (const VectorInt &covranks) |
![]() | |
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 String & | getContainerName () |
static const String & | getPrefixName () |
static bool | createDirectory (const String &dir) |
static String | getExecDirectory () |
static String | getDirectory (const String &path) |
Model::Model | ( | const CovContext & | ctxt = CovContext() | ) |
Model::Model | ( | int | nvar, |
int | ndim = 2 |
||
) |
Model::Model | ( | const Model & | m | ) |
|
virtual |
CovAnisoList * Model::_castInCovAnisoList | ( | int | icov = -1 | ) |
CovLMCAnamorphosis * Model::_castInCovLMCAnamorphosis | ( | ) |
CovLMCTapering * Model::_castInCovLMCTapering | ( | ) |
CovLMGradient * Model::_castInCovLMGradient | ( | ) |
void Model::addCovAniso | ( | const CovAniso * | cov | ) |
void Model::addCovFromParam | ( | const ECov & | type, |
double | range = EPSILON6 , |
||
double | sill = 1. , |
||
double | param = 1. , |
||
const VectorDouble & | ranges = VectorDouble() , |
||
const MatrixSymmetric & | sills = MatrixSymmetric() , |
||
const VectorDouble & | angles = VectorDouble() , |
||
bool | flagRange = true |
||
) |
void Model::addCovFromParamOldStyle | ( | const ECov & | type, |
double | range = EPSILON6 , |
||
double | sill = 1. , |
||
double | param = 1. , |
||
const VectorDouble & | ranges = VectorDouble() , |
||
const VectorDouble & | sills = VectorDouble() , |
||
const VectorDouble & | angles = VectorDouble() , |
||
bool | flagRange = true |
||
) |
const CovAnisoList * Model::castInCovAnisoListConst | ( | int | icov = -1 | ) | const |
This internal function tries to cast the member '_cova' into a pointer to CovAnisoList and checks the validity of the argument 'icov' which gives the rank within this list
icov | Rank of the CovAniso (to be checked if >= 0) |
const CovLMCAnamorphosis * Model::castInCovLMCAnamorphosisConst | ( | ) | const |
const CovLMCTapering * Model::castInCovLMCTaperingConst | ( | ) | const |
const CovLMGradient * Model::castInCovLMGradientConst | ( | ) | const |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Model * Model::duplicate | ( | ) | const |
double Model::evalCovFromIncr | ( | const VectorDouble & | incr, |
int | icov = 0 , |
||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
int Model::fit | ( | Vario * | vario, |
const VectorECov & | types = ECov::fromKeys({"SPHERICAL"}) , |
||
const Constraints & | constraints = Constraints() , |
||
const Option_VarioFit & | optvar = Option_VarioFit() , |
||
const Option_AutoFit & | mauto = Option_AutoFit() , |
||
bool | verbose = false |
||
) |
Automatic Fitting procedure from an experimental Variogram
vario | Experimental variogram to be fitted |
types | Vector of ECov (see remarks) |
constraints | Set of Constraints |
optvar | Set of options |
mauto | Special parameters for Automatic fitting procedure (instance of Option_AutoFit), for exemple wmode (type of weighting function) |
verbose | Verbose option |
TODO : What to do with that ?
int Model::fitFromCovIndices | ( | Vario * | vario, |
const VectorECov & | types = ECov::fromKeys({"EXPONENTIAL"}) , |
||
const Constraints & | constraints = Constraints() , |
||
const Option_VarioFit & | optvar = Option_VarioFit() , |
||
const Option_AutoFit & | mauto = Option_AutoFit() , |
||
bool | verbose = false |
||
) |
Automatic Fitting procedure
vario | Experimental variogram to be fitted |
types | Vector of ECov integer values |
constraints | Set of Constraints |
optvar | Set of options |
mauto | Special parameters for Automatic fitting procedure |
verbose | Verbose option |
TODO : What to do with that ?
int Model::fitFromVMap | ( | DbGrid * | dbmap, |
const VectorECov & | types = ECov::fromKeys({"SPHERICAL"}) , |
||
const Constraints & | constraints = Constraints() , |
||
const Option_VarioFit & | optvar = Option_VarioFit() , |
||
const Option_AutoFit & | mauto = Option_AutoFit() , |
||
bool | verbose = false |
||
) |
Automatic Fitting procedure from A Variogram Map stored on a DbGrid
dbmap | DbGrid containing the Variogram Map |
types | Vector of ECov |
constraints | Set of Constraints |
optvar | Set of options |
mauto | Special parameters for Automatic fitting procedure (instance of Option_AutoFit), for exemple wmode (type of weighting function) |
verbose | Verbose option |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeAngleNoStatDb | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeAngleNoStatFunctional | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeAngleStationary | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeParamNoStatDb | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeParamNoStatFunctional | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeParamStationary | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeRangeNoStatDb | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeRangeNoStatFunctional | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeRangeStationary | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeScaleNoStatDb | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeScaleNoStatFunctional | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeScaleStationary | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeTensorNoStatDb | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeTensorNoStatFunctional | |||
) |
Model::FORWARD_METHOD_NON_CONST | ( | _castInCovAnisoList | , |
makeTensorStationary | |||
) |
const CovAnisoList * Model::getCovAnisoList | ( | ) | const |
TODO : to be removed (encapsulation of CovAnisoList)
CovAnisoList * Model::getCovAnisoListModify | ( | ) |
int Model::getNVar | ( | ) | const |
|
static |
|
static |
bool Model::isFlagGradient | ( | ) | const |
bool Model::isFlagGradientFunctional | ( | ) | const |
bool Model::isFlagGradientNumerical | ( | ) | const |
bool Model::isValid | ( | ) | const |
int Model::resetFromDb | ( | const Db * | db | ) |
Defining an Anamorphosis information for the Model (in fact, this is added to CovAnisoList part and transforms it from CovAnisoList to CovLMCAnamorphosis
anam | Pointer to the anamorphosis |
strcnt | Array of covariance description used for IR case |
void Model::setCovAnisoList | ( | const CovAnisoList * | covalist | ) |
Add a list of Covariances. This operation cleans any previously stored covariance
covalist | List of Covariances to be added |
int Model::stabilize | ( | double | percent, |
bool | verbose = false |
||
) |
Stabilize the model (in the monovariate case)
[in] | percent | Percentage of nugget effect added |
[in] | verbose | true for a verbose output |
int Model::standardize | ( | bool | verbose = false | ) |
Normalize the model
[in] | verbose | true for a verbose output |
void Model::switchToGradient | ( | ) |
Switch to a Model dedicated to Gradients (transforms it from CovAnisoList to CovLMGradient)
|
overridevirtual |
int Model::unsetAnam | ( | ) |