A realisation of a posterior GP distribution is drawn and displayed. According to the dimension of the inputs, the graph may be a curve or a heatmap.
Usage
sample_gp(
pred_gp,
x_input = NULL,
data = NULL,
data_train = NULL,
prior_mean = NULL,
size_data = 3,
size_data_train = 1,
alpha_data_train = 0.5
)
Arguments
- pred_gp
A tibble or data frame, typically coming from
pred_magma
orpred_gp
functions. Required columns: 'Input', 'Mean', 'Var'. Additional covariate columns may be present in case of multi-dimensional inputs.- x_input
A vector of character strings, indicating which input should be displayed. If NULL(default) the 'Input' column is used for the x-axis. If providing a 2-dimensional vector, the corresponding columns are used for the x-axis and y-axis.
- data
(Optional) A tibble or data frame, containing the data used in the GP prediction.
- data_train
(Optional) A tibble or data frame, containing the training data of the Magma model. The data set should have the same format as the
data
argument with an additional column 'ID' for identifying the different individuals/tasks. If provided, those data are displayed as backward colourful points (each colour corresponding to one individual/task).- prior_mean
(Optional) A tibble or a data frame, containing the 'Input' and associated 'Output' prior mean parameter of the GP prediction.
- size_data
A number, controlling the size of the
data
points.- size_data_train
A number, controlling the size of the
data_train
points.- alpha_data_train
A number, between 0 and 1, controlling transparency of the
data_train
points.