gstlearn
1.0.0
CCC
|
#include <KrigingSystem.hpp>
Public Member Functions | |
KrigingSystem (Db *dbin, Db *dbout, const Model *model, ANeigh *neigh) | |
KrigingSystem (const KrigingSystem &m)=delete | |
KrigingSystem & | operator= (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 () |
|
delete |
|
virtual |
|
private |
|
private |
|
private |
Correct the array of Variance in Bayesian case
|
private |
Perform the Bayesian estimation of the Drift Coefficients (only in Unique Neighborhood)
|
private |
Simulate the drift coefficients from the posterior distributions
|
private |
|
private |
|
private |
Returns the additional variance for continuous moving neighborhood
[in] | rank1 | Rank of the sample in the first Db |
[in] | rank2 | Rank of the sample in the second Db |
[in] | eps | Distance tolerance |
|
private |
|
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)
iech1 | Rank of the first sample (or -1 for target) |
iech2 | Rank of the second sample (or -1 for target) |
mode | CovCalcMode structure |
flagSameData | True when both Data samples coincide |
|
private |
|
private |
Modify the covariance before calling the covariance evaluation This makes sense only when non-stationarity is defined
icas1 | 1 for dbin and 2 for Dbout |
iech1 | Rank of the first sample (or -1 for target) |
icas2 | 1 for dbin and 2 for Dbout |
iech2 | Rank of the second sample (or -1 for target) |
|
private |
|
private |
Extract the valid data Operate the product by the inverse covariance matrix
Warning; the array 'zext' is dimensioned to '_neq' instead of 'nred'
|
private |
Calculate the final estimation and storage
[in] | status | Kriging error status |
|
private |
|
private |
|
private |
Establish the variance of the estimator
[in] | ivarCL | Rank of the target variable |
[in] | jvarCL | Rank of the auxiliary variable |
|
private |
Define the array flag to convert from isotropic to heterotopic case Stores the reduced number of equations in member '_nred'
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Returns the value of the external drift "rank" (if rank >= 0) or of the target (if rank < 0)
[in] | rank | Rank of the sample |
[in] | ibfl | Rank of the external drift |
|
private |
|
private |
|
private |
|
private |
Returns the coordinate of the data (at rank if rank >= 0) or of the target (if rank < 0)
[in] | loc_rank | Rank of the sample |
[in] | idim | Rank of the coordinate |
|
private |
Returns the value of the variable (at rank if rank >= 0) or of the target (if rank < 0)
[in] | rank | Rank of the sample |
[in] | ivar | Rank of the variable |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Returns the value of the measurement error (at rank if rank >= 0) or of the target (if rank < 0)
[in] | rank | Rank of the sample |
[in] | ivar | Rank of the variable |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Checks if the number of samples is compatible with the number of drift equations
|
private |
|
private |
|
private |
Print the results
[in] | status | Kriging error status |
|
private |
Establish the kriging L.H.S.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Define the array flag[] and the kriging L.H.S.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Establish the kriging R.H.S
|
private |
Establish the kriging R.H.S (block)
|
private |
Establish the kriging R.H.S (DGM case)
|
private |
Establish the kriging R.H.S (Drift case)
|
private |
Establish the kriging R.H.S (for Point Estimation)
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Assign the values to local variables used as shortcuts
|
private |
Setting the LHS element
iech | Rank of the first sample |
ivar | Rank of the first variable |
jech | Rank of the second sample |
jvar | Rank of the second variable |
value | Assigned value |
isForDrift | True is used to set the drift element |
|
private |
This (internal) method is used to modify the Model locally Note: It also modifies the shortcut variables consequently
model | Pointer to the new model |
|
private |
|
private |
|
private |
|
private |
Calculate the final conditional simulation
[in] | status | Kriging error status |
|
private |
|
private |
Transform the Kriging results from gaussian to raw
|
private |
Establish the calculation of variance or standard deviation
[in] | ivarCL | Rank of the target variable |
[in] | jvarCL | Rank of the auxiliary variable |
|
private |
Establish the constant term for the variance calculation
|
private |
|
private |
|
private |
void KrigingSystem::conclusion | ( | ) |
This method closes the use of a KrigingSystem sequence
int KrigingSystem::estimate | ( | int | iech_out | ) |
Perform the Kriging of target
iech_out | Rank of the target |
|
inline |
|
inline |
|
inline |
int KrigingSystem::getNDim | ( | ) | const |
int KrigingSystem::getNech | ( | ) | const |
Returns the number of samples in the neighborhood
int KrigingSystem::getNeq | ( | ) | const |
|
inline |
|
inline |
VectorDouble KrigingSystem::getRHSC | ( | int | ivar | ) | const |
VectorVectorDouble KrigingSystem::getSampleCoordinates | ( | ) | const |
Returns the coordinates of the neighboring samples
VectorDouble KrigingSystem::getSampleData | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
bool KrigingSystem::isReady | ( | ) |
Performs the last operations before launching the loop on Estimations
|
delete |
|
inline |
int KrigingSystem::setKrigOptAnamophosis | ( | AAnam * | anam | ) |
int KrigingSystem::setKrigOptBayes | ( | bool | flag_bayes, |
const VectorDouble & | prior_mean, | ||
const VectorDouble & | prior_cov, | ||
int | seed = 414371 |
||
) |
int KrigingSystem::setKrigOptCalcul | ( | const EKrigOpt & | calcul, |
const VectorInt & | ndiscs = VectorInt() , |
||
bool | flag_per_cell = false |
||
) |
int KrigingSystem::setKrigoptCode | ( | bool | flag_code | ) |
Define the option for Kriging By Profile
flag_code | True if the option is switched ON |
int KrigingSystem::setKrigOptColCok | ( | const VectorInt & | rank_colcok | ) |
Check the consistency of the Colocation specification
[in] | rank_colcok | Array of ranks of colocated variables |
int KrigingSystem::setKrigOptDataWeights | ( | int | iptrWeights, |
bool | flagSet = true |
||
) |
int KrigingSystem::setKrigOptDGM | ( | bool | flag_dgm, |
double | eps = EPSILON6 |
||
) |
int KrigingSystem::setKrigOptFactorKriging | ( | bool | flag_factor_kriging | ) |
int KrigingSystem::setKrigOptFlagGlobal | ( | bool | flag_global | ) |
int KrigingSystem::setKrigOptFlagLTerm | ( | bool | flag_lterm | ) |
Ask for the specific calculation of Z * A-1 * Z
flag_lterm | Flag for asking this specific calculation |
int KrigingSystem::setKrigOptFlagSimu | ( | bool | flagSimu, |
int | nbsimu = 0 , |
||
int | rankPGS = -1 |
||
) |
int KrigingSystem::setKrigOptImage | ( | int | seed = 133271 | ) |
int KrigingSystem::setKrigOptMatCL | ( | const VectorVectorDouble & | matCL | ) |
Define the output as Linear Combinations of the Input Variables
matCL | Vector of Vectors of weights (see remarks) |
int KrigingSystem::setKrigOptSaveWeights | ( | bool | flag_save | ) |
Switch the option for saving the Kriging Weights using Keypair mechanism
flag_save | Value of the switch |
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
flag_xvalid | True if the Cross-Validation option is switched ON |
flag_kfold | True if the KFold option is switch ON |
optionXValidEstim | True for Z*-Z; False for Z* |
optionXValidStdev | True for (Z*-Z)/S; False for S |
optionXValidVarZ | True for Var(Z*) |
int KrigingSystem::updKrigOptEstim | ( | int | iptrEst, |
int | iptrStd, | ||
int | iptrVarZ | ||
) |
Set the calculation options
iptrEst | UID for storing the estimation(s) |
iptrStd | UID for storing the Standard deviations(s) |
iptrVarZ | UID for storing the Variance(s) of estimator |
int KrigingSystem::updKrigOptIclass | ( | int | index_class, |
int | nclasses | ||
) |
int KrigingSystem::updKrigOptNeighOnly | ( | int | iptrNeigh | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
Option for Calculation.
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
private |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
Option for Gaussian Kriging.
|
private |
Option for Bayesian.
|
mutableprivate |
Working arrays.
|
private |
Options complement for neighborhood.
|
private |
|
private |
Option for Discrete Gaussian Model.
|
private |
|
private |
Option for (Disjunctive) Kriging of Factor.
|
private |
|
private |
|
private |
Option for saving the Weights using Keypair mechanism.
|
private |
Option for asking for Z * A-1 * Z.
|
private |
Option for Neighboring test.
|
private |
Option for Block estimation.
|
private |
|
private |
Option for Simulation.
|
private |
|
private |
|
private |
|
private |
Local variables.
|
private |
UID for storage.
|
private |
|
private |
|
private |
|
private |
Option for Weights at Data locations.
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
Option for Estimating the Linear Combination of Variables.
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Option for Colocation.
|
private |
|
mutableprivate |
|
private |
|
private |
Option for Estimation based on Image.
|
mutableprivate |
Some Space Point allocated once for all.
|
mutableprivate |
|
private |
|
mutableprivate |
|
private |
Option for Cross_validation.
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |