n <- 30
d <- 2
n2 <- 10
f1 <- function(x) {sin(2*pi*x[1]) + sin(2*pi*x[2])}
X1 <- matrix(runif(n*d),n,d)
Z1 <- apply(X1,1,f1) + rnorm(n, 0, 1e-3)
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_LOOEC_GauPro_kernel$new(X=X1,Z=Z1, parallel=FALSE)
cbind(u$predict(XX1), ZZ1)
u$predict.se(XX1)
# \donttest{
u$update(Xnew=X2,Znew=Z2)
u$predict(XX1)
# }
u$delete()
# \donttest{
# 1D example to see difference
n <- 9
d <- 1
n2 <- 20
f1 <- function(x) {x^2 * sin(2*pi*x)}
X1 <- matrix(seq(0,1,l=n),n,d)
Z1 <- apply(X1,1,f1) + rnorm(n, 0, 1e-1)
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_LOOEC_GauPro_kernel$new(X=X1,Z=Z1, parallel=FALSE)
u$plot()
u$mod$tmod$plot1D()
u$update(Xnew=X2,Znew=Z2)
u$plot()
u$mod$tmod$plot1D()
u$delete()
# }
Run the code above in your browser using DataLab