Package 'PEcAn.emulator'

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

Help Index


Acceptance rate

Description

Acceptance rate

Usage

arate(x)

Arguments

x

vector of MCMC samples

Author(s)

Michael Dietze


calcSpatialCov

Description

calcSpatialCov

Usage

calcSpatialCov(d, psi, tau, ...)

Arguments

d

either a spatial distance matrix or a list of component spatial distance matrices

psi

spatial corr

tau

spatial var

...

Additional arguments

Author(s)

Michael Dietze


Currently assumes an exponential spatial dependency

Description

Can make gaussian by passing squared distance matrix

Usage

## S3 method for class 'list'
calcSpatialCov(d, psi, tau, ...)

Arguments

d

list of component spatial distance matrices

psi

spatial corr

tau

spatial var

...

additional arguments (currently unused)

Value

spatial covariance matrix

Author(s)

Michael Dietze


Currently assumes an exponential spatial dependency

Description

Can make gaussian by passing squared distance matrix

Usage

## S3 method for class 'matrix'
calcSpatialCov(d, psi, tau, ...)

Arguments

d

spatial distance matrix

psi

spatial corr

tau

spatial var

...

additional arguments (currently unused)

Value

spatial covariance matrix

Author(s)

Michael Dietze


distance

Description

distance

Usage

distance(x, power = 1)

Arguments

x

matrix of locations in physical or parameter space

power

exponent used for calculating distance, default value of 2 = Pythagorean distance

Value

list of per-dimension pairwise distance matrices

Author(s)

Michael Dietze


distance_matrix

Description

distance_matrix

Usage

distance_matrix(x, power = 1, dim = 2)

Arguments

x

matrix of locations in physical or parameter space

power

exponent used for calculating distance, default value of 2 = Pythagorean distance

dim

dimension

Value

symmetric matrix of pairwise squared distances

Author(s)

Michael Dietze


distance12_matrix

Description

distance12_matrix

Usage

distance12_matrix(x, n1, power = 1)

Arguments

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

Value

cross-distance matrix of dimensions n x (n - n1)

Author(s)

Michael Dietze


GaussProcess

Description

GaussProcess

Usage

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,
  ...
)

Arguments

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

Author(s)

Michael Dietze


gp_mle

Description

gp_mle

Usage

gp_mle(theta, d, nugget, myY, maxval = Inf)

Arguments

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

Value

negative log-likelihood value, or maxval if the computation fails

Author(s)

Michael Dietze


gp_mle2

Description

gp_mle2

Usage

gp_mle2(theta, d, nugget, myY, maxval = Inf)

Arguments

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

Description

groupid

Usage

groupid(x)

Arguments

x

matrix of parameter values

Author(s)

Michael Dietze


jump

Description

jump

Usage

jump(ic = 0, rate = 0.4, ...)

Arguments

ic

optional data vector

rate

target acceptance rate

...

Addtional arguments

Author(s)

Michael Dietze


define a class for automatically tuning jump distributions

Description

define a class for automatically tuning jump distributions

Author(s)

Michael Dietze


Log-dinvgamma, based on MCMCpack

Description

Log-dinvgamma, based on MCMCpack

Usage

ldinvgamma(x, shape, scale = 1)

Arguments

x

vector of quantiles

shape, scale

shape and scale parameters for the inverse Gamma distribution

Value

log density of the inverse Gamma distribution evaluated at x

Author(s)

Michael Dietze


Latin Hyper Cube

Description

Simple uniform sampling with LHC permutation

Usage

lhc(x, n.samp)

Arguments

x

<- list (n.dim x 2)

n.samp

number of samples

Author(s)

Michael Dietze


mvjump

Description

mvjump

Usage

mvjump(ic = 0, rate = 0.4, nc = 2, ...)

Arguments

ic

optional data vector

rate

target acceptance rate

nc

NetCDF object containing target variable

...

Additional arguments


multivariate version of jump class

Description

