predict {deepgp} | R Documentation |
Predict posterior mean and variance/covariance
Description
Acts on a gp
, dgp2
, or dgp3
object.
Calculates posterior mean and variance/covariance over specified input
locations. Optionally calculates expected improvement (EI) or entropy
over candidate inputs. Optionally utilizes SNOW parallelization.
Usage
## S3 method for class 'gp'
predict(
object,
x_new,
lite = TRUE,
return_all = FALSE,
EI = FALSE,
entropy_limit = NULL,
cores = 1,
...
)
## S3 method for class 'dgp2'
predict(
object,
x_new,
lite = TRUE,
store_latent = FALSE,
mean_map = TRUE,
return_all = FALSE,
EI = FALSE,
entropy_limit = NULL,
cores = 1,
...
)
## S3 method for class 'dgp3'
predict(
object,
x_new,
lite = TRUE,
store_latent = FALSE,
mean_map = TRUE,
return_all = FALSE,
EI = FALSE,
entropy_limit = NULL,
cores = 1,
...
)
## S3 method for class 'gpvec'
predict(
object,
x_new,
m = object$m,
ordering_new = NULL,
lite = TRUE,
return_all = FALSE,
EI = FALSE,
entropy_limit = NULL,
cores = 1,
...
)
## S3 method for class 'dgp2vec'
predict(
object,
x_new,
m = object$m,
ordering_new = NULL,
lite = TRUE,
store_latent = FALSE,
mean_map = TRUE,
return_all = FALSE,
EI = FALSE,
entropy_limit = NULL,
cores = 1,
...
)
## S3 method for class 'dgp3vec'
predict(
object,
x_new,
m = object$m,
ordering_new = NULL,
lite = TRUE,
store_latent = FALSE,
mean_map = TRUE,
return_all = FALSE,
EI = FALSE,
entropy_limit = NULL,
cores = 1,
...
)
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 |
EI |
logical indicating whether to calculate expected improvement (for minimizing the response) |
entropy_limit |
optional limit state for entropy calculations (separating
passes and failures), default value of |
cores |
number of cores to utilize in parallel |
... |
N/A |
store_latent |
logical indicating whether to store and return mapped values of latent layers (two or three layer models only) |
mean_map |
logical indicating whether to map hidden layers using
conditional mean ( |
m |
size of Vecchia conditioning sets (only for fits with
|
ordering_new |
optional ordering for Vecchia approximation, must correspond
to rows of |
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
.
Expected improvement is calculated with the goal of minimizing the response. See Chapter 7 of Gramacy (2020) for details. Entropy is calculated based on two classes separated by the specified limit. See Sauer (2023, Chapter 3) for details.
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 -
mean
: predicted posterior mean, indices correspond tox_new
locations -
s2
: predicted point-wise variances, indices correspond tox_new
locations (only returned whenlite = TRUE
) -
mean_all
: predicted posterior mean for each sample (column indices), only returned whenreturn_all = TRUE
-
s2_all
predicted point-wise variances for each sample (column indices), only returned whenreturn-all = TRUE
-
Sigma
: predicted posterior covariance, indices correspond tox_new
locations (only returned whenlite = FALSE
) -
EI
: vector of expected improvement values, indices correspond tox_new
locations (only returned whenEI = TRUE
) -
entropy
: vector of entropy values, indices correspond tox_new
locations (only returned whenentropy_limit
is numeric) -
w_new
: list of hidden layer mappings (only returned whenstore_latent = TRUE
), list index corresponds to iteration and row index corresponds tox_new
location (two or three layer models only) -
z_new
: list of hidden layer mappings (only returned whenstore_latent = TRUE
), list index corresponds to iteration and row index corresponds tox_new
location (three layer models only)
Computation time is added to the computation time of the existing object.
References
Sauer, A. (2023). Deep Gaussian process surrogates for computer experiments.
*Ph.D. Dissertation, Department of Statistics, Virginia Polytechnic Institute and State University.*
Sauer, A., Gramacy, R.B., & Higdon, D. (2023). Active learning for deep
Gaussian process surrogates. *Technometrics, 65,* 4-18. arXiv:2012.08015
Sauer, A., Cooper, A., & Gramacy, R. B. (2023). Vecchia-approximated deep Gaussian
processes for computer experiments.
*Journal of Computational and Graphical Statistics,* 1-14. arXiv:2204.02904
Examples
# See "fit_one_layer", "fit_two_layer", or "fit_three_layer"
# for an example