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 |
x_new |
matrix of predictive input locations |
lite |
logical indicating whether to calculate only point-wise
variances ( |
return_all |
logical indicating whether to return mean and point-wise
variance prediction for ALL samples (only available for |
interval |
returns predictive variances by default |
lam_ub |
logical uses upper 95 quantile for latent noise to
obtain predictive variances for the response. If |
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 |
m |
size of Vecchia conditioning sets (only for fits with
|
ordering_new |
optional ordering for Vecchia approximation, must correspond
to rows of |
omp_cores |
sets cores used for OpenMP if |
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:
-
x_new
: copy of predictive input locations -
m_pred
: size of predictive conditioning set ifvecchia = TRUE
-
mean_y
: predicted posterior mean, indices correspond tox_new
locations -
s2_y
: predicted point-wise variances, indices correspond tox_new
locations (only returned whenlite = TRUE
&interval = c("pi", "both")
) -
s2_y_ci
: predicted point-wise variances for the mean process, indices correspond tox_new
locations (only returned whenlite = TRUE
&interval = c("ci", "both")
) -
mean_all
: predicted posterior mean for each sample (column indices), only returned whenreturn_all = TRUE
-
s2_all
predicted point-wise variances each sample (column indices), only returned whenreturn-all = TRUE
&interval = c("pi", "both")
-
s2_all_ci
predicted point-wise variances for each sample (column indices), only returned whenreturn-all = TRUE
&interval = c("ci", "both")
-
Sigma
: predicted posterior covariance, indices correspond tox_new
locations (only returned whenlite = FALSE
&interval = c("pi", "both")
) -
Sigma_ci
: predicted posterior covariance for mean process, indices correspond tox_new
locations (only returned whenlite = FALSE
&interval = c("ci", "both")
)
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:
-
mean_lnugs
: predicted posterior mean for log noise process, indices correspond tox_new
locations -
s2_lnugs
: predicted point-wise variances for log noise process, indices correspond tox_new
locations (only returned whenlite = TRUE
&interval = c("pi", "both")
) -
s2_lnugs_ci
: predicted point-wise variances for the log noise process, indices correspond tox_new
locations (only returned whenlite = TRUE
&interval = c("ci", "both")
) -
mean_lnugs_all
: predicted posterior mean for each sample for log noise process (column indices), only returned whenreturn_all = TRUE
-
s2_lnugs_all
predicted point-wise variances each sample (column indices) for log noise process, only returned whenreturn-all = TRUE
&interval = c("pi", "both")
-
s2_lnugs_all_ci
predicted point-wise variances for each sample (column indices) for log noise process, only returned whenreturn-all = TRUE
&interval = c("ci", "both")
-
Sigma_lnugs
: predicted posterior covariance for log noise process, indices correspond tox_new
locations (only returned whenlite = FALSE
&interval = c("pi", "both")
) -
Sigma_lnugs_ci
: predicted posterior covariance for log noise process, indices correspond tox_new
locations (only returned whenlite = FALSE
&interval = c("ci", "both")
)
Computation time is added to the computation time of the existing object.