Learn R Programming

GPFDA (version 2.2)

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 which is a 'gpr' object. Default to be NULL. If NULL, do training based on the other given arguments; if TURE, other arguments (except for Data.new) will replaced by NULL; if FALSE, only do prediction based on the other given arguments.

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

CovFun

Covariance function type

fitted

Fitted value of training data

fitted.sd

Standard deviation of the fitted value of training data

gamma

Parameter used in powered exponential covariance function

hyper

Hyper-parameter estimated from training data

I

Variance of the estimated hyper-parameters

pred.mean

Estimated prediction mean

pred.sd

Estimated prediction variance

train.x

Training covariates

train.y

Training response, may be transformed, for prediction use only

train.yOri

Original training 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
# NOT RUN {
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