gpmean: Conditional mean of Gaussian process given observations

View source: R/utilities.R

gpmeanR Documentation

Conditional mean of Gaussian process given observations

Description

Compute the conditional mean of a Gaussian process (and optionally, its derivative), given a vector of observations, hyper-parameters phi, and noise standard deviation sigma.

Usage

gpmean(
  yobs,
  tvec,
  tnew,
  phi,
  sigma,
  kerneltype = "generalMatern",
  deriv = FALSE
)

Arguments

yobs

vector of observations

tvec

vector of time points corresponding to observations

tnew

vector of time points at which the conditional mean should be computed

phi

vector of hyper-parameters for the covariance kernel (kerneltype)

sigma

the noise level (if known). By default, both phi and sigma are estimated. If a value for sigma is supplied, then sigma is held fixed at the supplied value and only phi is estimated.

kerneltype

the covariance kernel, types matern, rbf, compact1, periodicMatern, generalMatern are supported. See calCov for their definitions.

deriv

logical; if true, the conditional mean of the GP's derivative is also computed

Value

A vector with the values of the conditional mean function evaluated at the time points in tnew. If deriv = TRUE, returned with an additional attribute deriv that contains the values of the conditional mean of the GP derivative evaluated at the time points in tnew.

Examples

# Load Fitzhugh-Nagumo dataset
data(FNdat)

tnew <- seq(0, 20, by = 0.5)

# GP mean of V component at time points in tnew given observations
gpmean(FNdat$V, FNdat$time, tnew, c(2.3, 1.2), 0.2)


magi documentation built on April 26, 2023, 1:12 a.m.