gstlearn  1.0.0
CCC
KrigingSystem Class Reference

#include <KrigingSystem.hpp>

Public Member Functions

 KrigingSystem (Db *dbin, Db *dbout, const Model *model, ANeigh *neigh)
 
 KrigingSystem (const KrigingSystem &m)=delete
 
KrigingSystemoperator= (const KrigingSystem &m)=delete
 
virtual ~KrigingSystem ()
 
int setKrigOptCalcul (const EKrigOpt &calcul, const VectorInt &ndiscs=VectorInt(), bool flag_per_cell=false)
 
int setKrigOptXValid (bool flag_xvalid, bool flag_kfold, bool optionXValidEstim=false, bool optionXValidStdev=false, bool optionXValidVarZ=false)
 
int setKrigOptColCok (const VectorInt &rank_colcok)
 
int setKrigOptBayes (bool flag_bayes, const VectorDouble &prior_mean, const VectorDouble &prior_cov, int seed=414371)
 
int setKrigOptImage (int seed=133271)
 
int setKrigOptDataWeights (int iptrWeights, bool flagSet=true)
 
int setKrigOptMatCL (const VectorVectorDouble &matCL)
 
int setKrigoptCode (bool flag_code)
 
int setKrigOptFlagSimu (bool flagSimu, int nbsimu=0, int rankPGS=-1)
 
int setKrigOptSaveWeights (bool flag_save)
 
int setKrigOptDGM (bool flag_dgm, double eps=EPSILON6)
 
int setKrigOptFlagGlobal (bool flag_global)
 
int setKrigOptFlagLTerm (bool flag_lterm)
 
int setKrigOptAnamophosis (AAnam *anam)
 
int setKrigOptFactorKriging (bool flag_factor_kriging)
 
int updKrigOptEstim (int iptrEst, int iptrStd, int iptrVarZ)
 
int updKrigOptIclass (int index_class, int nclasses)
 
int updKrigOptNeighOnly (int iptrNeigh)
 
void setFlagCheckAddress (bool flagCheckAddress)
 
bool isReady ()
 
int estimate (int iech_out)
 
void conclusion ()
 
int getNDim () const
 
int getNech () const
 
int getNeq () const
 
int getNRed () const
 
VectorInt getSampleIndices () const
 
VectorVectorDouble getSampleCoordinates () const
 
VectorDouble getSampleData () const
 
VectorDouble getZam () const
 
VectorDouble getLHS () const
 
VectorDouble getLHSInv () const
 
VectorDouble getRHSC () const
 
VectorDouble getRHSC (int ivar) const
 
VectorDouble getWeights () const
 
VectorDouble getVariance () const
 
double getLTerm () const
 

Private Member Functions

int _getNVar () const
 
int _getNVarCL () const
 
int _getNbfl () const
 
int _getNFeq () const
 
int _getNFex () const
 
int _getNDisc () const
 
void _setFlag (int iech, int ivar, int value)
 
int _getFlag (int iech, int ivar)
 
double _getIdim (int loc_rank, int idim) const
 
double _getFext (int rank, int ibfl) const
 
double _getIvar (int rank, int ivar) const
 
double _getVerr (int rank, int ivar) const
 
double _getMean (int ivarCL) const
 
double _getDriftCoef (int ivar, int il, int ib) const
 
int _getFLAG (int iech, int ivar) const
 
double _getCOVTAB (int ivar, int jvar) const
 
void _addCOVTAB (int ivar, int jvar, double value)
 
void _prodCOVTAB (double value)
 
double _getRHS (int iech, int ivar, int jvCL) const
 
void _setRHS (int iech, int ivar, int jvCL, double value, bool isForDrift=false)
 
double _getRHSC (int i, int jvCL) const
 
double _getWGTC (int i, int jvCL) const
 
double _getLHS (int iech, int ivar, int jech, int jvar) const
 
double _getLHSINV (int iech, int ivar, int jech, int jvar) const
 
void _setLHS (int iech, int ivar, int jech, int jvar, double value, bool isForDrift=false)
 
void _addLHS (int iech, int ivar, int jech, int jvar, double value)
 
double _getLHSC (int i, int j) const
 
double _getDISC1 (int idisc, int idim) const
 
double _getZAM (int i) const
 
double _getZEXT (int i) const
 
void _setZEXT (int i, double value) const
 
VectorDouble _getDISC1Vec (int idisc) const
 
VectorVectorDouble _getDISC1s () const
 
double _getDISC2 (int idisc, int idim) const
 
VectorDouble _getDISC2Vec (int idisc) const
 
VectorVectorDouble _getDISC2s () const
 
double _getVAR0 (int ivCL, int jvCL) const
 
void _setVAR0 (int ivCL, int jvCL, double value)
 
const double * _getRHSCAdd (int i=0, int jvCL=0) const
 
const double * _getWGTCAdd (int i=0, int jvCL=0) const
 
const double * _getZamAdd (int i=0) const
 
const double * _getZextAdd (int i=0) const
 
void _resetMemoryGeneral ()
 
void _resetMemoryPerNeigh ()
 
void _flagDefine ()
 
void _zextInit ()
 
