UQTk: Uncertainty Quantification Toolkit 3.1.5
Gproc Class Reference

Class for Gaussian processes. More...

#include <gproc.h>

Public Member Functions

 Gproc (const string covtype, PCSet *PCModel, Array1D< double > &param)
 Constructor: initialize with covariance type, trend function basis and roughness parameter vector.
 
 ~Gproc ()
 Destructor: cleans up all memory and destroys object.
 
void SetupPrior ()
 Setup the prior.
 
void SetupData (Array2D< double > &xdata, Array1D< double > &ydata, Array1D< double > &datavar)
 Setup the data.
 
void setCorrParam (Array1D< double > param)
 Set the roughness parameter vector.
 
void BuildGP ()
 Build Gaussian Process regressor, i.e. compute internally all necessary matrices and vectors that describe the posterior GP.
 
void BuildGP_inv ()
 Build Gaussian Process regressor, i.e. compute internally all necessary matrices and vectors that describe the posterior GP.
 
void EvalGP (Array2D< double > &xgrid, string msc, Array1D< double > &mst)
 Evaluate the Gaussian Process at a given grid msc controls whether only mean will be computed, or standard devation and covariance as well.
 
void EvalGP_inv (Array2D< double > &xgrid, string msc, Array1D< double > &mst)
 Evaluate the Gaussian Process at a given grid msc controls whether only mean will be computed, or standard devation and covariance as well.
 
int getNpt () const
 Get the number of data points.
 
int getNdim () const
 Get the dimensionality.
 
int getNPC () const
 Get the number of basis terms in the trend.
 
double getAl () const
 Get alpha parameter.
 
double getBe () const
 Get beta parameter.
 
double getSig2hat () const
 Get Sigma-hat-squared, i.e. the posterior variance factor.
 
void getVst (Array2D< double > &vst)
 Get $V^*$, an auxiliary matrix.
 
void getA (Array2D< double > &acor)
 Get the correlation matrix $A$.
 
void getParam (Array1D< double > &param)
 Get the roughness parameters.
 
void getCov (Array2D< double > &cov)
 Get the posterior covariance matrix.
 
void getVar (Array1D< double > &var)
 Get the posterior variance vector.
 
void getXYCov (Array2D< double > &xgrid, Array2D< double > &xycov)
 Get the covariance in a different format, with the x,x' values.
 
void getSttPars (Array1D< double > &sttmat)
 Get the Student-t parameters.
 
void findBestCorrParam ()
 Function to find the best values for roughness parameters.
 

Private Member Functions

double covariance (Array1D< double > &x1, Array1D< double > &x2, Array1D< double > &param)
 Prior covariance function.
 
void computeDataCov_ (Array2D< double > &xdata, Array1D< double > &param, Array2D< double > &A)
 Compute the data covariance $A$.
 

Private Attributes

Array2D< double > xdata_
 xdata array
 
Array1D< double > ydata_
 ydata array
 
Array1D< double > dataVar_
 Data noise 'nugget'.
 
int npc_
 Number of bases in the mean trend.
 
Array2D< double > Vinv_
 Inverse of the mean trend coefficient prior covariance.
 
Array1D< double > z_
 Prior mean of the mean trend.
 
double al_
 Prior parameter $\alpha$.
 
double be_
 Prior parameter $\beta$.
 
double sig2hat_
 Posterior variance factor.
 
int npt_
 Number of data points.
 
int ndim_
 Dimensionality.
 
string covType_
 Covariance type, only 'SqExp' implemented so far.
 
PCSetPCModel_
 Basis set for the trend function.
 
Array1D< double > mst_
 Mean of the Student-t posterior.
 
Array1D< double > var_
 Variance of the Student-t posterior.
 
Array2D< double > cov_
 Covariance of the Student-t posterior.
 
Array1D< double > param_
 Roughness parameter vector.
 
Array2D< double > H_
 Auxiliary matrices or vectors, see the UQTk Manual.
 
Array2D< double > Ht_
 
Array2D< double > A_
 
Array2D< double > Ainv_
 
Array1D< double > Ainvd_
 
Array1D< double > Vinvz_
 
Array1D< double > HtAinvd_
 
Array2D< double > AinvH_
 
Array2D< double > HtAinvH_
 
Array2D< double > Vst_
 
Array1D< double > bhat_
 
Array1D< double > Hbhat_
 
Array1D< double > yHbhat_
 
Array1D< double > AinvyHbhat_
 
Array2D< double > Vstinv_
 

Detailed Description

Class for Gaussian processes.

Constructor & Destructor Documentation

◆ Gproc()

Gproc::Gproc ( const string covtype,
PCSet * PCModel,
Array1D< double > & param )

Constructor: initialize with covariance type, trend function basis and roughness parameter vector.

◆ ~Gproc()

Gproc::~Gproc ( )
inline

Destructor: cleans up all memory and destroys object.

Member Function Documentation

◆ BuildGP()

void Gproc::BuildGP ( )

Build Gaussian Process regressor, i.e. compute internally all necessary matrices and vectors that describe the posterior GP.

◆ BuildGP_inv()

void Gproc::BuildGP_inv ( )

Build Gaussian Process regressor, i.e. compute internally all necessary matrices and vectors that describe the posterior GP.

Note
This is an older implementation with explicit inversion of measurement matrix
Todo
Need formal timing analysis to understand in which situations this version is preferred

◆ computeDataCov_()

void Gproc::computeDataCov_ ( Array2D< double > & xdata,
Array1D< double > & param,
Array2D< double > & A )
private

Compute the data covariance $A$.

◆ covariance()

