24 #include "ublas_trace.hpp" 28 namespace ublas = boost::numeric::ublas;
30 HierarchicalGaussianProcess::HierarchicalGaussianProcess(
size_t dim,
35 ConditionalBayesProcess(dim, params, data, mean, eng) {};
43 const size_t n = K.size1();
44 const size_t p = mMean.
mFeatM.size1();
48 matrixd KF(ublas::trans(mMean.
mFeatM));
49 inplace_solve(L,KF,ublas::lower_tag());
51 matrixd FKF = prod(ublas::trans(KF),KF);
56 inplace_solve(L,Ky,ublas::lower_tag());
58 vectord wML = prod(Ky,KF);
61 vectord alpha = mData.
mY - prod(wML,mMean.
mFeatM);
62 inplace_solve(L,alpha,ublas::lower_tag());
64 double loglik = .5*(n-p)*log(ublas::inner_prod(alpha,alpha))
65 + utils::log_trace(L) + utils::log_trace(L2);
matrixd computeCorrMatrix()
Computes the Correlation (Kernel or Gram) matrix.
Hierarchical model for Gaussian process.
Namespace of the library interface.
double negativeTotalLogLikelihood()
Computes the negative log likelihood of the data for all the parameters.
size_t cholesky_decompose(const MATRIX &A, TRIA &L)
decompose the symmetric positive definit matrix A into product L L^T.
void cholesky_solve(const TRIA &L, MATRIX &x, ublas::lower)
solve system L L^T x = b inplace
matrixd mFeatM
Value of the mean features at the input points.