void _lhsInit ()
 
void _covUpdate (int icas1, int iech1, int icas2, int iech2)
 
void _covtabInit ()
 
void _covtabCalcul (int iech1, int iech2, const CovCalcMode *mode, bool flagSameData=false)
 
void _covCvvCalcul (const CovCalcMode *mode)
 
int _drftabCalcul (const ECalcMember &member, int iech)
 
bool _isAuthorized ()
 
double _continuousMultiplier (int rank1, int rank2, double eps=EPSILON4)
 
void _lhsCalcul ()
 
void _lhsIsoToHetero ()
 
void _lhsDump (int nbypas=5)
 
int _rhsCalcul ()
 
void _rhsCalculPoint ()
 
void _rhsCalculBlock ()
 
void _rhsCalculDrift ()
 
void _rhsCalculDGM ()
 
void _rhsStore (int iech)
 
void _rhsIsoToHetero ()
 
void _rhsDump ()
 
void _wgtCalcul ()
 
void _wgtDump (int status)
 
VectorInt _getRelativePosition ()
 
int _lhsInvert ()
 
void _dualCalcul ()
 
int _prepar ()
 
void _estimateCalcul (int status)
 
void _estimateCalculImage (int status)
 
void _estimateCalculXvalidUnique (int status)
 
void _simulateCalcul (int status)
 
void _neighCalcul (int status, const VectorDouble &tab)
 
double _estimateVarZ (int ivarCL, int jvarCL)
 
double _variance (int ivarCL, int jvarCL)
 
void _variance0 ()
 
void _krigingDump (int status)
 
void _simulateDump (int status)
 
void _saveWeights (int status)
 
void _blockDiscretize ()
 
bool _isCorrect ()
 
void _checkAddress (const String &title, const String &theme, int ival, int nval) const
 
bool _prepareForImage (const NeighImage *neighI)
 
bool _prepareForImageKriging (Db *dbaux, const NeighImage *neighI)
 
int _bayesPreCalculations ()
 
void _bayesPreSimulate ()
 
void _bayesCorrectVariance ()
 
void _transformGaussianToRaw ()
 
int _getFlagAddress (int iech0, int ivar0)
 
bool _isMatCLempty () const
 
void _setLocalModel (Model *model)
 
void _setInternalShortCutVariablesGeneral ()
 
void _setInternalShortCutVariablesModel ()
 
int _setInternalShortCutVariablesNeigh ()
 

Private Attributes

Db_dbin
 
Db_dbout
 
Model_modelInit
 
ANeigh_neigh
 
const AAnam_anam
 
bool _isReady
 
Model_model
 
bool _optimEnabled
 
CovCalcMode _calcModeLHS
 
CovCalcMode _calcModeRHS
 
CovCalcMode _calcModeVAR
 
int _iptrEst
 UID for storage. More...
 
int _iptrStd
 
int _iptrVarZ
 
bool _flagEst
 
bool _flagStd
 
bool _flagVarZ
 
bool _flagGlobal
 
bool _flagDataChanged
 
EKrigOpt _calcul
 Option for Calculation. More...
 
int _iptrWeights
 Option for Weights at Data locations. More...
 
bool _flagWeights
 
bool _flagSet
 
bool _flagSimu
 Option for Simulation. More...
 
int _nbsimu
 
int _rankPGS
 
bool _flagCode
 Options complement for neighborhood. More...
 
bool _flagPerCell
 Option for Block estimation. More...
 
int _ndiscNumber
 
VectorInt _ndiscs
 
VectorVectorDouble _disc1
 
VectorVectorDouble _disc2
 
bool _xvalidEstim
 Option for Cross_validation. More...
 
bool _xvalidStdev
 
bool _xvalidVarZ
 
VectorInt _rankColCok
 Option for Colocation. More...
 
bool _flagBayes
 Option for Bayesian. More...
 
int _seedForBayes
 
VectorDouble _priorMean
 
VectorDouble _priorCov
 
VectorDouble _postMean
 
VectorDouble _postCov
 
VectorVectorDouble _postSimu
 
VectorDouble _varCorrec
 
Model_modelSimple
 
bool _flagDGM
 Option for Discrete Gaussian Model. More...
 
bool _flagFactorKriging
 Option for (Disjunctive) Kriging of Factor. More...
 
int _nclasses
 
VectorVectorDouble _matCL
 Option for Estimating the Linear Combination of Variables. More...
 
bool _flagLTerm
 Option for asking for Z * A-1 * Z. More...
 
double _lterm
 
bool _flagAnam
 Option for Gaussian Kriging. More...
 
int _seedForImage
 Option for Estimation based on Image. More...
 
DbGrid_dbaux
 
bool _flagKeypairWeights
 Option for saving the Weights using Keypair mechanism. More...
 
bool _flagNeighOnly
 Option for Neighboring test. More...
 
int _iptrNeigh
 
int _iechOut
 Local variables. More...
 
int _ndim
 
int _nvar
 
int _nvarCL
 
int _nech
 
int _nbfl
 
int _nfeq
 
int _nfex
 
int _neq
 
int _nred
 
bool _flagIsotopic
 
