fit is for a model that marginalizes the latent
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 by
draws), or other parameter
set (obtained by a reduction defined by
reduce). Results are stored
in a GaussianPrediction object which is then returned.
fit is for a model that samples the latent
TRUE), this will
extract these function samples, compute their sum, and a version of the
f that is transformed through the inverse link function.
x is not
NULL, the function draws are extrapolated
to the points specified by
x using kernel regression.
Results are stored in a Prediction
object which is then returned.
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 )
An object of class lgpfit.
A data frame of points where function posterior distributions
and predictions should be computed or sampled.
new_x provides an easy way to create it.
If this is
NULL, the data points are used.
Reduction for parameters draws. Can be a function that
is applied to reduce all parameter draws into one parameter set, or
NULL (no reduction). Has no effect if
draws is specified.
Indices of parameter draws to use, or
NULL to use all
Should more information and a possible progress bar be printed?
External pointer. By default obtained with
This is only used if the latent signal
sampled. This input contains the values added to the sum
passing through inverse link function. Must be a vector with length equal to
the number of prediction points. If original
c_hat was constant,
c_hat_pred can be ignored, in which case this will by default
use the same constant.
This is by default
FALSE to prevent unintended
large computations that might crash R or take forever. Set it to
try computing no matter what.
If this is
TRUE, this only returns a
KernelComputer object that is created internally. Meant for