double Gproc::covariance ( Array1D< double > & x1,
Array1D< double > & x2,
Array1D< double > & param )
private

Prior covariance function.

Todo
put an 'if' check for covtype_

◆ EvalGP()

void Gproc::EvalGP ( Array2D< double > & xgrid,
string msc,
Array1D< double > & mst )

Evaluate the Gaussian Process at a given grid msc controls whether only mean will be computed, or standard devation and covariance as well.

◆ EvalGP_inv()

void Gproc::EvalGP_inv ( Array2D< double > & xgrid,
string msc,
Array1D< double > & mst )

Evaluate the Gaussian Process at a given grid msc controls whether only mean will be computed, or standard devation and covariance as well.

Note
This is an older implementation with explicit inversion of measurement matrix
Todo
Need formal timing analysis to understand in which situations this version is preferred

◆ findBestCorrParam()

void Gproc::findBestCorrParam ( )

Function to find the best values for roughness parameters.

◆ getA()

void Gproc::getA ( Array2D< double > & acor)
inline

Get the correlation matrix $A$.

◆ getAl()

double Gproc::getAl ( ) const
inline

Get alpha parameter.

◆ getBe()

double Gproc::getBe ( ) const
inline

Get beta parameter.

◆ getCov()

void Gproc::getCov ( Array2D< double > & cov)
inline

Get the posterior covariance matrix.

◆ getNdim()

int Gproc::getNdim ( ) const
inline

Get the dimensionality.

◆ getNPC()

int Gproc::getNPC ( ) const
inline

Get the number of basis terms in the trend.

◆ getNpt()

int Gproc::getNpt ( ) const
inline

Get the number of data points.

◆ getParam()

void Gproc::getParam ( Array1D< double > & param)
inline

Get the roughness parameters.

◆ getSig2hat()

double Gproc::getSig2hat ( ) const
inline

Get Sigma-hat-squared, i.e. the posterior variance factor.

◆ getSttPars()

void Gproc::getSttPars ( Array1D< double > & sttmat)

Get the Student-t parameters.

Todo
check that full cov_ already defined(i.e. msc) not just diagonal

◆ getVar()

void Gproc::getVar ( Array1D< double > & var)
inline

Get the posterior variance vector.

◆ getVst()

void Gproc::getVst ( Array2D< double > & vst)
inline

Get $V^*$, an auxiliary matrix.

◆ getXYCov()

void Gproc::getXYCov ( Array2D< double > & xgrid,
Array2D< double > & xycov )

Get the covariance in a different format, with the x,x' values.

Todo
check that full cov_ already defined(i.e. msc) not just diagonal

◆ setCorrParam()

void Gproc::setCorrParam ( Array1D< double > param)
inline

Set the roughness parameter vector.

◆ SetupData()

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

Setup the data.

◆ SetupPrior()

void Gproc::SetupPrior ( )

Setup the prior.

Member Data Documentation

◆ A_

Array2D<double> Gproc::A_
private

◆ Ainv_

Array2D<double> Gproc::Ainv_
private

◆ Ainvd_

Array1D<double> Gproc::Ainvd_
private

◆ AinvH_

Array2D<double> Gproc::AinvH_
private

◆ AinvyHbhat_

Array1D<double> Gproc::AinvyHbhat_
private

◆ al_

double Gproc::al_
private

Prior parameter $\alpha$.

◆ be_

double Gproc::be_
private

Prior parameter $\beta$.

◆ bhat_

Array1D<double> Gproc::bhat_
private

◆ cov_

Array2D<double> Gproc::cov_
private

Covariance of the Student-t posterior.

◆ covType_

string Gproc::covType_
private

Covariance type, only 'SqExp' implemented so far.

◆ dataVar_

Array1D<double> Gproc::dataVar_
private

Data noise 'nugget'.

◆ H_

Array2D<double> Gproc::H_
private

Auxiliary matrices or vectors, see the UQTk Manual.

◆ Hbhat_

Array1D<double> Gproc::Hbhat_
private

◆ Ht_

Array2D<double> Gproc::Ht_
private

◆ HtAinvd_

Array1D<double> Gproc::HtAinvd_
private

◆ HtAinvH_

Array2D<double> Gproc::HtAinvH_
private

◆ mst_

Array1D<double> Gproc::mst_
private

Mean of the Student-t posterior.

◆ ndim_

int Gproc::ndim_
private

Dimensionality.

◆ npc_

int Gproc::npc_
private

Number of bases in the mean trend.

◆ npt_

int Gproc::npt_
private

Number of data points.

◆ param_

Array1D<double> Gproc::param_
private

Roughness parameter vector.

◆ PCModel_

PCSet* Gproc::PCModel_
private

Basis set for the trend function.

◆ sig2hat_

double Gproc::sig2hat_
private

Posterior variance factor.

◆ var_

Array1D<double> Gproc::var_
private

Variance of the Student-t posterior.

◆ Vinv_

Array2D<double> Gproc::Vinv_
private

Inverse of the mean trend coefficient prior covariance.

◆ Vinvz_

Array1D<double> Gproc::Vinvz_
private

◆ Vst_

Array2D<double> Gproc::Vst_
private

◆ Vstinv_

Array2D<double> Gproc::Vstinv_
private

◆ xdata_

Array2D<double> Gproc::xdata_
private

xdata array

◆ ydata_

Array1D<double> Gproc::ydata_
private

ydata array

◆ yHbhat_

Array1D<double> Gproc::yHbhat_
private

◆ z_

Array1D<double> Gproc::z_
private

Prior mean of the mean trend.


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