posterior_predict-bcgpfit-method: 'posterior_predict' method for a 'bcgpfit' object

Description Usage Arguments Value Examples

Description

This makes posterior predictions for either new data or for the training data.

Usage

1
2
## S4 method for signature 'bcgpfit'
posterior_predict(object, newdata = NULL, ...)

Arguments

object

a bcgpfit object

newdata

Optionally, an nPred x d numeric matrix of new data locations at which to predict. If omitted, the training data matrix is used. If newdata is provided, it should be provided on the same scale as the user-provided training data, i.e. do not transform to [0, 1]^d.

Value

A list with elements x, an nPred x d numeric matrix representing the prediction locations and y, an iter x nPred matrix of simulations from the posterior predictive distribution. Each row of the matrix is a vector of predictions generated using a single draw of the model parameters from the posterior distribution.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
simData <- bcgpsims(composite = TRUE, stationary = FALSE, noise = FALSE,
                    d = 1, decomposition = TRUE)

model <- bcgpmodel(x = simData@training$x, y = simData@training$y,
                   composite = TRUE, stationary = FALSE, noise = FALSE)
fit <- bcgp_sampling(model, scaled = TRUE, cores = 4, nmcmc = 500,
                     burnin = 200, algorithm = "NUTS",
                     control = list(adapt_delta = 0.90))

posterior_predict(fit)
posterior_predict(fit, newdata = matrix(runif(100, -0.5, 1.5), ncol = 1))

cbdavis33/bcgp documentation built on Oct. 1, 2019, 8:07 a.m.