pred_magmaclust {MagmaClustR} | R Documentation |
MagmaClust prediction
Description
Compute the posterior predictive distribution in MagmaClust. Providing data from any new individual/task, its trained hyper-parameters and a previously trained MagmaClust model, the multi-task posterior distribution is evaluated on any arbitrary inputs that are specified through the 'grid_inputs' argument. Due to the nature of the model, the prediction is defined as a mixture of Gaussian distributions. Therefore the present function computes the parameters of the predictive distribution associated with each cluster, as well as the posterior mixture probabilities for this new individual/task.
Usage
pred_magmaclust(
data = NULL,
trained_model = NULL,
grid_inputs = NULL,
mixture = NULL,
hp = NULL,
kern = "SE",
hyperpost = NULL,
prop_mixture = NULL,
get_hyperpost = FALSE,
get_full_cov = TRUE,
plot = TRUE,
pen_diag = 1e-10
)
Arguments
data |
A tibble or data frame. Required columns: |
trained_model |
A list, containing the information coming from a
MagmaClust model, previously trained using the
|
grid_inputs |
The grid of inputs (reference Input and covariates) values
on which the GP should be evaluated. Ideally, this argument should be a
tibble or a data frame, providing the same columns as |
mixture |
A tibble or data frame, indicating the mixture probabilities
of each cluster for the new individual/task.
If NULL, the |
hp |
A named vector, tibble or data frame of hyper-parameters
associated with |
kern |
A kernel function, defining the covariance structure of the GP. Several popular kernels (see The Kernel Cookbook) are already implemented and can be selected within the following list:
|
hyperpost |
A list, containing the elements |
prop_mixture |
A tibble or a named vector of the mixture proportions.
Each name of column or element should refer to a cluster. The value
associated with each cluster is a number between 0 and 1. If both
|
get_hyperpost |
A logical value, indicating whether the hyper-posterior distributions of the mean processes should be returned. This can be useful when planning to perform several predictions on the same grid of inputs, since recomputation of the hyper-posterior can be prohibitive for high dimensional grids. |
get_full_cov |
A logical value, indicating whether the full posterior covariance matrices should be returned. |
plot |
A logical value, indicating whether a plot of the results is automatically displayed. |
pen_diag |
A number. A jitter term, added on the diagonal to prevent numerical issues when inverting nearly singular matrices. |
Value
A list of GP prediction results composed of:
pred: As sub-list containing, for each cluster:
pred_gp: A tibble, representing the GP predictions as two column
Mean
andVar
, evaluated on thegrid_inputs
. The columnInput
and additional covariates columns are associated with each predicted values.proba: A number, the posterior probability associated with this cluster.
cov (if
get_full_cov
= TRUE): A matrix, the full posterior covariance matrix associated with this cluster.
mixture: A tibble, indicating the mixture probabilities of each cluster for the predicted individual/task.
hyperpost (if
get_hyperpost
= TRUE): A list, containing the hyper-posterior distributions information useful for visualisation purposes.
Examples
TRUE