STK++ 0.9.13
Regression

The project Regress proposes a set of classes for computing usual linear and non-linear regressions. More...

Namespaces

namespace  STK::Regress
 This namespace encloses all variables and constant specific to the Regress project.
 

Classes

class  STK::AdditiveBSplineCoefficients< Array >
 Compute the regression splines coefficients of an additive model. More...
 
class  STK::AdditiveBSplineRegression< YArray, XArray, Weights >
 Compute an additive BSpline, multivalued, regression function using BSpline basis. More...
 
class  STK::IBasis< Data, Coefs >
 Interface base class for all basis function. More...
 
class  STK::IRegression< YArray, XArray, Weights >
 Interface base class for Regression methods. More...
 

Enumerations

enum  STK::Basis::TypeBasisFunction {
  STK::Basis::bspline_ , STK::Basis::sines_ , STK::Basis::cosines_ , STK::Basis::trigonometric_ ,
  STK::Basis::chebyshev_ , STK::Basis::unknown_basis_ = -1
}
 function basis function to use for functional and non-linear regression More...
 
enum  STK::Basis::KnotsPosition { STK::Basis::uniformKnotsPositions_ , STK::Basis::periodicKnotsPositions_ , STK::Basis::densityKnotsPositions_ , STK::Basis::unknown_Knots_Position_ = -1 }
 Method to use for positioning the knots in BSpline basis. More...
 
enum  STK::Regress::TypeBasisFunction {
  STK::Regress::unknown_basis_ = -1 , STK::Regress::bspline_ , STK::Regress::sines_ , STK::Regress::cosines_ ,
  STK::Regress::trigonometric_ , STK::Regress::chebyshev
}
 functional basis coefficients to use for fonctional and non-linear regression More...
 
enum  STK::Regress::TypeRegression { STK::Regress::unknown_regression_ = -1 , STK::Regress::linear_ , STK::Regress::additiveBSpline_ , STK::Regress::adaptiveBSpline_ }
 Regression method to use. More...
 
enum  STK::Regress::KnotsPosition { STK::Regress::uniformKnotsPositions_ , STK::Regress::periodicKnotsPositions_ , STK::Regress::densityKnotsPositions_ , STK::Regress::unknown_Knots_Position_ = -1 }
 Method to use for positioning the knots for BSpline basis. More...
 

Functions

KnotsPosition STK::Basis::stringToKnotsPosition (String const &type)
 convert a String to a KnotsPosition.
 
String STK::Basis::knotsPositionToString (KnotsPosition const &type)
 convert a KnotsPosition to a String.
 
TypeBasisFunction STK::Basis::stringToTypeBasisFunction (String const &type)
 convert a String to a TypeBasisFunction.
 
String STK::Basis::typeBasisFunctionToString (TypeBasisFunction const &type)
 convert a TypeBasisFunction to a String.
 
TypeRegression STK::Regress::stringToTypeRegression (String const &type)
 Convert a String to a TypeRegression.
 
String STK::Regress::typeRegressionToString (TypeRegression const &type)
 Convert a TypeRegression to a String.
 
String STK::Regress::knotsPositionToString (KnotsPosition const &type)
 convert a KnotsPosition to a String.
 

Detailed Description

The project Regress proposes a set of classes for computing usual linear and non-linear regressions.

In statistics, regression analysis includes any techniques for modeling and analyzing several variables, when the focus is on the relationship between a set of dependent variables and one or more independent variables. More specifically, regression analysis helps one understand how the typical values of the dependent variables changes when any one of the independent variables is varied, while the other independent variables are held fixed. Most commonly, regression analysis estimates the conditional expectation of the dependent variables given the independent variables — that is, the average value of the dependent variable when the independent variables are held fixed.

In regression analysis, it is also of interest to characterize the variation of the dependent variables around the regression function, which can be described by a probability distribution.

Regression analysis is widely used for prediction and forecasting, where its use has substantial overlap with the field of machine learning. Regression analysis is also used to understand which among the independent variables are related to the dependent variable, and to explore the forms of these relationships. In restricted circumstances, regression analysis can be used to infer causal relationships between the independent and dependent variables.

A large body of techniques for carrying out regression analysis has been developed. Familiar methods such as linear regression and ordinary least squares regression are parametric, in that the regression function is defined in terms of a finite number of unknown parameters that are estimated from the data. Nonparametric regression refers to techniques that allow the regression function to lie in a specified set of functions, which may be infinite-dimensional.

Enumeration Type Documentation