bool _flagCheckAddress
 Working arrays. More...
 
VectorInt _nbgh
 
VectorInt _flag
 
MatrixSquareGeneral _covtab
 
MatrixSquareGeneral _covref
 
VectorDouble _drftab
 
VectorDouble _lhs
 
VectorDouble _lhsinv
 
VectorDouble _rhs
 
VectorDouble _wgt
 
VectorDouble _zam
 
VectorDouble _zext
 
MatrixSquareGeneral _var0
 
VectorInt _dbinUidToBeDeleted
 
VectorInt _dboutUidToBeDeleted
 
SpaceRN _space
 Some Space Point allocated once for all. More...
 
SpacePoint _p0
 
SpacePoint _p1
 
SpacePoint _p2
 
SpacePoint _p0_memo
 

Constructor & Destructor Documentation

◆ KrigingSystem() [1/2]

KrigingSystem::KrigingSystem ( Db dbin,
Db dbout,
const Model model,
ANeigh neigh 
)

◆ KrigingSystem() [2/2]

KrigingSystem::KrigingSystem ( const KrigingSystem m)
delete

◆ ~KrigingSystem()

KrigingSystem::~KrigingSystem ( )
virtual

Member Function Documentation

◆ _addCOVTAB()

void KrigingSystem::_addCOVTAB ( int  ivar,
int  jvar,
double  value 
)
private

◆ _addLHS()

void KrigingSystem::_addLHS ( int  iech,
int  ivar,
int  jech,
int  jvar,
double  value 
)
private

◆ _bayesCorrectVariance()

void KrigingSystem::_bayesCorrectVariance ( )
private

Correct the array of Variance in Bayesian case

◆ _bayesPreCalculations()

int KrigingSystem::_bayesPreCalculations ( )
private

Perform the Bayesian estimation of the Drift Coefficients (only in Unique Neighborhood)

◆ _bayesPreSimulate()

void KrigingSystem::_bayesPreSimulate ( )
private

Simulate the drift coefficients from the posterior distributions

◆ _blockDiscretize()

void KrigingSystem::_blockDiscretize ( )
private

◆ _checkAddress()

void KrigingSystem::_checkAddress ( const String title,
const String theme,
int  ival,
int  nval 
) const
private

◆ _continuousMultiplier()

double KrigingSystem::_continuousMultiplier ( int  rank1,
int  rank2,
double  eps = EPSILON4 
)
private

Returns the additional variance for continuous moving neighborhood

Returns
Variance multiplier for Continuous Option
Parameters
[in]rank1Rank of the sample in the first Db
[in]rank2Rank of the sample in the second Db
[in]epsDistance tolerance
Remarks
In the case of a neighborhood which is not MOVING (or undefined),
this function systematically returns 0.

◆ _covCvvCalcul()

void KrigingSystem::_covCvvCalcul ( const CovCalcMode mode)
private

◆ _covtabCalcul()

void KrigingSystem::_covtabCalcul ( int  iech1,
int  iech2,
const CovCalcMode mode,
bool  flagSameData = false 
)
private

Module for calculating the covariance internally It is called for LHS (iech1>=0 && iech2>=0), RHS (iech1>=0 && iech2=-1) and VAR (iech1=-1 && iech2=-1)

Parameters
iech1Rank of the first sample (or -1 for target)
iech2Rank of the second sample (or -1 for target)
modeCovCalcMode structure
flagSameDataTrue when both Data samples coincide

◆ _covtabInit()

void KrigingSystem::_covtabInit ( )
private

◆ _covUpdate()

void KrigingSystem::_covUpdate ( int  icas1,
int  iech1,
int  icas2,
int  iech2 
)
private

Modify the covariance before calling the covariance evaluation This makes sense only when non-stationarity is defined

Parameters
icas11 for dbin and 2 for Dbout
iech1Rank of the first sample (or -1 for target)
icas21 for dbin and 2 for Dbout
iech2Rank of the second sample (or -1 for target)

◆ _drftabCalcul()

int KrigingSystem::_drftabCalcul ( const ECalcMember &  member,
int  iech 
)
private

◆ _dualCalcul()

void KrigingSystem::_dualCalcul ( )
private

Extract the valid data Operate the product by the inverse covariance matrix

Warning; the array 'zext' is dimensioned to '_neq' instead of 'nred'

◆ _estimateCalcul()

void KrigingSystem::_estimateCalcul ( int  status)
private

Calculate the final estimation and storage

Parameters
[in]statusKriging error status

◆ _estimateCalculImage()

void KrigingSystem::_estimateCalculImage ( int  status)
private

◆ _estimateCalculXvalidUnique()

void KrigingSystem::_estimateCalculXvalidUnique ( int  status)
private

◆ _estimateVarZ()

double KrigingSystem::_estimateVarZ ( int  ivarCL,
int  jvarCL 
)
private

Establish the variance of the estimator

Parameters
[in]ivarCLRank of the target variable
[in]jvarCLRank of the auxiliary variable

◆ _flagDefine()

void KrigingSystem::_flagDefine ( )
private

Define the array flag to convert from isotropic to heterotopic case Stores the reduced number of equations in member '_nred'

