|
gstlearn
0.2.1
Geostatistics & Machine Learning toolbox
|
#include <KrigingSystem.hpp>
Public Member Functions | |
| KrigingSystem (Db *dbin, Db *dbout, const Model *model, ANeighParam *neighParam) | |
| 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 | 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 | updKrigOptCheckAddress (bool flagCheckAddress) |
| int | updKrigOptNeighOnly (int iptrNeigh) |
| bool | isReady () |
| int | estimate (int iech_out) |
| int | getNDim () const |
| int | getNech () const |
| int | getNeq () const |
| int | getNRed () const |
| VectorInt | getSampleIndices () const |
| VectorDouble | 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 | _getCoefDrift (int ivar, int il, int ib) const |
| void | _getDistance (int loc_rank1, int loc_rank2, VectorDouble &dd) const |
| int | _IND (int iech, int ivar, int nech) const |
| int | _getFLAG (int iech, int ivar) const |
| double | _getCOVTAB (int ivar, int jvar) const |
| void | _setCOVTAB (int ivar, int jvar, double value) |
| void | _addCOVTAB (int ivar, int jvar, double value) |
| void | _prodCOVTAB (int ivar, int jvar, 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) |
| void | _prodLHS (int iech, int ivar, int jech, int jvar, double value) |
| double | _getLHSC (int i, int j) const |
| double | _getDISC1 (int idisc, int idim) const |
| void | _setDISC1 (int idisc, int idim, double value) |
| double | _getDISC2 (int idisc, int idim) const |
| void | _setDISC2 (int idisc, int idim, double value) |
| double | _getVAR0 (int ivCL, int jvCL) const |
| void | _setVAR0 (int ivCL, int jvCL, double value) |
| void | _resetMemoryPerNeigh () |
| void | _resetMemoryGeneral () |
| void | _flagDefine () |
| void | _covtabInit () |
| void | _covtabCalcul (const ECalcMember &member, const CovCalcMode &mode, int iech1, int iech2, const VectorDouble &d1) |
| void | _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 | _rhsIsoToHetero () |
| void | _rhsDump () |
| void | _wgtCalcul () |
| void | _wgtDump (int status) |
| VectorInt | _getRelativePosition () |
| int | _lhsInvert () |
| void | _dual () |
| 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) |
| int | _bayesPreCalculations () |
| void | _bayesPreSimulate () |
| void | _bayesCorrectVariance () |
| void | _transformGaussianToRaw () |
| int | _getFlagAddress (int iech0, int ivar0) |
| bool | _isMatCLempty () const |
| KrigingSystem::KrigingSystem | ( | Db * | dbin, |
| Db * | dbout, | ||
| const Model * | model, | ||
| ANeighParam * | neighParam | ||
| ) |
|
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 |
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)
| member | Type of usage (LHS, RHS or VAR) |
| mode | CovCalcMode structure |
| iech1 | Rank of the first sample (or -1) |
| iech2 | Rank of the second sample (or -1) |
| d1 |
|
private |
|
private |
|
private |
Extract the valid data Operate the product by the inverse covariance matrix
|
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 |
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 |
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 |
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 |
Define the array flag[] and the kriging L.H.S.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Establish the kriging R.H.S
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
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 |
|
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 |
| 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 |
| VectorDouble 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 |
| int KrigingSystem::setKrigOptAnamophosis | ( | AAnam * | anam | ) |
| int KrigingSystem::setKrigOptBayes | ( | bool | flag_bayes, |
| const VectorDouble & | prior_mean, | ||
| const VectorDouble & | prior_cov | ||
| ) |
| 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::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::updKrigOptCheckAddress | ( | bool | flagCheckAddress | ) |
This function switches ON the systematic test of addresses before running
| flagCheckAddress | True if addresses must be systematically checked |
| 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 |
Option for Calculation.
|
mutableprivate |
|
private |
Option for Estimation based on Image.
|
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 |
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 |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Option for Colocation.
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
mutableprivate |
|
private |
Option for Cross_validation.
|
private |
|
private |
|
mutableprivate |