pred {lgpr} | R Documentation |
Posterior predictions and function posteriors
Description
If
fit
is for a model that marginalizes the latent signalf
(i.e.is_f_sampled(fit)
isFALSE
), this computes the analytic conditional posterior distributions of each model component, their sum, and the conditional predictive distribution. All these are computed for each (hyper)parameter draw (defined bydraws
), or other parameter set (obtained by a reduction defined byreduce
). Results are stored in a GaussianPrediction object which is then returned.If
fit
is for a model that samples the latent signalf
(i.e.is_f_sampled(fit)
isTRUE
), this will extract these function samples, compute their sum, and a version of the sumf
that is transformed through the inverse link function. Ifx
is notNULL
, the function draws are extrapolated to the points specified byx
using kernel regression. Results are stored in a Prediction object which is then returned.
Usage
pred(
fit,
x = NULL,
reduce = function(x) base::mean(x),
draws = NULL,
verbose = TRUE,
STREAM = get_stream(),
c_hat_pred = NULL,
force = FALSE,
debug_kc = FALSE
)
Arguments
fit |
An object of class lgpfit. |
x |
A data frame of points where function posterior distributions
and predictions should be computed or sampled.
The function |
reduce |
Reduction for parameters draws. Can be a function that
is applied to reduce all parameter draws into one parameter set, or
|
draws |
Indices of parameter draws to use, or |
verbose |
Should more information and a possible progress bar be printed? |
STREAM |
External pointer. By default obtained with
|
c_hat_pred |
This is only used if the latent signal |
force |
This is by default |
debug_kc |
If this is |
Value
An object of class GaussianPrediction or Prediction.
See Also
Other main functions:
create_model()
,
draw_pred()
,
get_draws()
,
lgp()
,
prior_pred()
,
sample_model()