## =========================================================================
## Using the pre-calculated object `xm` to save time. See `?xm` to re-create
## this object.
## =========================================================================
## 'xm@model' is the best 'fgpm' model in 'xm'
plot(xm@model)
## see the R code to use to recreate the model
modelDef(xm, i = 1)
if (FALSE) {
## Define new data in a list. Using an environment would also work,
## including the global environment, which is the default in `eval`.
L <- list()
set.seed(341)
n.new <- 3^5
x1 <- x2 <- x3 <- x4 <- x5 <- seq(0, 1, length = n.new^(1/5))
## create the data objects required to fit the model
L$sIn <- as.matrix(expand.grid(x1 = x1, x2 = x2, x3 = x3, x4 = x4, x5 = x5))
L$fIn <- list(f1 = matrix(runif(n.new * 10), ncol = 10),
f2 = matrix(runif(n.new * 22), ncol = 22))
L$sOut <- fgp_BB7(L$sIn, L$fIn, n.new)
## Now evaluate
fgpm.new <- eval(modelDef(xm, i = 1), envir = L)
plot(fgpm.new, main = "Re-created 'fgpm' model with different data")
plot(xm[[1]], main = "Re-created 'fgpm' model with the same data")
}
Run the code above in your browser using DataLab