| Title: | Gausian Process Emulator |
|---|---|
| Description: | Implementation of a Gaussian Process model (both likelihood and bayesian approaches) for kriging and model emulation. Includes functions for sampling design and prediction. |
| Authors: | Mike Dietze [aut, cre], University of Illinois, NCSA [cph] |
| Maintainer: | Mike Dietze <[email protected]> |
| License: | BSD_3_clause + file LICENSE |
| Version: | 1.8.2.9000 |
| Built: | 2026-06-05 14:55:33 UTC |
| Source: | https://github.com/PecanProject/pecan |
Acceptance rate
arate(x)arate(x)
x |
vector of MCMC samples |
Michael Dietze
calcSpatialCov
calcSpatialCov(d, psi, tau, ...)calcSpatialCov(d, psi, tau, ...)
d |
either a spatial distance matrix or a list of component spatial distance matrices |
psi |
spatial corr |
tau |
spatial var |
... |
Additional arguments |
Michael Dietze
Can make gaussian by passing squared distance matrix
## S3 method for class 'list' calcSpatialCov(d, psi, tau, ...)## S3 method for class 'list' calcSpatialCov(d, psi, tau, ...)
d |
list of component spatial distance matrices |
psi |
spatial corr |
tau |
spatial var |
... |
additional arguments (currently unused) |
spatial covariance matrix
Michael Dietze
Can make gaussian by passing squared distance matrix
## S3 method for class 'matrix' calcSpatialCov(d, psi, tau, ...)## S3 method for class 'matrix' calcSpatialCov(d, psi, tau, ...)
d |
spatial distance matrix |
psi |
spatial corr |
tau |
spatial var |
... |
additional arguments (currently unused) |
spatial covariance matrix
Michael Dietze
distance
distance(x, power = 1)distance(x, power = 1)
x |
matrix of locations in physical or parameter space |
power |
exponent used for calculating distance, default value of 2 = Pythagorean distance |
list of per-dimension pairwise distance matrices
Michael Dietze
distance_matrix
distance_matrix(x, power = 1, dim = 2)distance_matrix(x, power = 1, dim = 2)
x |
matrix of locations in physical or parameter space |
power |
exponent used for calculating distance, default value of 2 = Pythagorean distance |
dim |
dimension |
symmetric matrix of pairwise squared distances
Michael Dietze
distance12_matrix
distance12_matrix(x, n1, power = 1)distance12_matrix(x, n1, power = 1)
x |
matrix of locations in parameter space |
n1 |
number of rows in the original dataset |
power |
exponent used for calculating distance, default value of 2 = Pythagorean distance |
cross-distance matrix of dimensions n x (n - n1)
Michael Dietze
GaussProcess
GaussProcess( x, y, isotropic = TRUE, nugget = TRUE, method = "bayes", ngibbs = 5000, burnin = 1000, thin = 1, jump.ic = c(1.1, 0.2), prior = "IG", mix = "joint", psi = NULL, zeroMean = FALSE, exclude = NULL, ... )GaussProcess( x, y, isotropic = TRUE, nugget = TRUE, method = "bayes", ngibbs = 5000, burnin = 1000, thin = 1, jump.ic = c(1.1, 0.2), prior = "IG", mix = "joint", psi = NULL, zeroMean = FALSE, exclude = NULL, ... )
x |
set of independent variables |
y |
dependent variable |
isotropic |
Boolean indicating whether the GP is fit isotropically. If FALSE, distances are calculated deparately for each direction |
nugget |
allows additional error in Y rather than fix interpolation to go through points |
method |
method for calculating correlations |
ngibbs |
number of MCMC iterations (per chain) to run |
burnin |
Number of samples to discard as burnin (auto must be FALSE) |
thin |
thinning of the matrix to make things faster. Default is to thin to 1 |
jump.ic |
initial condition for jump standard deviation. |
prior |
'unif', 'IG' |
mix |
joint=mix over psi simultanously, each=mix over psi individually |
psi |
spatial corr |
zeroMean |
True if mean is 0, else false |
exclude |
<- isn't used anywhere, should be dropped |
... |
Additional arguments |
Michael Dietze
gp_mle
gp_mle(theta, d, nugget, myY, maxval = Inf)gp_mle(theta, d, nugget, myY, maxval = Inf)
theta |
proposed parameter vector: [mu, tauw, tauv, phi1...phiK] |
d |
spatial distance matrix |
nugget |
allows additional error in Y rather than fix interpolation to go through points |
myY |
vector of observed data |
maxval |
maximum value |
negative log-likelihood value, or maxval if the computation fails
Michael Dietze
gp_mle2
gp_mle2(theta, d, nugget, myY, maxval = Inf)gp_mle2(theta, d, nugget, myY, maxval = Inf)
theta |
proposed parameter vector: [mu, tauw, tauv, phi1...phiK] |
d |
spatial distance matrix |
nugget |
allows additional error in Y rather than fix interpolation to go through points |
myY |
vector of observed data |
maxval |
maximum value |
groupid
groupid(x)groupid(x)
x |
matrix of parameter values |
Michael Dietze
jump
jump(ic = 0, rate = 0.4, ...)jump(ic = 0, rate = 0.4, ...)
ic |
optional data vector |
rate |
target acceptance rate |
... |
Addtional arguments |
Michael Dietze
define a class for automatically tuning jump distributions
Michael Dietze
Log-dinvgamma, based on MCMCpack
ldinvgamma(x, shape, scale = 1)ldinvgamma(x, shape, scale = 1)
x |
vector of quantiles |
shape, scale
|
shape and scale parameters for the inverse Gamma distribution |
log density of the inverse Gamma distribution evaluated at x
Michael Dietze
Simple uniform sampling with LHC permutation
lhc(x, n.samp)lhc(x, n.samp)
x |
<- list (n.dim x 2) |
n.samp |
number of samples |
Michael Dietze
mvjump
mvjump(ic = 0, rate = 0.4, nc = 2, ...)mvjump(ic = 0, rate = 0.4, nc = 2, ...)
ic |
optional data vector |
rate |
target acceptance rate |
nc |
NetCDF object containing target variable |
... |
Additional arguments |
nderiv
nderiv(x, y)nderiv(x, y)
x |
Name of variable to plot on X axis |
y |
Name of variable to plot on Y axis |
numeric vector of numerical derivatives of y with respect to x
Michael Dietze
jump objectExtract current jump parameter value for a jump object
## S3 method for class 'jump' p(x, ...)## S3 method for class 'jump' p(x, ...)
x |
object of class |
... |
additional arguments (currently unused) |
The most recent jump parameter value.
Michael Dietze
mvjump objectExtract current jump parameter values for a mvjump object
## S3 method for class 'mvjump' p(x, ...)## S3 method for class 'mvjump' p(x, ...)
x |
object of class |
... |
additional arguments (currently unused) |
The most recent row of the multivariate jump parameter history.
Michael Dietze
jump tuning objectDisplays the jump parameter trace and acceptance rate over MCMC iterations.
## S3 method for class 'jump' plot(x, ...)## S3 method for class 'jump' plot(x, ...)
x |
object of class |
... |
additional arguments (currently unused) |
Michael Dietze
mvjump tuning objectDisplays the multivariate jump parameter trace and acceptance rate over MCMC iterations.
## S3 method for class 'mvjump' plot(x, ...)## S3 method for class 'mvjump' plot(x, ...)
x |
object of class |
... |
additional arguments (currently unused) |
Michael Dietze
Simple interpolation of a density object to new points
## S3 method for class 'density' predict(object, xnew, ...)## S3 method for class 'density' predict(object, xnew, ...)
object |
a |
xnew |
numeric vector of new x coordinates at which to evaluate the density |
... |
additional arguments (currently unused) |
numeric vector of interpolated density values at xnew
Michael Dietze
Performs kriging prediction from a fitted Gaussian Process model.
## S3 method for class 'GP' predict(object, xpred, cI = NULL, pI = NULL, splinefcns = NULL, ...)## S3 method for class 'GP' predict(object, xpred, cI = NULL, pI = NULL, splinefcns = NULL, ...)
object |
a Gaussian Process object (class |
xpred |
value of x where prediction should be made |
cI |
credible interval quantiles, or |
pI |
prediction interval quantiles, or |
splinefcns |
optional list of spline functions for trend-surface adjustment |
... |
additional arguments (currently unused) |
Kriged predictions or a list of credible/prediction interval quantiles.
Michael Dietze
summarize_GP
summarize_GP(gp, pdf_file = NULL, txt_file = NULL)summarize_GP(gp, pdf_file = NULL, txt_file = NULL)
gp |
Gaussian Process |
pdf_file |
filename you want figures written out to |
txt_file |
filename you want figures written out to |
Michael Dietze
Adapts the jump standard deviation based on recent acceptance rate to keep acceptance near the target rate.
## S3 method for class 'jump' update(object, chain, ...)## S3 method for class 'jump' update(object, chain, ...)
object |
object of class |
chain |
numeric matrix of recent MCMC chain values used to compute acceptance rate |
... |
additional arguments (currently unused) |
Updated jump object with adjusted history and acceptance rate.
Michael Dietze
Adapts each dimension of the multivariate jump standard deviation based on recent acceptance rate for each dimension to keep acceptance near the target rate.
## S3 method for class 'mvjump' update(object, chain, ...)## S3 method for class 'mvjump' update(object, chain, ...)
object |
object of class |
chain |
numeric matrix of recent MCMC chain values used to compute acceptance rates |
... |
additional arguments (currently unused) |
Updated mvjump object with adjusted history and acceptance rates.
Michael Dietze