UQTk: Uncertainty Quantification Toolkit 3.1.5
Lreg Class Reference

Class for linear parameteric regression. More...

#include <lreg.h>

Inheritance diagram for Lreg:
PCreg PLreg RBFreg

Public Member Functions

 Lreg ()
 Constructor.
 
 ~Lreg ()
 Destrcutor.
 
virtual void SetMindex (Array2D< int > &mindex)
 Set multiindex.
 
virtual void GetMindex (Array2D< int > &mindex)
 Get multiindex.
 
virtual void SetCenters (Array2D< double > &centers)
 Set centers (for RBF)
 
virtual void SetWidths (Array1D< double > &widths)
 Set widths (for RBF)
 
virtual void SetParamsRBF ()
 Set parameters (for RBF)
 
virtual void EvalBases (Array2D< double > &xx, Array2D< double > &bb)
 Evaluate bases.
 
virtual void StripBases (Array1D< int > &used)
 Strip bases.
 
void InitRegr ()
 Initialize.
 
void SetupData (Array2D< double > &xdata, Array1D< double > &ydata)
 Setup data (1d ydata)
 
void SetupData (Array2D< double > &xdata, Array2D< double > &ydata)
 Setup data (2d ydata)
 
void SetRegMode (string regmode)
 Set the regression mode.
 
void SetRegWeights (Array1D< double > &weights)
 Set weights.
 
void BCS_BuildRegr (Array1D< int > &selected, double eta)
 Build BCS regression.
 
void LSQ_BuildRegr ()
 Build LSQ regression.
 
void EvalRegr (Array2D< double > &xcheck, Array1D< double > &ycheck, Array1D< double > &yvar, Array2D< double > &ycov)
 Evaluate the regression expansion.
 
int GetNpt () const
 Get the number of points.
 
int GetNdim () const
 Get dimensionality.
 
int GetNbas () const
 Get the number of bases.
 
double GetSigma2 () const
 Get the variance of the data.
 
void GetCoefCov (Array2D< double > &coef_cov)
 Get coefficient covariance.
 
void GetCoef (Array1D< double > &coef)
 Get coefficients.
 
void Proj (Array1D< double > &array, Array1D< double > &proj_array)
 Project.
 
Array1D< double > LSQ_computeBestLambdas ()
 Compute the best values for regulariation parameter vector lambda, for LSQ.
 
double LSQ_computeBestLambda ()
 Compute the best value for regulariation parameter lambda, for LSQ.
 
void getResid ()
 Compute the residual vector, if not already computed.
 
void getDiagP ()
 Compute the diagonal of projection matrix, if not already computed.
 
Array1D< double > computeErrorMetrics (string method)
 Compote error according to a selected metrics.
 
double computeRVE (Array2D< double > &xval, Array1D< double > &yval, Array1D< double > &yval_regr)
 Compute validation error.
 

Protected Attributes

Array2D< double > xdata_
 xdata array
 
Array1D< double > ydata_
 ydata array
 
int npt_
 Number of samples.
 
int nbas_
 Number of bases.
 
int ndim_
 Dimensionality.
 
Array1D< double > sigma2_
 Variance.
 
Array1D< double > weights_
 Weights.
 
Array1D< double > resid_
 Residuals.
 
bool residFlag_
 Flag to indicate whether residual is computed.
 
Array1D< double > diagP_
 Diagonal of projection matrix.
 
bool diagPFlag_
 Flag to indicate whether diagonal of projetion matrix is computed.
 
Array2D< double > bdata_
 Auxiliary matrix or vector; see UQTk Manual.
 
Array2D< double > A_
 
Array2D< double > A_inv_
 
Array2D< double > coef_cov_
 
Array1D< double > Hty_
 
Array1D< double > coef_
 
Array1D< double > coef_erb_
 

Private Member Functions

double LSQ_computeLOO ()
 Compute Leave-one-out error for LSQ.
 
double LSQ_computeGCV ()
 COmpute generalized-cross-validation error for LSQ.
 

Private Attributes

bool dataSetFlag_
 Flag to indicate whether data has been set or not.
 
string regMode_
 Regression mode (m, ms, msc for mean-only, mean+variance, mean+covariance)
 

Detailed Description

Class for linear parameteric regression.

Constructor & Destructor Documentation

◆ Lreg()

Lreg::Lreg ( )
inline

Constructor.

◆ ~Lreg()

Lreg::~Lreg ( )
inline

Destrcutor.

Member Function Documentation

◆ BCS_BuildRegr()

void Lreg::BCS_BuildRegr ( Array1D< int > & selected,
double eta )

Build BCS regression.

◆ computeErrorMetrics()

Array1D< double > Lreg::computeErrorMetrics ( string method)

Compote error according to a selected metrics.

◆ computeRVE()

double Lreg::computeRVE ( Array2D< double > & xval,
Array1D< double > & yval,
Array1D< double > & yval_regr )

Compute validation error.

◆ EvalBases()

virtual void Lreg::EvalBases ( Array2D< double > & xx,
Array2D< double > & bb )
inlinevirtual

Evaluate bases.

Reimplemented in PCreg, PLreg, and RBFreg.

◆ EvalRegr()

void Lreg::EvalRegr ( Array2D< double > & xcheck,
Array1D< double > & ycheck,
Array1D< double > & yvar,
Array2D< double > & ycov )

