gstlearn  1.0.0
CCC
Regression.hpp File Reference
#include "gstlearn_export.hpp"
#include "Basic/AStringable.hpp"
#include "geoslib_define.h"

Classes

class  Regression
 

Functions

GSTLEARN_EXPORT Regression regression (Db *db1, const String &nameResp, const VectorString &nameAux=VectorString(), int mode=0, bool flagCst=false, Db *db2=nullptr, const Model *model=nullptr)
 
GSTLEARN_EXPORT VectorDouble regressionDeming (const VectorDouble &x, const VectorDouble &y, double delta=1)
 

Function Documentation

◆ regression()

GSTLEARN_EXPORT Regression regression ( Db db1,
const String nameResp,
const VectorString nameAux,
int  mode,
bool  flagCst,
Db db2,
const Model model 
)

Evaluate the regression

Returns
Error return code
Parameters
[in,out]db1Db descriptor (for target variable)
[in]nameRespName of the target variable
[in]nameAuxVector of names of the explanatory variables
[in]modeType of calculation
  • 0 : standard multivariate case
  • 1 : using external drifts
  • 2 : using standard drift functions (in 'model')
[in]flagCstThe constant is added as explanatory variable
[in]db2Db descriptor (for auxiliary variables)
[in]modelModel (only used for Drift functions if mode==2)
Remarks
The flag_mode indicates the type of regression calculation:
0 : V[icol] as a function of V[icols[i]]
1 : Z1 as a function of the different Fi's

◆ regressionDeming()

GSTLEARN_EXPORT VectorDouble regressionDeming ( const VectorDouble x,
const VectorDouble y,
double  delta 
)

Calculate the coefficients of the Deming regression (with 2 variables)

Parameters
xVector for the first variable
yVector for the second variable
deltaratio of error variances (s_y^2 / s_x^2)
Returns
Vector of coefficients for the equation
y = beta[0] + beta[1] * x
Remarks
Both input vectors are assumed to contain valid values
From: https://en.wikipedia.org/wiki/Deming_regression