32 ConditionalBayesProcess::ConditionalBayesProcess(
size_t dim, Parameters parameters,
34 MeanModel& mean, randEngine& eng):
35 KernelRegressor(dim,parameters,data,mean,eng)
38 ConditionalBayesProcess::~ConditionalBayesProcess()
42 double ConditionalBayesProcess::evaluateKernelParams()
47 return negativeTotalLogLikelihood();
49 return negativeLogLikelihood();
53 return negativeLogLikelihood()-mKernel.kernelLogPrior();
55 return negativeCrossValidation();
57 throw std::invalid_argument(
"Learning type not supported");
62 double ConditionalBayesProcess::negativeCrossValidation()
67 size_t n = data.getNSamples();
70 matrixd tempF(mMean.mFeatM);
77 for(
size_t i = 0; i<n; ++i)
80 const double y = data.getSampleY(0);
81 const vectord x = data.getSampleX(0);
84 data.
mX.erase(data.
mX.begin());
85 utils::erase(data.
mY,data.
mY.begin());
86 utils::erase_column(mMean.mFeatM,0);
89 computeCholeskyCorrelation();
90 precomputePrediction();
92 sum += std::log(pd->
pdf(y));
96 mMean.mFeatM.resize(mMean.mFeatM.size1(),mMean.mFeatM.size2()+1);
99 std::cout <<
"End" << data.getNSamples();
Namespace of the library interface.
Kernel based nonparametric process, conditional on kernel hyperparameters.
virtual double pdf(double x)=0
Probability density function.
Dataset model to deal with the vector (real) based datasets.
Modules and helper macros for logging.