1.4.0
CCC
 
anam.cpp File Reference
#include "geoslib_old_f.h"
#include "Anamorphosis/AnamDiscrete.hpp"
#include "Anamorphosis/AnamDiscreteDD.hpp"
#include "Anamorphosis/AnamDiscreteIR.hpp"
#include "Anamorphosis/AnamHermite.hpp"
#include "Variogram/Vario.hpp"
#include "Polynomials/Hermite.hpp"
#include "Polynomials/MonteCarlo.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/Law.hpp"
#include "Db/Db.hpp"
#include "Stats/Selectivity.hpp"
#include <math.h>

Functions

int anam_point_to_block (AAnam *anam, int verbose, double cvv, double coeff, double mu)
 
static void st_correct_from_OK (Db *db, int iech, int col_est, int col_std, bool, double *krigest, double *krigstd)
 
static void st_ce_get_vectors (Db *db, int col_est, int col_std, bool flag_OK, VectorDouble &krigest, VectorDouble &krigstd)
 
static int st_ce_Z (Db *db, const AnamHermite *anam, const Selectivity *selectivity, int iptr0, int col_est, int col_std, int nbsimu, bool flag_OK)
 
static int st_ce_T (int mode, Db *db, const Selectivity *selectivity, int iptr0, int col_est, int col_std, const VectorDouble &ycuts, int nbsimu, bool flag_OK)
 
static int st_ce_quant (Db *db, const AnamHermite *anam, const Selectivity *selectivity, int iptr0, int col_est, int col_std, double proba, bool flag_OK)
 
static int st_ce_Q (Db *db, const AnamHermite *anam, const Selectivity *selectivity, int iptr0, int col_est, int col_std, const VectorDouble &ycuts, int nbsimu, bool flag_OK)
 
static int st_ce_B (Db *db, const Selectivity *selectivity, int iptr0, const VectorDouble &ycuts)
 
static int st_ce_M (Db *db, const Selectivity *selectivity, int iptr0)
 
int _conditionalExpectation (Db *db, AAnam *anam, const Selectivity *selectivity, int iptr0, int col_est, int col_std, bool flag_OK, double proba, int nbsimu)
 
int _uniformConditioning (Db *db, AnamHermite *anam, Selectivity *selectivity, int iptr0, int col_est, int col_var)
 

Function Documentation

◆ _conditionalExpectation()

int _conditionalExpectation ( Db db,
AAnam anam,
const Selectivity selectivity,
int  iptr0,
int  col_est,
int  col_std,
bool  flag_OK,
double  proba,
int  nbsimu 
)

Calculate the Conditional Expectation

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamAnamorphosis structure
[in]selectivitySelectivity structure
[in]iptr0Rank of the pointer for storage
[in]col_estRank of variable containing Kriging estimate
[in]col_stdRank of Variable containing Kriging St. deviation
[in]flag_OK1 if kriging has ben performed in Ordinary Kriging
[in]probaProbability
[in]nbsimuNumber of Simulation outcomes

◆ _uniformConditioning()

int _uniformConditioning ( Db db,
AnamHermite anam,
Selectivity selectivity,
int  iptr0,
int  col_est,
int  col_var 
)

Calculate the Uniform Conditioning

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamBlock Hermite anamorphosis
[in]selectivitySelectivity structure
[in]iptr0Pointer for storage
[in]col_estRank of variable containing Kriging estimate
[in]col_varRank of Variable containing Variance of Kriging estimate

◆ anam_point_to_block()

int anam_point_to_block ( AAnam anam,
int  verbose,
double  cvv,
double  coeff,
double  mu 
)

Transform a point anamorphosis into a block anamorphosis

Returns
Error return code
Parameters
[in]anamPoint anamorphosis -> Block anamorphosis [out]
[in]verboseVerbose option
[in]cvvBlock variance
[in]coeffCoefficient of change of support
[in]muAdditional coefficient for Discrete case
Remarks
If 'coeff' is provided, it is used directly ('cvv' is ignored)
Otherwise, it is derived from 'cvv'

◆ st_ce_B()

static int st_ce_B ( Db db,
const Selectivity selectivity,
int  iptr0,
const VectorDouble ycuts 
)
static

