gpmean: 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.
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.
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
# Load Fitzhugh-Nagumo datasetdata(FNdat)
tnew <- seq(0, 20, by = 0.5)
# GP mean of V component at time points in tnew given observationsgpmean(FNdat$V, FNdat$time, tnew, c(2.3, 1.2), 0.2)