svdGP: Full SVD-Based GP Models

View source: R/svdGP.r

svdGPR Documentation

Full SVD-Based GP Models

Description

This function fits a full SVD-based GP model with test set X0, design set design and response matrix resp.

Usage

svdGP(design,resp,X0=design,nstarts=5,gstart=0.0001,
      frac=.95,centralize=FALSE,nthread=1,clutype="PSOCK")

Arguments

design

An N by d matrix of N training/design inputs.

resp

An L by N response matrix of design, where L is the length of the time series outputs, N is the number of design points.

X0

An M by d matrix of M test inputs. The default value of X0 is design.

nstarts

The number of starting points used in the numerical maximization of the posterior density function. The larger nstarts will typically lead to more accurate prediction but longer computational time. The default value is 5.

gstart

The starting number and upper bound for estimating the nugget parameter. If gstart = sqrt(.Machine$double.eps), the nugget parameter will be fixed at sqrt(.Machine$double.eps), since sqrt(.Machine$double.eps) is the lower bound of the nugget term. The default value is 0.0001.

frac

The threshold in the cumulative percentage criterion to select the number of SVD bases. The default value is 0.95.

centralize

If centralize=TRUE the response matrix will be centralized (subtract the mean) before the start of the algorithm. The mean will be added to the predictive mean at the finish of the algorithm. The default value is FALSE.

nthread

The number of threads (processes) used in parallel execution of this function. nthread=1 implies no parallelization. The default value is 1.

clutype

The type of cluster in the R package "parallel" to perform parallelization. The default value is "PSOCK". Required only if nthread>1.

Value

pmean

An L by M matrix of posterior predicted mean for the response at the test set X0.

ps2

An L by M matrix of posterior predicted variance for the response at the test set X0.

Author(s)

Ru Zhang heavenmarshal@gmail.com,

C. Devon Lin devon.lin@queensu.ca,

Pritam Ranjan pritamr@iimidr.ac.in

See Also

knnsvdGP, lasvdGP.

Examples

library("lhs")
forretal <- function(x,t,shift=1)
{
    par1 <- x[1]*6+4
    par2 <- x[2]*16+4
    par3 <- x[3]*6+1
    t <- t+shift
    y <- (par1*t-2)^2*sin(par2*t-par3)
}
timepoints <- seq(0,1,len=200)
design <- lhs::randomLHS(50,3)
test <- lhs::randomLHS(50,3)

## evaluate the response matrix on the design matrix
resp <- apply(design,1,forretal,timepoints)

## fit full SVD-based GP model
ret <- svdGP(design,resp,test,frac=.95,nstarts=1,
             centralize=TRUE,nthread=2)

DynamicGP documentation built on April 12, 2022, 9:06 a.m.