◆ _getCOVTAB()

double KrigingSystem::_getCOVTAB ( int  ivar,
int  jvar 
) const
private

◆ _getDISC1()

double KrigingSystem::_getDISC1 ( int  idisc,
int  idim 
) const
private

◆ _getDISC1s()

VectorVectorDouble KrigingSystem::_getDISC1s ( ) const
private

◆ _getDISC1Vec()

VectorDouble KrigingSystem::_getDISC1Vec ( int  idisc) const
private

◆ _getDISC2()

double KrigingSystem::_getDISC2 ( int  idisc,
int  idim 
) const
private

◆ _getDISC2s()

VectorVectorDouble KrigingSystem::_getDISC2s ( ) const
private

◆ _getDISC2Vec()

VectorDouble KrigingSystem::_getDISC2Vec ( int  idisc) const
private

◆ _getDriftCoef()

double KrigingSystem::_getDriftCoef ( int  ivar,
int  il,
int  ib 
) const
private

◆ _getFext()

double KrigingSystem::_getFext ( int  rank,
int  ibfl 
) const
private

Returns the value of the external drift "rank" (if rank >= 0) or of the target (if rank < 0)

Parameters
[in]rankRank of the sample
[in]ibflRank of the external drift

◆ _getFlag()

int KrigingSystem::_getFlag ( int  iech,
int  ivar 
)
private

◆ _getFLAG()

int KrigingSystem::_getFLAG ( int  iech,
int  ivar 
) const
private

◆ _getFlagAddress()

int KrigingSystem::_getFlagAddress ( int  iech0,
int  ivar0 
)
private

◆ _getIdim()

double KrigingSystem::_getIdim ( int  loc_rank,
int  idim 
) const
private

Returns the coordinate of the data (at rank if rank >= 0) or of the target (if rank < 0)

Parameters
[in]loc_rankRank of the sample
[in]idimRank of the coordinate

◆ _getIvar()

double KrigingSystem::_getIvar ( int  rank,
int  ivar 
) const
private

Returns the value of the variable (at rank if rank >= 0) or of the target (if rank < 0)

Parameters
[in]rankRank of the sample
[in]ivarRank of the variable
Remarks
In case of simulation, the variable of the first simulation
is systematically returned. This has no influence on the rest
of the calculations

◆ _getLHS()

double KrigingSystem::_getLHS ( int  iech,
int  ivar,
int  jech,
int  jvar 
) const
private

◆ _getLHSC()

double KrigingSystem::_getLHSC ( int  i,
int  j 
) const
private

◆ _getLHSINV()

double KrigingSystem::_getLHSINV ( int  iech,
int  ivar,
int  jech,
int  jvar 
) const
private

◆ _getMean()

double KrigingSystem::_getMean ( int  ivarCL) const
private

◆ _getNbfl()

int KrigingSystem::_getNbfl ( ) const
private

◆ _getNDisc()

int KrigingSystem::_getNDisc ( ) const
private

◆ _getNFeq()

int KrigingSystem::_getNFeq ( ) const
private

◆ _getNFex()

int KrigingSystem::_getNFex ( ) const
private

◆ _getNVar()

int KrigingSystem::_getNVar ( ) const
private

◆ _getNVarCL()

int KrigingSystem::_getNVarCL ( ) const
private

◆ _getRelativePosition()

VectorInt KrigingSystem::_getRelativePosition ( )
private

◆ _getRHS()

double KrigingSystem::_getRHS ( int  iech,
int  ivar,
int  jvCL 
) const
private

◆ _getRHSC()

double KrigingSystem::_getRHSC ( int  i,
int  jvCL 
) const
private

◆ _getRHSCAdd()

const double * KrigingSystem::_getRHSCAdd ( int  i = 0,
int  jvCL = 0 
) const
private

◆ _getVAR0()

double KrigingSystem::_getVAR0 ( int  ivCL,
int  jvCL 
) const
private

◆ _getVerr()

double KrigingSystem::_getVerr ( int  rank,
int  ivar 
) const
private

Returns the value of the measurement error (at rank if rank >= 0) or of the target (if rank < 0)

Parameters
[in]rankRank of the sample
[in]ivarRank of the variable

◆ _getWGTC()

double KrigingSystem::_getWGTC ( int  i,
int  jvCL 
) const
private

◆ _getWGTCAdd()

const double * KrigingSystem::_getWGTCAdd ( int  i = 0,
int  jvCL = 0 
) const
private

◆ _getZAM()

double KrigingSystem::_getZAM ( int  i) const
private

◆ _getZamAdd()

const double * KrigingSystem::_getZamAdd ( int  i = 0) const
private

◆ _getZEXT()

double KrigingSystem::_getZEXT ( int  i) const
private

◆ _getZextAdd()

const double * KrigingSystem::_getZextAdd ( int  i = 0) const
private

◆ _isAuthorized()

bool KrigingSystem::_isAuthorized ( )
private

Checks if the number of samples is compatible with the number of drift equations

Returns
Error: 1 if an error is found; 0 otherwise

◆ _isCorrect()

