27 #include <boost/lexical_cast.hpp> 37 KernelRegressor::KernelRegressor(
size_t dim, Parameters parameters,
39 MeanModel& mean, randEngine& eng):
40 NonParametricProcess(dim,parameters,data,mean,eng),
41 mRegularizer(parameters.noise),
42 mKernel(dim, parameters),
43 mScoreType(parameters.sc_type),
44 mLearnType(parameters.l_type),
45 mLearnAll(parameters.l_all)
48 KernelRegressor::~KernelRegressor(){}
54 const vectord lastX = mData.getLastSampleX();
55 vectord newK = computeCrossCorrelation(lastX);
56 newK(newK.size()-1) += mRegularizer;
58 precomputePrediction();
64 size_t nSamples = mData.getNSamples();
65 mL.resize(nSamples,nSamples);
68 matrixd K(nSamples,nSamples);
73 throw std::runtime_error(
"Cholesky decomposition error at line " +
74 boost::lexical_cast<std::string>(line_error));
80 const size_t nSamples = mData.getNSamples();
81 matrixd corrMatrix(nSamples,nSamples);
82 mKernel.computeDerivativeCorrMatrix(mData.mX,corrMatrix,dth_index);
matrixd computeDerivativeCorrMatrix(int dth_index)
Computes the derivative of the correlation matrix with respect to the dth hyperparameter.
void cholesky_add_row(TRIA &L, const VECTOR &v)
decompose the symmetric positive definit matrix A into product L L^T.
void computeCholeskyCorrelation()
Computes the Cholesky decomposition of the Correlation matrix.
void updateSurrogateModel()
Sequential update of the surrogate model by adding a new row to the Kernel matrix, more precisely, to its Cholesky decomposition.
Namespace of the library interface.
size_t cholesky_decompose(const MATRIX &A, TRIA &L)
decompose the symmetric positive definit matrix A into product L L^T.
Modules and helper macros for logging.
Nonparametric process abstract module.