multivariate version of jump class


nderiv

Description

nderiv

Usage

nderiv(x, y)

Arguments

x

Name of variable to plot on X axis

y

Name of variable to plot on Y axis

Value

numeric vector of numerical derivatives of y with respect to x

Author(s)

Michael Dietze


p

Description

p

Usage

p(x, ...)

Arguments

x

jump distribution

...

Additional arguments


Extract current jump parameter value for a jump object

Description

Extract current jump parameter value for a jump object

Usage

## S3 method for class 'jump'
p(x, ...)

Arguments

x

object of class jump

...

additional arguments (currently unused)

Value

The most recent jump parameter value.

Author(s)

Michael Dietze


Extract current jump parameter values for a mvjump object

Description

Extract current jump parameter values for a mvjump object

Usage

## S3 method for class 'mvjump'
p(x, ...)

Arguments

x

object of class mvjump

...

additional arguments (currently unused)

Value

The most recent row of the multivariate jump parameter history.

Author(s)

Michael Dietze


Plot diagnostic history for a jump tuning object

Description

Displays the jump parameter trace and acceptance rate over MCMC iterations.

Usage

## S3 method for class 'jump'
plot(x, ...)

Arguments

x

object of class jump

...

additional arguments (currently unused)

Author(s)

Michael Dietze


Plot diagnostic history for a mvjump tuning object

Description

Displays the multivariate jump parameter trace and acceptance rate over MCMC iterations.

Usage

## S3 method for class 'mvjump'
plot(x, ...)

Arguments

x

object of class mvjump

...

additional arguments (currently unused)

Author(s)

Michael Dietze


Simple interpolation of a density object to new points

Description

Simple interpolation of a density object to new points

Usage

## S3 method for class 'density'
predict(object, xnew, ...)

Arguments

object

a density object (as returned by density)

xnew

numeric vector of new x coordinates at which to evaluate the density

...

additional arguments (currently unused)

Value

numeric vector of interpolated density values at xnew

Author(s)

Michael Dietze


Predict method for Gaussian Process objects

Description

Performs kriging prediction from a fitted Gaussian Process model.

Usage

## S3 method for class 'GP'
predict(object, xpred, cI = NULL, pI = NULL, splinefcns = NULL, ...)

Arguments

object

a Gaussian Process object (class GP) as returned by GaussProcess

xpred

value of x where prediction should be made

cI

credible interval quantiles, or NULL to skip

pI

prediction interval quantiles, or NULL to skip

splinefcns

optional list of spline functions for trend-surface adjustment

...

additional arguments (currently unused)

Value

Kriged predictions or a list of credible/prediction interval quantiles.

Author(s)

Michael Dietze


summarize_GP

Description

summarize_GP

Usage

summarize_GP(gp, pdf_file = NULL, txt_file = NULL)

Arguments

gp

Gaussian Process

pdf_file

filename you want figures written out to

txt_file

filename you want figures written out to

Author(s)

Michael Dietze


Update method for adaptive MCMC jump-tuning objects

Description

Adapts the jump standard deviation based on recent acceptance rate to keep acceptance near the target rate.

Usage

## S3 method for class 'jump'
update(object, chain, ...)

Arguments

object

object of class jump

chain

numeric matrix of recent MCMC chain values used to compute acceptance rate

...

additional arguments (currently unused)

Value

Updated jump object with adjusted history and acceptance rate.

Author(s)

Michael Dietze


Update method for adaptive MCMC multivariate jump-tuning objects

Description

Adapts each dimension of the multivariate jump standard deviation based on recent acceptance rate for each dimension to keep acceptance near the target rate.

Usage

## S3 method for class 'mvjump'
update(object, chain, ...)

Arguments

object

object of class mvjump

chain

numeric matrix of recent MCMC chain values used to compute acceptance rates

...

additional arguments (currently unused)

Value

Updated mvjump object with adjusted history and acceptance rates.

Author(s)

Michael Dietze