GCOP  1.0
Public Member Functions | Public Attributes
gcop::GP Class Reference

#include <gp.h>

List of all members.

Public Member Functions

 GP (int d, int n=0)
virtual ~GP ()
virtual void Sample ()
bool Add (const Eigen::VectorXd &x, double f)
void Train ()
void Train (const Eigen::MatrixXd &Xs, const Eigen::VectorXd &fs)
double Predict (const Eigen::VectorXd &x, double *s=0) const
double SqExp (const Eigen::VectorXd &xa, const Eigen::VectorXd &xb) const
double LogL (double dll[2]=0)
double PI (const Eigen::VectorXd &x, double fmin) const
double OptParams ()

Public Attributes

int d
 dimension
int n
 number of data points
Eigen::MatrixXd Xs
 data points
Eigen::VectorXd fs
 values
Eigen::MatrixXd K
Eigen::MatrixXd Ki
Eigen::MatrixXd L
Eigen::VectorXd a
double l
double s
double sigma
bool cf
 propagate cholesky factor L rather than K^{-1}
bool eps
 prohibit adding points that are eps-close in L_2 to existing data

Constructor & Destructor Documentation

GP::GP ( int  d,
int  n = 0 
)

Initialize a GP with dimension d and number of points n

Parameters:
ddimension
nnumber of points (optional)
GP::~GP ( ) [virtual]

Member Function Documentation

bool GP::Add ( const Eigen::VectorXd &  x,
double  f 
)

Add a new data point

Parameters:
xdata vector
fvalue
trueif OK

References a, cf, d, eps, fs, K, Ki, L, l, n, sigma, SqExp(), and Xs.

double GP::LogL ( double  dll[2] = 0)

Loglikelihood

Parameters:
dllderivative of log-liklihood w.r. to l and s
Returns:
log-likelihood

References a, d, L, l, n, and s.

Referenced by OptParams().

double GP::OptParams ( )

Optimize GP parameters. This is currently done naively using a grid enumeration over l and s

References l, LogL(), and Train().

double GP::PI ( const Eigen::VectorXd &  x,
double  fmin 
) const

Probability of improvement over a given value fmin x data vector

Parameters:
fminbaseline
Returns:
probability of improvement

References gcop::ncdf(), Predict(), and s.

double GP::Predict ( const Eigen::VectorXd &  x,
double *  s = 0 
) const

Predict value at point x

Parameters:
xpoint
spointer to predicted covariance (optional)
Returns:
predicted mean

References a, cf, Ki, L, sigma, and SqExp().

Referenced by PI().

void GP::Sample ( ) [virtual]

Generate random points

References fs, and Xs.

double GP::SqExp ( const Eigen::VectorXd &  xa,
const Eigen::VectorXd &  xb 
) const

Square exponential kernel

Parameters:
xafirst point
xbsecond point
Returns:
correlation

References d, l, and s.

Referenced by Add(), Predict(), and Train().

void GP::Train ( )

Train using current data

References a, cf, K, Ki, L, n, sigma, and SqExp().

Referenced by OptParams().

void gcop::GP::Train ( const Eigen::MatrixXd &  Xs,
const Eigen::VectorXd &  fs 
)

Train GP using a given dataset (xs, fs)

Parameters:
d-nmatrix of data vectors
n-vectorof values

Member Data Documentation

Eigen::VectorXd gcop::GP::a

Referenced by Add(), LogL(), Predict(), and Train().

propagate cholesky factor L rather than K^{-1}

Referenced by Add(), Predict(), and Train().

dimension

Referenced by Add(), LogL(), and SqExp().

prohibit adding points that are eps-close in L_2 to existing data

Referenced by Add().

Eigen::VectorXd gcop::GP::fs

values

Referenced by Add(), and Sample().

Eigen::MatrixXd gcop::GP::K

Referenced by Add(), and Train().

Eigen::MatrixXd gcop::GP::Ki

Referenced by Add(), Predict(), and Train().

Eigen::MatrixXd gcop::GP::L

Referenced by Add(), LogL(), Predict(), and Train().

double gcop::GP::l

Referenced by Add(), LogL(), OptParams(), and SqExp().

number of data points

Referenced by Add(), LogL(), and Train().

double gcop::GP::s

Referenced by LogL(), PI(), and SqExp().

Referenced by Add(), Predict(), and Train().

Eigen::MatrixXd gcop::GP::Xs

data points

Referenced by Add(), and Sample().


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