Calculate the Conventional Benefit by Conditional Expectation

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]selectivitySelectivity structure
[in]iptr0Starting storage address
[in]ycutsArray of the requested cutoffs

◆ st_ce_get_vectors()

static void st_ce_get_vectors ( Db db,
int  col_est,
int  col_std,
bool  flag_OK,
VectorDouble krigest,
VectorDouble krigstd 
)
static

Prepare the vectors of estimation and st. dev.

Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]col_estRank of the Kriging estimate
[in]col_stdRank of the St, Deviation of Kriging estimate
[in]flag_OK1 if kriging is performed with OK
[out]krigestVector of estamations
[out]krigstdVector of standard deviation

◆ st_ce_M()

static int st_ce_M ( Db db,
const Selectivity selectivity,
int  iptr0 
)
static

Calculate the Average Grade by Conditional Expectation

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]selectivitySelectivity structure
[in]iptr0Starting storage address

◆ st_ce_Q()

static int st_ce_Q ( Db db,
const AnamHermite anam,
const Selectivity selectivity,
int  iptr0,
int  col_est,
int  col_std,
const VectorDouble ycuts,
int  nbsimu,
bool  flag_OK 
)
static

Calculate the Metal Quantity by Conditional Expectation

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamHermite anamorphosis
[in]selectivitySelectivity structure
[in]iptr0Starting storage address
[in]col_estRank of the Kriging estimate
[in]col_stdRank of the St, Deviation of Kriging estimate
[in]ycutsArray of the requested cutoffs (gaussian scale)
[in]nbsimuNumber of Monte Carlo simulations (0: Hermite)
[in]flag_OK1 if kriging is performed with OK

◆ st_ce_quant()

static int st_ce_quant ( Db db,
const AnamHermite anam,
const Selectivity selectivity,
int  iptr0,
int  col_est,
int  col_std,
double  proba,
bool  flag_OK 
)
static

Calculate the Quantile by Conditional Expectation

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamHermite anamorphosis
[in]selectivitySelectivity structure
[in]iptr0Staring storage address
[in]col_estRank of the Kriging estimate
[in]col_stdRank of the Kriging St, Deviation
[in]probaProbability threshold
[in]flag_OK1 if kriging is performed with OK

◆ st_ce_T()

static int st_ce_T ( int  mode,
Db db,
const Selectivity selectivity,
int  iptr0,
int  col_est,
int  col_std,
const VectorDouble ycuts,
int  nbsimu,
bool  flag_OK 
)
static

Calculate the Tonnage by Conditional Expectation

Returns
Error return code
Parameters
[in]mode1 for T (Proba. above); 2 for Proba. below
[in]dbDb structure containing the factors (Z-locators)
[in]selectivitySelectivity structure
[in]iptr0Starting storage address
[in]col_estRank of the Kriging estimate
[in]col_stdRank of the St, Deviation of Kriging estimate
[in]ycutsVector of Gaussian cutoffs
[in]nbsimuNumber of Monte Carlo simulations (0: Hermite)
[in]flag_OK1 if kriging is performed with OK

◆ st_ce_Z()

static int st_ce_Z ( Db db,
const AnamHermite anam,
const Selectivity selectivity,
int  iptr0,
int  col_est,
int  col_std,
int  nbsimu,
bool  flag_OK 
)
static

Calculate the Conditional value and variance in the Gaussian Model

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]anamAnamorphosis Hermite
[in]selectivitySelectivity structure
[in]iptr0Starting storage address
[in]col_estRank of the Kriging estimate
[in]col_stdRank of the St, Deviation of Kriging estimate
[in]nbsimuNumber of Monte Carlo simulations (0: Hermite)
[in]flag_OK1 if kriging is performed with OK

◆ st_correct_from_OK()

static void st_correct_from_OK ( Db db,
int  iech,
int  col_est,
int  col_std,
bool  ,
double *  krigest,
double *  krigstd 
)
static

Correct the estimation and st. deviation of estimation if KO

Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]iechRank of the sample
[in]col_estRank of the Kriging estimate
[in]col_stdRank of the St, Deviation of Kriging estimate
[out]krigestKriging estimation
[out]krigstdStandard deviation of the estimation error
Remarks
In SK: krigstd returns the standard deviation of the estimation error
In OK: krigstd reads the square root of the estimation variance
and returns the standard deviation