◆ KnotsPosition [1/2]

Method to use for positioning the knots in BSpline basis.

Enumerator
uniformKnotsPositions_ 

uniform knots

periodicKnotsPositions_ 

periodic knots

densityKnotsPositions_ 

knots using density of the data

unknown_Knots_Position_ 

unknown positions

Definition at line 72 of file STK_Basis_Util.h.

73{
78};
@ unknown_Knots_Position_
unknown positions
@ uniformKnotsPositions_
uniform knots
@ periodicKnotsPositions_
periodic knots
@ densityKnotsPositions_
knots using density of the data

◆ KnotsPosition [2/2]

Method to use for positioning the knots for BSpline basis.

Enumerator
uniformKnotsPositions_ 

uniform knots

periodicKnotsPositions_ 

periodic knots

densityKnotsPositions_ 

knots using density of the data

unknown_Knots_Position_ 

unknown positions

Definition at line 102 of file STK_Regress_Util.h.

◆ TypeBasisFunction [1/2]

function basis function to use for functional and non-linear regression

Enumerator
bspline_ 

BSpline basis.

Sines basis

sines_ 

cosines basis

cosines_ 

trigonometric basis (sines and cosines)

trigonometric_ 

Chebyshev basis.

chebyshev_ 

unknown basis

unknown_basis_ 

Definition at line 53 of file STK_Basis_Util.h.

54{
58 , sines_
60 , cosines_
66 , unknown_basis_ = -1
67};
@ trigonometric_
Chebyshev basis.
@ bspline_
BSpline basis.
@ cosines_
trigonometric basis (sines and cosines)
@ chebyshev_
unknown basis
@ sines_
cosines basis

◆ TypeBasisFunction [2/2]

functional basis coefficients to use for fonctional and non-linear regression

Enumerator
unknown_basis_ 

unknown coefficients

bspline_ 

Sines coefficients.

sines_ 

cosines coefficients

cosines_ 

trigonometric coefficients (sines and cosines)

trigonometric_ 

Chebyshev coefficients.

chebyshev 

Definition at line 54 of file STK_Regress_Util.h.

55{
59 , bspline_
61 , sines_
63 , cosines_
67 , chebyshev
68};

◆ TypeRegression

Regression method to use.

Enumerator
unknown_regression_ 

unknown regression

linear_ 

additive BSpline regression

additiveBSpline_ 

adaptive BSpline regression

adaptiveBSpline_ 

Definition at line 72 of file STK_Regress_Util.h.

73{
77 , linear_
82};
@ linear_
additive BSpline regression
@ unknown_regression_
unknown regression
@ additiveBSpline_
adaptive BSpline regression

Function Documentation

◆ knotsPositionToString() [1/2]

String STK::Basis::knotsPositionToString ( KnotsPosition const type)
inline

convert a KnotsPosition to a String.

Parameters
typethe KnotsPosition we want to convert to a string
Returns
the string associated to this KnotsPosition

Definition at line 129 of file STK_Basis_Util.h.

130{
131 if (type == uniformKnotsPositions_) return String(_T("uniform"));
132 if (type == periodicKnotsPositions_) return String(_T("periodic"));
133 if (type == densityKnotsPositions_) return String(_T("density"));
134 return String(_T("unknown"));
135}
#define _T(x)
Let x unmodified.
std::basic_string< Char > String
STK fundamental type of a String.

References _T, STK::Basis::densityKnotsPositions_, STK::Basis::periodicKnotsPositions_, and STK::Basis::uniformKnotsPositions_.

◆ knotsPositionToString() [2/2]

String STK::Regress::knotsPositionToString ( KnotsPosition const type)
inline

convert a KnotsPosition to a String.

Parameters
typethe KnotsPosition we want to convert to a string
Returns
the string associated to this KnotsPosition

Definition at line 145 of file STK_Regress_Util.h.

146{
147 if (type == uniformKnotsPositions_) return String(_T("uniform"));
148 if (type == periodicKnotsPositions_) return String(_T("periodic"));
149 if (type == densityKnotsPositions_) return String(_T("density"));
150 return String(_T("unknown"));
151}

References _T, STK::Regress::densityKnotsPositions_, STK::Regress::periodicKnotsPositions_, and STK::Regress::uniformKnotsPositions_.

◆ stringToKnotsPosition()

KnotsPosition STK::Basis::stringToKnotsPosition ( String const type)
inline

convert a String to a KnotsPosition.

