predict {bhetGP}R Documentation

Predict posterior mean and variance/covariance

Description

Acts on a bhetgp, bhetgp_vec, bhomgp or, bhomgp_vec object. Calculates posterior mean and variance/covariance over specified input locations. Optionally utilizes SNOW parallelization.

Usage

## S3 method for class 'bhetgp'
predict(
  object,
  x_new,
  lite = TRUE,
  return_all = FALSE,
  interval = c("pi", "ci", "both"),
  lam_ub = TRUE,
  cores = 1,
  samples = TRUE,
  ...
)

## S3 method for class 'bhetgp_vec'
predict(
  object,
  x_new,
  lite = TRUE,
  return_all = FALSE,
  interval = c("pi", "ci", "both"),
  lam_ub = TRUE,
  vecchia = FALSE,
  m = object$m,
  ordering_new = NULL,
  cores = 1,
  omp_cores = 2,
  samples = TRUE,
  ...
)

## S3 method for class 'bhomgp'
predict(
  object,
  x_new,
  lite = TRUE,
  return_all = FALSE,
  interval = c("pi", "ci", "both"),
  cores = 1,
  samples = TRUE,
  ...
)

## S3 method for class 'bhomgp_vec'
predict(
  object,
  x_new,
  lite = TRUE,
  return_all = FALSE,
  interval = c("pi", "ci", "both"),
  vecchia = FALSE,
  m = object$m,
  ordering_new = NULL,
  cores = 1,
  omp_cores = 2,
  samples = TRUE,
  ...
)

Arguments

object

object from bhetGP or bhomGP, with burn-in already removed

x_new

matrix of predictive input locations

lite

logical indicating whether to calculate only point-wise variances (lite = TRUE) or full covariance (lite = FALSE)

return_all

logical indicating whether to return mean and point-wise variance prediction for ALL samples (only available for lite = TRUE)

interval

returns predictive variances by default interval = "pi". interval = "ci" returns variances for only mean process and interval = "both" returns both variances.

lam_ub

logical uses upper 95 quantile for latent noise to obtain predictive variances for the response. If lam_ub = FALSE, the mean latent noise is used for inference.

cores

number of cores to utilize for SNOW parallelization

samples

logical indicating if you want all posterior samples returned including latent layer.

...

N/A

vecchia

logical uses vecchia approximation for prediction if vecchia = TRUE.

m

size of Vecchia conditioning sets (only for fits with vecchia = TRUE), defaults to the m used for MCMC

ordering_new

optional ordering for Vecchia approximation, must correspond to rows of x_new, defaults to random, is applied to all layers in deeper models.

omp_cores

sets cores used for OpenMP if vechhia = TRUE and lite = FALSE.

Details

All iterations in the object are used for prediction, so samples should be burned-in. Thinning the samples using trim will speed up computation. Posterior moments are calculated using conditional expectation and variance. As a default, only point-wise variance is calculated. Full covariance may be calculated using lite = FALSE.

The posterior predictive variances are returned by default. The variance for the mean process may be obtained by specifying interval = "ci". interval = "both" will return both variances.

SNOW parallelization reduces computation time but requires more memory storage.

Value

object of the same class with the following additional elements:

Additionally, if object belongs to class bhetGP or bhetGP_vec, the log-noise process is also predicted for new locations x_new. The following are returned:

Computation time is added to the computation time of the existing object.


[Package bhetGP version 1.0.1 Index]