Learn R Programming

GPFDA (version 1.0)

gpr: Gaussian Process regression for single curve

Description

Gaussian Process regression for single curve with train data.

Usage

gpr(Data, response, Cov, hyper=NULL, NewHyper=NULL, mean=0, gamma=1)

Arguments

Data
The input data from train data.
hyper
The hyper parameters. Must be a list.
NewHyper
Vector of the names of the new hyper parameters from customized kernel function.
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'.
response
The response data from train data.
Cov
The kernel functions or covariance functions to use.
gamma
Power parameter used in powered exponential kernel function.

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
  • train.xTraining covariates
  • train.yTraining response
  • QCovariance matrix
  • invInverse of the covariance matrix
  • meanThe mean assumed in the analysis
  • lrm'lm' object if mean is a linear regression. NULL otherwise.

References

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

See Also

gpfr

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'))

Run the code above in your browser using DataLab