Parameters
typethe type of KnotsPosition in a string
Returns
the KnotsPosition represented by the String type. If the string does not match any known name, the unknown_regression_ type is returned.

Definition at line 117 of file STK_Basis_Util.h.

118{
119 if (toUpperString(type) == toUpperString(_T("uniform"))) return uniformKnotsPositions_;
120 if (toUpperString(type) == toUpperString(_T("periodic"))) return periodicKnotsPositions_;
121 if (toUpperString(type) == toUpperString(_T("density"))) return densityKnotsPositions_;
123}
String const & toUpperString(String &s)
convert the characters of the String to upper case
Definition STK_String.h:134

References _T, STK::Basis::densityKnotsPositions_, STK::Basis::periodicKnotsPositions_, STK::toUpperString(), STK::Basis::uniformKnotsPositions_, and STK::Basis::unknown_Knots_Position_.

◆ stringToTypeBasisFunction()

TypeBasisFunction STK::Basis::stringToTypeBasisFunction ( String const type)
inline

convert a String to a TypeBasisFunction.

Parameters
typethe type of TypeBasisFunction in a string
Returns
the TypeBasisFunction represented by the String type. If the string does not match any known name, the unknown_basis_ type is returned.

Definition at line 143 of file STK_Basis_Util.h.

144{
145 if (toUpperString(type) == toUpperString(_T("bspline"))) return bspline_;
146 if (toUpperString(type) == toUpperString(_T("sines"))) return sines_;
147 if (toUpperString(type) == toUpperString(_T("cosines"))) return cosines_;
148 if (toUpperString(type) == toUpperString(_T("trigonometric"))) return trigonometric_;
149 if (toUpperString(type) == toUpperString(_T("chebyshev"))) return chebyshev_;
150 return unknown_basis_;
151}

References _T, STK::Basis::bspline_, STK::Basis::chebyshev_, STK::Basis::cosines_, STK::Basis::sines_, STK::toUpperString(), STK::Basis::trigonometric_, and STK::Basis::unknown_basis_.

◆ stringToTypeRegression()

TypeRegression STK::Regress::stringToTypeRegression ( String const type)
inline

Convert a String to a TypeRegression.

Parameters
typethe String we want to convert
Returns
the TypeRegression represented by the String type. if the string does not match any known name, the unknown_regression_ type is returned.

Definition at line 158 of file STK_Regress_Util.h.

159{
160 if (toUpperString(type) == toUpperString(_T("unknown"))) return unknown_regression_;
161 if (toUpperString(type) == toUpperString(_T("linear"))) return linear_;
162 if (toUpperString(type) == toUpperString(_T("additiveBSpline"))) return additiveBSpline_;
163 if (toUpperString(type) == toUpperString(_T("adaptiveBSpline"))) return adaptiveBSpline_;
164 return unknown_regression_;
165}

References _T, STK::Regress::adaptiveBSpline_, STK::Regress::additiveBSpline_, STK::Regress::linear_, STK::toUpperString(), and STK::Regress::unknown_regression_.

◆ typeBasisFunctionToString()

String STK::Basis::typeBasisFunctionToString ( TypeBasisFunction const type)
inline

convert a TypeBasisFunction to a String.

Parameters
typethe TypeBasisFunction we want to convert to a string
Returns
the string associated to this TypeBasisFunction

Definition at line 159 of file STK_Basis_Util.h.

160{
161 if (type == bspline_) return String(_T("bspline"));
162 if (type == sines_) return String(_T("sines"));
163 if (type == cosines_) return String(_T("cosines"));
164 if (type == trigonometric_) return String(_T("trigonometric"));
165 if (type == chebyshev_) return String(_T("chebyshev"));
166 return String(_T("unknown"));
167}

References _T, STK::Basis::bspline_, STK::Basis::chebyshev_, STK::Basis::cosines_, STK::Basis::sines_, and STK::Basis::trigonometric_.

◆ typeRegressionToString()

String STK::Regress::typeRegressionToString ( TypeRegression const type)
inline

Convert a TypeRegression to a String.

Parameters
typethe type of regression we want to convert
Returns
the string associated to this type.

Definition at line 171 of file STK_Regress_Util.h.

172{
173 if (type == linear_) return String(_T("linear"));
174 if (type == additiveBSpline_) return String(_T("additiveBSpline"));
175 if (type == adaptiveBSpline_) return String(_T("adaptiveBSpline"));
176 return String(_T("unknown"));
177}

References _T, STK::Regress::adaptiveBSpline_, STK::Regress::additiveBSpline_, and STK::Regress::linear_.