gstlearn  1.0.0
CCC
SPDE Class Reference

#include <SPDE.hpp>

Public Member Functions

 SPDE (Model *model, const Db *domain, const Db *data=nullptr, const ESPDECalcMode &calcul=ESPDECalcMode::fromKey("SIMUCOND"), const AMesh *mesh=nullptr, int useCholesky=-1, SPDEParam params=SPDEParam(), bool verbose=false, bool showStats=false)
 
 SPDE (const SPDE &r)=delete
 
SPDEoperator= (const SPDE &r)=delete
 
virtual ~SPDE ()
 
int compute (Db *dbout, int nbsimu=1, int seed=131351, const NamingConvention &namconv=NamingConvention("spde"))
 
double computeLogDet (int nbsimu=1, int seed=1234) const
 
double computeQuad () const
 
double computeLogLike (int nbsimu=1, int seed=131323) const
 
double computeProfiledLogLike (int nbsimu=1, int seed=131323) const
 
VectorDouble getCoeffs ()
 
void setDriftCoeffs (VectorDouble coeffs)
 
const PrecisionOpCsgetPrecisionOpCs (int i=0) const
 
const ProjMatrixgetProjMatrix (int i=0) const
 
const PrecisionOpMultiConditionalgetPrecisionKrig () const
 
const AMeshgetMeshingKrig (int i=0) const
 
const AMeshgetMeshingSimu (int i=0) const
 
const DbgetData () const
 

Static Public Member Functions

static SPDEcreate (Model *model, const Db *domain, const Db *data=nullptr, const ESPDECalcMode &calcul=ESPDECalcMode::fromKey("SIMUCOND"), const AMesh *mesh=nullptr, int useCholesky=-1, SPDEParam params=SPDEParam(), bool verbose=false, bool showStats=false)
 

Private Member Functions

int _init (const Db *domain, const AMesh *mesh=nullptr, bool verbose=false, bool showStats=false)
 
void _centerByDrift (const VectorDouble &dataVect, int ivar=0, bool useSel=true) const
 
void _computeDriftCoeffs () const
 
void _purge ()
 
bool _isSimulationRequested () const
 
bool _isKrigingRequested () const
 
void _computeLk () const
 
void _computeKriging () const
 
void _computeSimuNonCond () const
 
void _computeSimuCond () const
 
void _addNuggetOnResult (VectorDouble &result)
 
void _addDrift (Db *db, VectorDouble &result, int ivar=0, bool useSel=true)
 
void _setUseCholesky (int useCholesky=-1, bool verbose=false)
 

Private Attributes

const Db_data
 
ESPDECalcMode _calcul
 
PrecisionOpMultiConditional_precisionsKrig
 
PrecisionOpMultiConditional_precisionsSimu
 
std::vector< PrecisionOp * > _pilePrecisions
 
std::vector< ProjMatrix * > _pileProjMatrix
 
std::vector< const AMesh * > _meshingSimu
 
std::vector< const AMesh * > _meshingKrig
 
VectorDouble _driftCoeffs
 
Model_model
 
VectorVectorDouble _workingKrig
 
VectorVectorDouble _workingSimu
 
VectorDouble _workingData
 
VectorDouble _workingDataInit
 
std::vector< ProjMatrix * > _projOnDbOut
 
VectorInt _adressesICov
 
double _nugget
 
VectorVectorDouble _driftTab
 
bool _requireCoeffs
 
bool _isCoeffsComputed
 
bool _deleteMesh
 
bool _useCholesky
 
SPDEParam _params
 

Detailed Description

The SPDE class provides the SPDE implementation of a univariate model defined by the sum of a nugget effect and Matern's models. Its main objectives are:

  • point kriging with or without linear drifts (SK, OK, KED, UK)
  • point simulations, conditional or non conditional
  • evaluation of the log likelihood of the model, in order to estimate the parameter using maximum likelihood

Constructor & Destructor Documentation

◆ SPDE() [1/2]

SPDE::SPDE ( Model model,
const Db domain,
const Db data = nullptr,
const ESPDECalcMode &  calcul = ESPDECalcMode::fromKey("SIMUCOND"),
const AMesh meshUser = nullptr,
int  useCholesky = -1,
SPDEParam  params = SPDEParam(),
bool  verbose = false,
bool  showStats = false 
)

The class constructor with the following arguments:

Parameters
modelThis compulsory argument is a LMC of Matern's (or Markov?) basic structures with possibly a nugget effect
domainThe Db defining the space dimension and spatial limits where the SPDE model is defined
dataThe Db containing the data for conditioning (optional)
calculOption from ESPDECalcMode
meshUserThe mesh for the discretization of the domain
useCholeskyDefine the choice regarding Cholesky
paramsSet of SPDE parameters
verboseVerbose flag
showStatsDisplay statistics for Linear Operations (when deleting the class)

Either Domain or a Mesh can be provided:

  • If a mesh is not provided, the domain is used to define optimal meshes for each structures and for at low/high resolution respectively. (High resolution meshes are used for simulations and low resolution meshes are used for kriging).
  • If a mesh is provided it is used for all structures and resolutions.

The domain or the mesh should have the same spatial reference (ndim, manifold) than the model.

◆ SPDE() [2/2]

SPDE::SPDE ( const SPDE r)
delete

◆ ~SPDE()

SPDE::~SPDE ( )
virtual

Member Function Documentation

◆ _addDrift()

void SPDE::_addDrift ( Db db,
VectorDouble result,
int  ivar = 0,
bool  useSel = true 
)
private