bool KrigingSystem::_isCorrect ( )
private

◆ _isMatCLempty()

bool KrigingSystem::_isMatCLempty ( ) const
private

◆ _krigingDump()

void KrigingSystem::_krigingDump ( int  status)
private

Print the results

Parameters
[in]statusKriging error status

◆ _lhsCalcul()

void KrigingSystem::_lhsCalcul ( )
private

Establish the kriging L.H.S.

◆ _lhsDump()

void KrigingSystem::_lhsDump ( int  nbypas = 5)
private

◆ _lhsInit()

void KrigingSystem::_lhsInit ( )
private

◆ _lhsInvert()

int KrigingSystem::_lhsInvert ( )
private

◆ _lhsIsoToHetero()

void KrigingSystem::_lhsIsoToHetero ( )
private

◆ _neighCalcul()

void KrigingSystem::_neighCalcul ( int  status,
const VectorDouble tab 
)
private

◆ _prepar()

int KrigingSystem::_prepar ( )
private

Define the array flag[] and the kriging L.H.S.

Returns
The status for the preparation

◆ _prepareForImage()

bool KrigingSystem::_prepareForImage ( const NeighImage neighI)
private

◆ _prepareForImageKriging()

bool KrigingSystem::_prepareForImageKriging ( Db dbaux,
const NeighImage neighI 
)
private

◆ _prodCOVTAB()

void KrigingSystem::_prodCOVTAB ( double  value)
private

◆ _resetMemoryGeneral()

void KrigingSystem::_resetMemoryGeneral ( )
private

◆ _resetMemoryPerNeigh()

void KrigingSystem::_resetMemoryPerNeigh ( )
private

◆ _rhsCalcul()

int KrigingSystem::_rhsCalcul ( )
private

Establish the kriging R.H.S

Remarks
When 'matCL' is provided, 'nvar' stands for the first dimension of
the matrix 'matCL' (its second dimension is equal to model->getNVar()).
Otherwise nvar designates model->getNVar()

◆ _rhsCalculBlock()

void KrigingSystem::_rhsCalculBlock ( )
private

Establish the kriging R.H.S (block)

◆ _rhsCalculDGM()

void KrigingSystem::_rhsCalculDGM ( )
private

Establish the kriging R.H.S (DGM case)

◆ _rhsCalculDrift()

void KrigingSystem::_rhsCalculDrift ( )
private

Establish the kriging R.H.S (Drift case)

◆ _rhsCalculPoint()

void KrigingSystem::_rhsCalculPoint ( )
private

Establish the kriging R.H.S (for Point Estimation)

◆ _rhsDump()

void KrigingSystem::_rhsDump ( )
private

◆ _rhsIsoToHetero()

void KrigingSystem::_rhsIsoToHetero ( )
private

◆ _rhsStore()

void KrigingSystem::_rhsStore ( int  iech)
private

◆ _saveWeights()

void KrigingSystem::_saveWeights ( int  status)
private

◆ _setFlag()

void KrigingSystem::_setFlag ( int  iech,
int  ivar,
int  value 
)
private

◆ _setInternalShortCutVariablesGeneral()

void KrigingSystem::_setInternalShortCutVariablesGeneral ( )
private

◆ _setInternalShortCutVariablesModel()

void KrigingSystem::_setInternalShortCutVariablesModel ( )
private

◆ _setInternalShortCutVariablesNeigh()

int KrigingSystem::_setInternalShortCutVariablesNeigh ( )
private

Assign the values to local variables used as shortcuts

Returns
1 if the number of active sample is zero

◆ _setLHS()

void KrigingSystem::_setLHS ( int  iech,
int  ivar,
int  jech,
int  jvar,
double  value,
bool  isForDrift = false 
)
private

Setting the LHS element

