Learn R Programming

GPFDA (version 1.1)

gppredict: Prediction of the Gaussian Process

Description

Predict the new points in Gaussian Process using the training results or manual input

Usage

gppredict(train=NULL,Data.new=NULL,hyper=NULL, Data=NULL, Y=NULL, Cov=NULL,
  gamma=NULL,lrm=NULL,mean=0)

Arguments

train
The result from training. Default to be NULL, if not NULL, other arguments (except for Data.new) will replaced by NULL.
Data.new
The test data. Must be a vector or a matrix.
hyper
Hyper-parameter estimated from training. Can use manual input. Default to be NULL.
Data
The data from training. Must be a vector or a matrix. Default to be NULL.
Y
The response from training. Must be a vector or a matrix. Default to be NULL.
Cov
Names of covariance functions used. Default to be NULL.
gamma
Parameter used in power exponential covariance function. Default to be NULL.
lrm
The linear trend from learning. Default to be lrm. If lrm exists from learning, NULL will be replaced.
mean
Is the mean taken out when analysis? Default to be 0, which assumes the mean is zero. if assume mean is a constant, mean=1; if assume mean is a linear trend, mean='t'.

Value

  • CovFunCovariance function type
  • fittedFitted value of training data
  • fitted.sdStandard deviation of the fitted value of training data
  • gammaParameter used in powered exponential covariance function
  • hyperHyper-parameter estimated from training data
  • IVariance of the estimated hyper-parameters
  • muEstimated prediction mean
  • sigmaEstimated prediction variance
  • train.xTraining covariates
  • train.yTraining response

Details

Use the result from training to predict the value for new points.

References

Shi, J Q., and Choi, T. (2011), Gaussian Process Regression Analysis for Functional Data, Springer, New York.

See Also

gpr

Examples

Run this code
library(GPFDA)
library(MASS) ## used to generate data
hp <- list('pow.ex.w'=log(10),'linear.a'=log(10),'pow.ex.v'=log(5),'vv'=log(1))
c <- seq(0,1,len=40)
idx <- sort(sample(1:40,21))
X <- as.matrix(c[idx])
Y <- (mvrnorm(n=40,mu=c-c,Sigma=(cov.linear(hp,c)+cov.pow.ex(hp,c)))[,1])+sin(c*6)
Y <- as.matrix(Y[idx])
x <- as.matrix(seq(0,1,by=0.03))
a <- gpr(X,Y,c('linear','pow.ex'))
b <- gppredict(a,x)

Run the code above in your browser using DataLab