sample_from_gaussian_process_predictive - Samples from the predictive distribution of a Gaussian process
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
const Vector_vector *train_indices,
const Vector_vector *train_data,
const Vector_vector *test_indices,
int (*cov_func)(Matrix **,const Vector *,const Vector *,const void *,int),
const void *hyper_params
This routine samples from the predictive distribution of a Gaussian process,
whose covariance function is given by cov_func. The sample will be in the indices
given by the vectors of test_indices, and will each be of the dimension of the
vectors in train_data.
The necessary information to sample from the predictive distribution is:
train_indices - the indices where the training data comes from
train_data - the training data
noise_sigma - the variance of the gaussian noise process
test_indices - where the prediction will take place.
Naturally, the vectors of test_indices must all be of equal length, as must the
vectors of train_indices and train_data, and cov_func must return square
matrix of dimension d. Also, sample will have test_indices->length vectors,
each of length train_data->elements->length.
If the vector pointed to by sample is NULL, then a vector of the appropriate size
is created. If it exists, but is the wrong size, then it is recreated. Otherwise,
the storage is recycled.
If the routine fails (due to storage allocation, an error in the
covariance function, or a mismatch in the sizes of the indices), then ERROR
is returned with and error message being set. Otherwise NO_ERROR is returned.
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.