◆ _addNuggetOnResult()

void SPDE::_addNuggetOnResult ( VectorDouble result)
private

◆ _centerByDrift()

void SPDE::_centerByDrift ( const VectorDouble dataVect,
int  ivar = 0,
bool  useSel = true 
) const
private

◆ _computeDriftCoeffs()

void SPDE::_computeDriftCoeffs ( ) const
private

◆ _computeKriging()

void SPDE::_computeKriging ( ) const
private

◆ _computeLk()

void SPDE::_computeLk ( ) const
private

◆ _computeSimuCond()

void SPDE::_computeSimuCond ( ) const
private

Perform one conditional simulation on internal meshing The results (for each covariance item) are stored in _workingSimu'

◆ _computeSimuNonCond()

void SPDE::_computeSimuNonCond ( ) const
private

Perform one non-conditional simulation on internal meshing The results (for each covariance item) are stored in _workingSimu

◆ _init()

int SPDE::_init ( const Db domain,
const AMesh mesh = nullptr,
bool  verbose = false,
bool  showStats = false 
)
private

◆ _isKrigingRequested()

bool SPDE::_isKrigingRequested ( ) const
private

◆ _isSimulationRequested()

bool SPDE::_isSimulationRequested ( ) const
private

◆ _purge()

void SPDE::_purge ( )
private

◆ _setUseCholesky()

void SPDE::_setUseCholesky ( int  useCholesky = -1,
bool  verbose = false 
)
private

Define if Cholesky must be used or not

Parameters
useCholesky1 for YES; 0 for No; -1: set optimal default
verboseVerbose flag

◆ compute()

int SPDE::compute ( Db dbout,
int  nbsimu = 1,
int  seed = 131351,
const NamingConvention namconv = NamingConvention("spde") 
)

◆ computeLogDet()

double SPDE::computeLogDet ( int  nbsimu = 1,
int  seed = 1234 
) const

◆ computeLogLike()

double SPDE::computeLogLike ( int  nbsimu = 1,
int  seed = 131323 
) const

◆ computeProfiledLogLike()

double SPDE::computeProfiledLogLike ( int  nbsimu = 1,
int  seed = 131323 
) const

◆ computeQuad()

double SPDE::computeQuad ( ) const

◆ create()

SPDE * SPDE::create ( Model model,
const Db domain,
const Db data = nullptr,
const ESPDECalcMode &  calcul = ESPDECalcMode::fromKey("SIMUCOND"),
const AMesh mesh = nullptr,
int  useCholesky = -1,
SPDEParam  params = SPDEParam(),
bool  verbose = false,
bool  showStats = false 
)
static

◆ getCoeffs()

VectorDouble SPDE::getCoeffs ( )

◆ getData()

const Db* SPDE::getData ( ) const
inline

◆ getMeshingKrig()

const AMesh* SPDE::getMeshingKrig ( int  i = 0) const
inline

◆ getMeshingSimu()

const AMesh* SPDE::getMeshingSimu ( int  i = 0) const
inline

◆ getPrecisionKrig()

const PrecisionOpMultiConditional* SPDE::getPrecisionKrig ( ) const
inline

◆ getPrecisionOpCs()

const PrecisionOpCs* SPDE::getPrecisionOpCs ( int  i = 0) const
inline

◆ getProjMatrix()

const ProjMatrix* SPDE::getProjMatrix ( int  i = 0) const
inline

◆ operator=()

SPDE& SPDE::operator= ( const SPDE r)
delete

◆ setDriftCoeffs()

void SPDE::setDriftCoeffs ( VectorDouble  coeffs)

Member Data Documentation

◆ _adressesICov

VectorInt SPDE::_adressesICov
private

◆ _calcul

ESPDECalcMode SPDE::_calcul
private

◆ _data

const Db* SPDE::_data
private

◆ _deleteMesh

bool SPDE::_deleteMesh
private

◆ _driftCoeffs

VectorDouble SPDE::_driftCoeffs
mutableprivate

◆ _driftTab

VectorVectorDouble SPDE::_driftTab
private

◆ _isCoeffsComputed

bool SPDE::_isCoeffsComputed
mutableprivate

◆ _meshingKrig

std::vector<const AMesh*> SPDE::_meshingKrig
private

◆ _meshingSimu

std::vector<const AMesh*> SPDE::_meshingSimu
private

◆ _model

Model* SPDE::_model
private

◆ _nugget

double SPDE::_nugget
private

◆ _params

SPDEParam SPDE::_params
private

◆ _pilePrecisions

std::vector<PrecisionOp*> SPDE::_pilePrecisions
private

◆ _pileProjMatrix

std::vector<ProjMatrix*> SPDE::_pileProjMatrix
private

◆ _precisionsKrig

PrecisionOpMultiConditional* SPDE::_precisionsKrig
private

◆ _precisionsSimu

PrecisionOpMultiConditional* SPDE::_precisionsSimu
private

◆ _projOnDbOut

std::vector<ProjMatrix*> SPDE::_projOnDbOut
private

◆ _requireCoeffs

bool SPDE::_requireCoeffs
private

◆ _useCholesky

bool SPDE::_useCholesky
private

◆ _workingData

VectorDouble SPDE::_workingData
mutableprivate

◆ _workingDataInit

VectorDouble SPDE::_workingDataInit
mutableprivate

◆ _workingKrig

VectorVectorDouble SPDE::_workingKrig
mutableprivate

◆ _workingSimu

VectorVectorDouble SPDE::_workingSimu
mutableprivate

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