Evaluate the regression expansion.

◆ GetCoef()

void Lreg::GetCoef ( Array1D< double > & coef)
inline

Get coefficients.

◆ GetCoefCov()

void Lreg::GetCoefCov ( Array2D< double > & coef_cov)
inline

Get coefficient covariance.

◆ getDiagP()

void Lreg::getDiagP ( )

Compute the diagonal of projection matrix, if not already computed.

◆ GetMindex()

virtual void Lreg::GetMindex ( Array2D< int > & mindex)
inlinevirtual

Get multiindex.

Reimplemented in PCreg, and PLreg.

◆ GetNbas()

int Lreg::GetNbas ( ) const
inline

Get the number of bases.

◆ GetNdim()

int Lreg::GetNdim ( ) const
inline

Get dimensionality.

◆ GetNpt()

int Lreg::GetNpt ( ) const
inline

Get the number of points.

◆ getResid()

void Lreg::getResid ( )

Compute the residual vector, if not already computed.

◆ GetSigma2()

double Lreg::GetSigma2 ( ) const
inline

Get the variance of the data.

◆ InitRegr()

void Lreg::InitRegr ( )

Initialize.

◆ LSQ_BuildRegr()

void Lreg::LSQ_BuildRegr ( )

Build LSQ regression.

◆ LSQ_computeBestLambda()

double Lreg::LSQ_computeBestLambda ( )

Compute the best value for regulariation parameter lambda, for LSQ.

◆ LSQ_computeBestLambdas()

Array1D< double > Lreg::LSQ_computeBestLambdas ( )

Compute the best values for regulariation parameter vector lambda, for LSQ.

◆ LSQ_computeGCV()

double Lreg::LSQ_computeGCV ( )
private

COmpute generalized-cross-validation error for LSQ.

◆ LSQ_computeLOO()

double Lreg::LSQ_computeLOO ( )
private

Compute Leave-one-out error for LSQ.

◆ Proj()

void Lreg::Proj ( Array1D< double > & array,
Array1D< double > & proj_array )

Project.

◆ SetCenters()

virtual void Lreg::SetCenters ( Array2D< double > & centers)
inlinevirtual

Set centers (for RBF)

Reimplemented in RBFreg.

◆ SetMindex()

virtual void Lreg::SetMindex ( Array2D< int > & mindex)
inlinevirtual

Set multiindex.

Reimplemented in PCreg, and PLreg.

◆ SetParamsRBF()

virtual void Lreg::SetParamsRBF ( )
inlinevirtual

Set parameters (for RBF)

◆ SetRegMode()

void Lreg::SetRegMode ( string regmode)
inline

Set the regression mode.

◆ SetRegWeights()

void Lreg::SetRegWeights ( Array1D< double > & weights)

Set weights.

◆ SetupData() [1/2]

void Lreg::SetupData ( Array2D< double > & xdata,
Array1D< double > & ydata )

Setup data (1d ydata)

◆ SetupData() [2/2]

void Lreg::SetupData ( Array2D< double > & xdata,
Array2D< double > & ydata )

Setup data (2d ydata)

◆ SetWidths()

virtual void Lreg::SetWidths ( Array1D< double > & widths)
inlinevirtual

Set widths (for RBF)

Reimplemented in RBFreg.

◆ StripBases()

virtual void Lreg::StripBases ( Array1D< int > & used)
inlinevirtual

Strip bases.

Reimplemented in PCreg, PLreg, and RBFreg.

Member Data Documentation

◆ A_

Array2D<double> Lreg::A_
protected

◆ A_inv_

Array2D<double> Lreg::A_inv_
protected

◆ bdata_

Array2D<double> Lreg::bdata_
protected

Auxiliary matrix or vector; see UQTk Manual.

◆ coef_

Array1D<double> Lreg::coef_
protected

◆ coef_cov_

Array2D<double> Lreg::coef_cov_
protected

◆ coef_erb_

Array1D<double> Lreg::coef_erb_
protected

◆ dataSetFlag_

bool Lreg::dataSetFlag_
private

Flag to indicate whether data has been set or not.

◆ diagP_

Array1D<double> Lreg::diagP_
protected

Diagonal of projection matrix.

◆ diagPFlag_

bool Lreg::diagPFlag_
protected

Flag to indicate whether diagonal of projetion matrix is computed.

◆ Hty_

Array1D<double> Lreg::Hty_
protected

◆ nbas_

int Lreg::nbas_
protected

Number of bases.

◆ ndim_

int Lreg::ndim_
protected

Dimensionality.

◆ npt_

int Lreg::npt_
protected

Number of samples.

◆ regMode_

string Lreg::regMode_
private

Regression mode (m, ms, msc for mean-only, mean+variance, mean+covariance)

◆ resid_

Array1D<double> Lreg::resid_
protected

Residuals.

◆ residFlag_

bool Lreg::residFlag_
protected

Flag to indicate whether residual is computed.

◆ sigma2_

Array1D<double> Lreg::sigma2_
protected

Variance.

◆ weights_

Array1D<double> Lreg::weights_
protected

Weights.

◆ xdata_

Array2D<double> Lreg::xdata_
protected

xdata array

◆ ydata_

Array1D<double> Lreg::ydata_
protected

ydata array


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