Parameters
iechRank of the first sample
ivarRank of the first variable
jechRank of the second sample
jvarRank of the second variable
valueAssigned value
isForDriftTrue is used to set the drift element
Remarks
: When used for setting a Drift element (say in 'i'), then:
: 'iech' is set for 'ib' (which must be within [0,nfeq[) and 'ivar' is set to 'nvar'

◆ _setLocalModel()

void KrigingSystem::_setLocalModel ( Model model)
private

This (internal) method is used to modify the Model locally Note: It also modifies the shortcut variables consequently

Parameters
modelPointer to the new model

◆ _setRHS()

void KrigingSystem::_setRHS ( int  iech,
int  ivar,
int  jvCL,
double  value,
bool  isForDrift = false 
)
private

◆ _setVAR0()

void KrigingSystem::_setVAR0 ( int  ivCL,
int  jvCL,
double  value 
)
private

◆ _setZEXT()

void KrigingSystem::_setZEXT ( int  i,
double  value 
) const
private

◆ _simulateCalcul()

void KrigingSystem::_simulateCalcul ( int  status)
private

Calculate the final conditional simulation

Parameters
[in]statusKriging error status

◆ _simulateDump()

void KrigingSystem::_simulateDump ( int  status)
private

◆ _transformGaussianToRaw()

void KrigingSystem::_transformGaussianToRaw ( )
private

Transform the Kriging results from gaussian to raw

Remarks
This procedure is designed for the monovariate case
It assumes that the kriging estimate and variance are already
calculated

◆ _variance()

double KrigingSystem::_variance ( int  ivarCL,
int  jvarCL 
)
private

Establish the calculation of variance or standard deviation

Parameters
[in]ivarCLRank of the target variable
[in]jvarCLRank of the auxiliary variable

◆ _variance0()

void KrigingSystem::_variance0 ( )
private

Establish the constant term for the variance calculation

◆ _wgtCalcul()

void KrigingSystem::_wgtCalcul ( )
private

◆ _wgtDump()

void KrigingSystem::_wgtDump ( int  status)
private

◆ _zextInit()

void KrigingSystem::_zextInit ( )
private

◆ conclusion()

void KrigingSystem::conclusion ( )

This method closes the use of a KrigingSystem sequence

◆ estimate()

int KrigingSystem::estimate ( int  iech_out)

Perform the Kriging of target

Parameters
iech_outRank of the target
Returns

◆ getLHS()

VectorDouble KrigingSystem::getLHS ( ) const
inline

◆ getLHSInv()

VectorDouble KrigingSystem::getLHSInv ( ) const
inline

◆ getLTerm()

double KrigingSystem::getLTerm ( ) const
inline

◆ getNDim()

int KrigingSystem::getNDim ( ) const

◆ getNech()

int KrigingSystem::getNech ( ) const

Returns the number of samples in the neighborhood

Returns
Number of samples
Remarks
If collocated option is switch ON, samples are alreadycount (rank < 0)

◆ getNeq()

int KrigingSystem::getNeq ( ) const

◆ getNRed()

int KrigingSystem::getNRed ( ) const
inline

◆ getRHSC() [1/2]

VectorDouble KrigingSystem::getRHSC ( ) const
inline

◆ getRHSC() [2/2]

VectorDouble KrigingSystem::getRHSC ( int  ivar) const

◆ getSampleCoordinates()

VectorVectorDouble KrigingSystem::getSampleCoordinates ( ) const

Returns the coordinates of the neighboring samples

Returns
Array organized by Coordinate (minor) then by Sample (major)

◆ getSampleData()

VectorDouble KrigingSystem::getSampleData ( ) const

◆ getSampleIndices()

VectorInt KrigingSystem::getSampleIndices ( ) const
inline

◆ getVariance()

VectorDouble KrigingSystem::getVariance ( ) const
inline

◆ getWeights()

VectorDouble KrigingSystem::getWeights ( ) const
inline

◆ getZam()

VectorDouble KrigingSystem::getZam ( ) const
inline

◆ isReady()

bool KrigingSystem::isReady ( )

Performs the last operations before launching the loop on Estimations

Returns

◆ operator=()

KrigingSystem& KrigingSystem::operator= ( const KrigingSystem m)
delete

◆ setFlagCheckAddress()

void KrigingSystem::setFlagCheckAddress ( bool  flagCheckAddress)
inline

◆ setKrigOptAnamophosis()

int KrigingSystem::setKrigOptAnamophosis ( AAnam anam)

Perform Gaussian Anamoprhosis kriging

Parameters
anamPointer to the AAnam structure
Returns

◆ setKrigOptBayes()

int KrigingSystem::setKrigOptBayes ( bool  flag_bayes,
const VectorDouble prior_mean,
const VectorDouble prior_cov,
int  seed = 414371 
)

◆ setKrigOptCalcul()

int KrigingSystem::setKrigOptCalcul ( const EKrigOpt &  calcul,
const VectorInt ndiscs = VectorInt(),
bool  flag_per_cell = false 
)

◆ setKrigoptCode()

int KrigingSystem::setKrigoptCode ( bool  flag_code)

Define the option for Kriging By Profile

Parameters
flag_codeTrue if the option is switched ON
Returns
Remarks
When the Option for Kriging By Profile is ON, the covariance term in LHS
is incremented by V(iech) when both samples 'iech' and 'jech' have
the same Code.

◆ setKrigOptColCok()

int KrigingSystem::setKrigOptColCok ( const VectorInt rank_colcok)

Check the consistency of the Colocation specification

Returns
Error return code
Parameters
[in]rank_colcokArray of ranks of colocated variables
Remarks
The array 'rank_colcok' (if present) must be dimensioned
to the number of variables in Dbin.
Each element gives the rank of the colocated variable within Dbout
or -1 if not colocated
If the array 'rank_colcok' is absent, colocation option is OFF.
In input, the numbering in ; rank_colcok' starts from 1
In output, the numbering starts from 0

◆ setKrigOptDataWeights()

int KrigingSystem::setKrigOptDataWeights ( int  iptrWeights,
bool  flagSet = true 
)

◆ setKrigOptDGM()

int KrigingSystem::setKrigOptDGM ( bool  flag_dgm,
double  eps = EPSILON6 
)

◆ setKrigOptFactorKriging()

int KrigingSystem::setKrigOptFactorKriging ( bool  flag_factor_kriging)

◆ setKrigOptFlagGlobal()

int KrigingSystem::setKrigOptFlagGlobal ( bool  flag_global)

◆ setKrigOptFlagLTerm()

int KrigingSystem::setKrigOptFlagLTerm ( bool  flag_lterm)

Ask for the specific calculation of Z * A-1 * Z

Parameters
flag_ltermFlag for asking this specific calculation
Returns
Remarks
The calculated value can be retrieved using _getLTerm() method

◆ setKrigOptFlagSimu()

int KrigingSystem::setKrigOptFlagSimu ( bool  flagSimu,
int  nbsimu = 0,
int  rankPGS = -1 
)

◆ setKrigOptImage()

int KrigingSystem::setKrigOptImage ( int  seed = 133271)

◆ setKrigOptMatCL()

int KrigingSystem::setKrigOptMatCL ( const VectorVectorDouble matCL)

Define the output as Linear Combinations of the Input Variables

Parameters
matCLVector of Vectors of weights (see remarks)
Returns
Remarks
The first dimension of 'matCL' is the number of Output variables
The second dimension is the number of input Variables.

◆ setKrigOptSaveWeights()

int KrigingSystem::setKrigOptSaveWeights ( bool  flag_save)

Switch the option for saving the Kriging Weights using Keypair mechanism

Parameters
flag_saveValue of the switch

◆ setKrigOptXValid()

int KrigingSystem::setKrigOptXValid ( bool  flag_xvalid,
bool  flag_kfold,
bool  optionXValidEstim = false,
bool  optionXValidStdev = false,
bool  optionXValidVarZ = false 
)

Set the flag for performing Cross-Validation

Parameters
flag_xvalidTrue if the Cross-Validation option is switched ON
flag_kfoldTrue if the KFold option is switch ON
optionXValidEstimTrue for Z*-Z; False for Z*
optionXValidStdevTrue for (Z*-Z)/S; False for S
optionXValidVarZTrue for Var(Z*)
Returns
Remarks
The KFold option requires a Code to be assigned to each Datum
In the Neighborhood search for a Target sample, some other data points
are discarded:
- either the Target sample itself (Leave-One-Point-Out) if KFold is False
- all samples with same code as Target if KFold is True

◆ updKrigOptEstim()

int KrigingSystem::updKrigOptEstim ( int  iptrEst,
int  iptrStd,
int  iptrVarZ 
)

Set the calculation options

Parameters
iptrEstUID for storing the estimation(s)
iptrStdUID for storing the Standard deviations(s)
iptrVarZUID for storing the Variance(s) of estimator
Returns
Remarks
If a term must not be calculated, its UID must be negative

◆ updKrigOptIclass()

int KrigingSystem::updKrigOptIclass ( int  index_class,
int  nclasses 
)

◆ updKrigOptNeighOnly()

int KrigingSystem::updKrigOptNeighOnly ( int  iptrNeigh)

Member Data Documentation

◆ _anam

const AAnam* KrigingSystem::_anam
private

◆ _calcModeLHS

CovCalcMode KrigingSystem::_calcModeLHS
private

◆ _calcModeRHS

CovCalcMode KrigingSystem::_calcModeRHS
private

◆ _calcModeVAR

CovCalcMode KrigingSystem::_calcModeVAR
private

◆ _calcul

EKrigOpt KrigingSystem::_calcul
private

Option for Calculation.

◆ _covref

MatrixSquareGeneral KrigingSystem::_covref
mutableprivate

◆ _covtab

MatrixSquareGeneral KrigingSystem::_covtab
mutableprivate

◆ _dbaux

DbGrid* KrigingSystem::_dbaux
private

◆ _dbin

Db* KrigingSystem::_dbin
private

◆ _dbinUidToBeDeleted

VectorInt KrigingSystem::_dbinUidToBeDeleted
mutableprivate

◆ _dbout

Db* KrigingSystem::_dbout
private

◆ _dboutUidToBeDeleted

VectorInt KrigingSystem::_dboutUidToBeDeleted
mutableprivate

◆ _disc1

VectorVectorDouble KrigingSystem::_disc1
private

◆ _disc2

VectorVectorDouble KrigingSystem::_disc2
private

◆ _drftab

VectorDouble KrigingSystem::_drftab
mutableprivate

◆ _flag

VectorInt KrigingSystem::_flag
mutableprivate

◆ _flagAnam

bool KrigingSystem::_flagAnam
private

Option for Gaussian Kriging.

◆ _flagBayes

bool KrigingSystem::_flagBayes
private

Option for Bayesian.

◆ _flagCheckAddress

bool KrigingSystem::_flagCheckAddress
mutableprivate

Working arrays.

◆ _flagCode

bool KrigingSystem::_flagCode
private

Options complement for neighborhood.

◆ _flagDataChanged

bool KrigingSystem::_flagDataChanged
private

◆ _flagDGM

bool KrigingSystem::_flagDGM
private

Option for Discrete Gaussian Model.

◆ _flagEst

bool KrigingSystem::_flagEst
private

◆ _flagFactorKriging

bool KrigingSystem::_flagFactorKriging
private

Option for (Disjunctive) Kriging of Factor.

◆ _flagGlobal

bool KrigingSystem::_flagGlobal
private

◆ _flagIsotopic

bool KrigingSystem::_flagIsotopic
private

◆ _flagKeypairWeights

bool KrigingSystem::_flagKeypairWeights
private

Option for saving the Weights using Keypair mechanism.

◆ _flagLTerm

bool KrigingSystem::_flagLTerm
private

Option for asking for Z * A-1 * Z.

◆ _flagNeighOnly

bool KrigingSystem::_flagNeighOnly
private

Option for Neighboring test.

◆ _flagPerCell

bool KrigingSystem::_flagPerCell
private

Option for Block estimation.

◆ _flagSet

bool KrigingSystem::_flagSet
private

◆ _flagSimu

bool KrigingSystem::_flagSimu
private

Option for Simulation.

◆ _flagStd

bool KrigingSystem::_flagStd
private

◆ _flagVarZ

bool KrigingSystem::_flagVarZ
private

◆ _flagWeights

bool KrigingSystem::_flagWeights
private

◆ _iechOut

int KrigingSystem::_iechOut
private

Local variables.

◆ _iptrEst

int KrigingSystem::_iptrEst
private

UID for storage.

◆ _iptrNeigh

int KrigingSystem::_iptrNeigh
private

◆ _iptrStd

int KrigingSystem::_iptrStd
private

◆ _iptrVarZ

int KrigingSystem::_iptrVarZ
private

◆ _iptrWeights

int KrigingSystem::_iptrWeights
private

Option for Weights at Data locations.

◆ _isReady

bool KrigingSystem::_isReady
private

◆ _lhs

VectorDouble KrigingSystem::_lhs
mutableprivate

◆ _lhsinv

VectorDouble KrigingSystem::_lhsinv
mutableprivate

◆ _lterm

double KrigingSystem::_lterm
private

◆ _matCL

VectorVectorDouble KrigingSystem::_matCL
private

Option for Estimating the Linear Combination of Variables.

◆ _model

Model* KrigingSystem::_model
private

◆ _modelInit

Model* KrigingSystem::_modelInit
private

◆ _modelSimple

Model* KrigingSystem::_modelSimple
private

◆ _nbfl

int KrigingSystem::_nbfl
private

◆ _nbgh

VectorInt KrigingSystem::_nbgh
mutableprivate

◆ _nbsimu

int KrigingSystem::_nbsimu
private

◆ _nclasses

int KrigingSystem::_nclasses
private

◆ _ndim

int KrigingSystem::_ndim
private

◆ _ndiscNumber

int KrigingSystem::_ndiscNumber
private

◆ _ndiscs

VectorInt KrigingSystem::_ndiscs
private

◆ _nech

int KrigingSystem::_nech
private

◆ _neigh

ANeigh* KrigingSystem::_neigh
private

◆ _neq

int KrigingSystem::_neq
private

◆ _nfeq

int KrigingSystem::_nfeq
private

◆ _nfex

int KrigingSystem::_nfex
private

◆ _nred

int KrigingSystem::_nred
private

◆ _nvar

int KrigingSystem::_nvar
private

◆ _nvarCL

int KrigingSystem::_nvarCL
private

◆ _optimEnabled

bool KrigingSystem::_optimEnabled
private

◆ _p0

SpacePoint KrigingSystem::_p0
mutableprivate

◆ _p0_memo

SpacePoint KrigingSystem::_p0_memo
mutableprivate

◆ _p1

SpacePoint KrigingSystem::_p1
mutableprivate

◆ _p2

SpacePoint KrigingSystem::_p2
mutableprivate

◆ _postCov

VectorDouble KrigingSystem::_postCov
private

◆ _postMean

VectorDouble KrigingSystem::_postMean
private

◆ _postSimu

VectorVectorDouble KrigingSystem::_postSimu
private

◆ _priorCov

VectorDouble KrigingSystem::_priorCov
private

◆ _priorMean

VectorDouble KrigingSystem::_priorMean
private

◆ _rankColCok

VectorInt KrigingSystem::_rankColCok
private

Option for Colocation.

◆ _rankPGS

int KrigingSystem::_rankPGS
private

◆ _rhs

VectorDouble KrigingSystem::_rhs
mutableprivate

◆ _seedForBayes

int KrigingSystem::_seedForBayes
private

◆ _seedForImage

int KrigingSystem::_seedForImage
private

Option for Estimation based on Image.

◆ _space

SpaceRN KrigingSystem::_space
mutableprivate

Some Space Point allocated once for all.

◆ _var0

MatrixSquareGeneral KrigingSystem::_var0
mutableprivate

◆ _varCorrec

VectorDouble KrigingSystem::_varCorrec
private

◆ _wgt

VectorDouble KrigingSystem::_wgt
mutableprivate

◆ _xvalidEstim

bool KrigingSystem::_xvalidEstim
private

Option for Cross_validation.

◆ _xvalidStdev

bool KrigingSystem::_xvalidStdev
private

◆ _xvalidVarZ

bool KrigingSystem::_xvalidVarZ
private

◆ _zam

VectorDouble KrigingSystem::_zam
mutableprivate

◆ _zext

VectorDouble KrigingSystem::_zext
mutableprivate

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