| IGP_hetGP | R Documentation |
Class providing object with methods for fitting a GP model
R6Class object.
Object of R6Class with methods for fitting GP model.
For full documentation of each method go to https://github.com/CollinErickson/IGP/
new(X=NULL, Z=NULL, package=NULL,
estimate.nugget=T, nugget0=F, ...)This method
is used to create object of this class with X and Z as the data.
The package tells it which package to fit the GP model.
update(Xall=NULL, Zall=NULL, Xnew=NULL, Znew=NULL, ...)This method updates the model, adding new data if given, then running optimization again.
IGP::IGP -> IGP_hetGP
XDesign matrix
ZResponses
NNumber of data points
DDimension of data
XDesign matrix
ZResponses
NNumber of data points
DDimension of data
IGP::IGP$at.max.var()IGP::IGP$delete()IGP::IGP$finalize()IGP::IGP$grad()IGP::IGP$grad_from_theta()IGP::IGP$grad_norm()IGP::IGP$grad_num()IGP::IGP$init()IGP::IGP$initialize()IGP::IGP$max.var()IGP::IGP$mean()IGP::IGP$nugget()IGP::IGP$plot()IGP::IGP$predict()IGP::IGP$predict.se()IGP::IGP$predict.var()IGP::IGP$prop.at.max.var()IGP::IGP$s2()IGP::IGP$sample()IGP::IGP$theta()IGP::IGP$update().init()IGP_hetGP$.init( ..., kernel = "Gaussian", nug.est = self$estimate.nugget, nug = self$nugget0, noiseControl = list(k_theta_g_bounds = c(1, 100), g_max = 100, g_bounds = c(1e-06, 1)), lower = rep(1e-06, ncol(self$X)), upper = rep(50, ncol(self$X)) )
.update()IGP_hetGP$.update(...)
.predict()IGP_hetGP$.predict(XX, se.fit, ...)
.predict.se()IGP_hetGP$.predict.se(XX, ...)
.predict.var()IGP_hetGP$.predict.var(XX, ...)
.grad()IGP_hetGP$.grad(XX)
.delete()IGP_hetGP$.delete(...)
.theta()IGP_hetGP$.theta()
.nugget()IGP_hetGP$.nugget()
.s2()IGP_hetGP$.s2()
.mean()IGP_hetGP$.mean()
clone()The objects of this class are cloneable with this method.
IGP_hetGP$clone(deep = FALSE)
deepWhether to make a deep clone.
n <- 40
d <- 2
n2 <- 20
f1 <- function(x) {x[1]*sin(2*pi*x[1]) + sqrt(x[1])*exp(x[2])}
X1 <- matrix(runif(n*d),n,d)
Z1 <- apply(X1,1,f1) + rnorm(n, 0, 1e-2)
X2 <- matrix(runif(n2*d),n2,d)
Z2 <- apply(X2,1,f1)
XX1 <- matrix(runif(10),5,2)
ZZ1 <- apply(XX1, 1, f1)
u <- IGP_hetGP$new(X=X1,Z=Z1)
cbind(u$predict(XX1), ZZ1)
u$predict.se(XX1)
ContourFunctions::cf(function(x) u$predict(x), pts=X1)
ContourFunctions::cf(function(x) u$predict(x, se.fit=TRUE)$se, pts=X1)
u$update(Xnew=X2,Znew=Z2)
u$predict(XX1)
ContourFunctions::cf(function(x) u$predict(x), pts=rbind(X1, X2))
u$delete()
n <- 10
d <- 1
X1 <- runif(n)
X1 <- c(X1, X1)
f1 <- function(x) {abs(sin(pi*x))+sqrt(x)+rnorm(1,0,.1)}
Z1 <- sapply(X1, f1)
plot(X1, Z1)
h1 <- hetGP::mleHetGP(X=matrix(X1,ncol=1),Z=matrix(Z1, ncol=1), lower=c(.1), upper=c(50))
curve(predict(h1, matrix(x, ncol=1))$mean, add=TRUE, col=3)
u <- IGP_hetGP$new(X=X1,Z=Z1)
plot(X1, Z1, col=2); curve(u$predict(matrix(x,ncol=1)), add=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.