MeteoIODoc 20241221.207bde49
mio::OrdinaryKrigingAlgorithm Class Reference

Detailed Description

Ordinary kriging.

This implements ordinary krigging (see https://secure.wikimedia.org/wikipedia/en/wiki/Kriging) with user-selectable variogram model (see https://secure.wikimedia.org/wikipedia/en/wiki/Variogram). More details about the specific computation steps of kriging are provided in Interpol2D::ODKriging.

The variogram is currently computed with the current data (as ½*(X1-X2)²), which makes it quite uninteresting... However, calculating the covariances (used to build the variogram) from time series (thus reflecting the time-correlation between stations) has not brought any significant improvements, so it is currently not used (although implemented).

Please note that the variogram and krigging coefficients are re-computed fresh for each new grid (or time step). The available variogram models are found in Fit1D::regression and given as optional VARIO argument (by default, LINVARIO is used). Several models can be given, the first that can fit the data will be used for the current timestep:

TA::algorithms = ODKRIG
TA::odkrig::vario = SPHERICVARIO linvario

#include <ODKrigAlgorithm.h>

Public Member Functions

 OrdinaryKrigingAlgorithm (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm)
 
virtual double getQualityRating (const Date &i_date)
 
virtual void calculate (const DEMObject &dem, Grid2DObject &grid)
 
- Public Member Functions inherited from mio::InterpolationAlgorithm
 InterpolationAlgorithm (const std::vector< std::pair< std::string, std::string > > &, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm)
 
virtual ~InterpolationAlgorithm ()
 
virtual double getQualityRating (const Date &i_date)=0
 
virtual void calculate (const DEMObject &dem, Grid2DObject &grid)=0
 
std::string getInfo () const
 Return an information string about the interpolation process. More...
 

Protected Member Functions

std::vector< std::vector< double > > getTimeSeries (const bool &detrend_data) const
 
void getDataForEmpiricalVariogram (std::vector< double > &distData, std::vector< double > &variData) const
 
void getDataForVariogram (std::vector< double > &distData, std::vector< double > &variData, const bool &detrend_data=false) const
 
bool computeVariogram (const bool &detrend_data=false)
 
- Protected Member Functions inherited from mio::InterpolationAlgorithm
std::vector< double > getData (const Date &i_date, const std::string &i_param)
 
size_t getData (const Date &i_date, const std::string &i_param, std::vector< double > &o_vecData, std::vector< StationData > &o_vecMeta)
 

Protected Attributes

Fit1D variogram
 
std::vector< std::string > vario_types
 
- Protected Attributes inherited from mio::InterpolationAlgorithm
TimeSeriesManagertsmanager
 
Date date
 
std::vector< MeteoDatavecMeteo
 
std::vector< double > vecData
 store the measurement for the given parameter More...
 
std::vector< StationDatavecMeta
 store the station data for the given parameter More...
 
std::ostringstream info
 to store some extra information about the interplation process More...
 
const std::string param
 the parameter that we will interpolate More...
 
size_t nrOfMeasurments
 Number of stations that have been used, so this can be reported to the user. More...
 

Additional Inherited Members

- Public Attributes inherited from mio::InterpolationAlgorithm
const std::string algo
 

Constructor & Destructor Documentation

◆ OrdinaryKrigingAlgorithm()

mio::OrdinaryKrigingAlgorithm::OrdinaryKrigingAlgorithm ( const std::vector< std::pair< std::string, std::string > > &  vecArgs,
const std::string &  i_algo,
const std::string &  i_param,
TimeSeriesManager i_tsm 
)

Member Function Documentation

◆ calculate()

void mio::OrdinaryKrigingAlgorithm::calculate ( const DEMObject dem,
Grid2DObject grid 
)
virtual

◆ computeVariogram()

bool mio::OrdinaryKrigingAlgorithm::computeVariogram ( const bool &  detrend_data = false)
protected

◆ getDataForEmpiricalVariogram()

void mio::OrdinaryKrigingAlgorithm::getDataForEmpiricalVariogram ( std::vector< double > &  distData,
std::vector< double > &  variData 
) const
protected

◆ getDataForVariogram()

void mio::OrdinaryKrigingAlgorithm::getDataForVariogram ( std::vector< double > &  distData,
std::vector< double > &  variData,
const bool &  detrend_data = false 
) const
protected

◆ getQualityRating()

double mio::OrdinaryKrigingAlgorithm::getQualityRating ( const Date i_date)
virtual

◆ getTimeSeries()

std::vector< std::vector< double > > mio::OrdinaryKrigingAlgorithm::getTimeSeries ( const bool &  detrend_data) const
protected

Member Data Documentation

◆ vario_types

std::vector<std::string> mio::OrdinaryKrigingAlgorithm::vario_types
protected

◆ variogram

Fit1D mio::OrdinaryKrigingAlgorithm::variogram
protected

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