diff --git a/dev/news/index.html b/dev/news/index.html
index aea3afc..2c9feb4 100644
--- a/dev/news/index.html
+++ b/dev/news/index.html
@@ -52,7 +52,8 @@
dgpsi 2.5.0-9000 (development version)
-
+- Prediction speed enhanced for small testing data sets by reducing overhead caused by the multi-threading implementation.
+
dgpsi 2.5.0
CRAN release: 2024-12-14
- Training times for DGP emulators are now approximately 30%-40% faster.
diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml
index 202ca86..cb0d5a8 100644
--- a/dev/pkgdown.yml
+++ b/dev/pkgdown.yml
@@ -10,7 +10,7 @@ articles:
motorcycle: motorcycle.html
seq_design_2: seq_design_2.html
seq_design: seq_design.html
-last_built: 2024-12-16T11:13Z
+last_built: 2025-01-07T17:26Z
urls:
reference: http://mingdeyu.github.io/dgpsi-R/reference
article: http://mingdeyu.github.io/dgpsi-R/articles
diff --git a/dev/search.json b/dev/search.json
index 93ae634..2f66c30 100644
--- a/dev/search.json
+++ b/dev/search.json
@@ -1 +1 @@
-[{"path":"http://mingdeyu.github.io/dgpsi-R/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 Deyu Ming Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":null,"dir":"","previous_headings":"","what":"Research Notice","title":"Research Notice","text":"R package dgpsi repository underlying Python package https://github.com/mingdeyu/DGP contain experimental features new ideas subject change.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"use-of-package-in-academic-research","dir":"","previous_headings":"","what":"Use of Package in Academic Research","title":"Research Notice","text":"features ideas introduced repositories part ongoing research. find ideas useful research, please consider citing package, work (citation details References), reaching potential collaboration.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"disclaimer","dir":"","previous_headings":"","what":"Disclaimer","title":"Research Notice","text":"ideas code repository sister repository experimental. encourage users approach , respecting nature part ongoing academic research. also appreciate inform us research uses ideas package, helps us understand impact.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"licensing","dir":"","previous_headings":"","what":"Licensing","title":"Research Notice","text":"project released MIT License. Please refer LICENSE file full details.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Research Notice","text":"inquiries related research aspects package, please feel free contact us.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Bayesian Optimization","text":"","code":"library(tidyverse) library(lhs) library(patchwork) library(ggplot2) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"define-the-target-function","dir":"Articles","previous_headings":"","what":"Define the target function","title":"Bayesian Optimization","text":"consider version Shubert function (Surjanovic Bingham 2013) defined domain [0,1]2[0,1]^2 follows: pass Shubert function design(), defined input x output matrices. Next, generate contour Shubert function: figure , can observe Shubert function several local minima two global minima located (0.1437, 0.2999) (0.2999, 0.1437), values around -186.7309. remainder vignette, use Expected Improvement (EI) acquisition function identify global minima.","code":"shubert <- function(x) { N <- nrow(x) x1 <- x[,1] * 4 - 2 x2 <- x[,2] * 4 - 2 ii <- c(1:5) y <- sapply(1:N, function(i) { sum(ii * cos((ii+1)*x1[i]+ii)) * sum(ii * cos((ii+1)*x2[i]+ii)) }) y <- matrix(y, ncol = 1) return(y) } x1 <- seq(0, 1, length.out = 200) x2 <- seq(0, 1, length.out = 200) dat <- expand_grid(x1 = x1, x2 = x2) dat <- mutate(dat, f = shubert(cbind(x1, x2))) ggplot(dat, aes(x1, x2, fill = f)) + geom_tile() + scale_fill_continuous(type = \"viridis\")"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"initial-emulator-construction","dir":"Articles","previous_headings":"","what":"Initial emulator construction","title":"Bayesian Optimization","text":"ensure reproducibility vignette, set seed using set_seed() function package: Next, generate initial design 20 points using maximin Latin hypercube sampler: construct initial DGP surrogate model Shubert function:","code":"set_seed(99) X <- maximinLHS(20, 2) Y <- shubert(X) m <- dgp(X, Y, name = 'matern2.5') ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:02<00:00, 249.19it/s] ## Imputing ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"bayesian-optimization-using-expected-improvement-ei","dir":"Articles","previous_headings":"","what":"Bayesian optimization using Expected Improvement (EI)","title":"Bayesian Optimization","text":"begin Bayesian optimization design(), first need define Expected Improvement (EI) acquisition function, adhering rules specified method argument design(): ei function defined takes emulator first argument, object, along additional arguments: limits, two-column matrix first column specifies lower bounds second column specifies upper bounds input dimensions, n_starts, defines number multi-start points used search location corresponding minimum (negative) EI. can, course, replace ei acquisition function, provided adheres rules method argument design() (see ?design details). track identified minimum value Shubert function Bayesian optimization, define monitor function, opt_monitor, passed eval argument design(): domain input Shubert function, within global minima searched Bayesian optimization, defined [0,1]2[0,1]^2: ingredients ready, can now run Bayesian optimization using design() 80 iterations: Bayesian optimization, dynamic pruning mechanism transitioned DGP emulator GP emulator iteration 6, leading faster optimizations remaining iterations maintaining emulator’s quality. 80 iterations, identified minimum Shubert function value -186.7286, close global minimum -186.7309. can inspect progress minima search conducted design() applying draw() m: figure shows Bayesian optimization using (D)GP emulator quickly identifies low value Shubert function within 5 iterations. Notably, lowest value, -186.7286, achieved design() 48 iterations. can also inspect locations identified process applying draw() m type = 'design': figure illustrates Bayesian optimization successfully identifies regions around two global minima, represented red inverted triangles, adding design points concentrated near two locations.","code":"ei <- function(object, limits, n_starts = 10, ...) { # Expected Improvement (EI) function ei_function <- function(x) { x <- matrix(x, nrow = 1) # Extract mean and variance from the 'object' pred <- predict(object, x, ...)$results mu <- pred$mean sigma <- sqrt(pred$var) # Handle numerical precision issues with very small sigma values sigma[sigma < 1e-10] <- 1e-10 # Best observed minimum value best_value <- min(object$data$Y) # Calculate improvement improvement <- best_value - mu # Calculate Expected Improvement (EI) z <- improvement / sigma ei <- improvement * pnorm(z) + sigma * dnorm(z) ei <- ifelse(ei < 0, 0, ei) # Ensure non-negative EI return(-ei) # Return negative EI because `optim()` minimizes by default } # Number of input dimensions num_dims <- nrow(limits) # Generate initial points using Latin Hypercube Sampling (LHS) lhd_samples <- maximinLHS(n_starts, num_dims) lhd_points <- sapply(1:num_dims, function(i) { limits[i, 1] + lhd_samples[, i] * (limits[i, 2] - limits[i, 1]) }) # Perform optimization with multiple starts using `optim()` results <- lapply(1:n_starts, function(i) { optim( par = lhd_points[i, ], fn = ei_function, method = \"L-BFGS-B\", lower = limits[, 1], upper = limits[, 2] ) }) # Find the result with the minimum (most negative) EI best_result <- results[[which.min(sapply(results, `[[`, \"value\"))]] # Return the next best point `x` as a single-row matrix return(matrix(best_result$par, nrow = 1)) } opt_monitor <- function(object) { return(min(object$data$Y)) } lim <- rbind(c(0, 1), c(0, 1)) m <- design(m, N = 80, limits = lim, f = shubert, method = ei, eval = opt_monitor) ## Initializing ... done ## * Metric: -125.203479 ## Iteration 1: ## - Locating ... done ## * Next design point: 0.352375 0.142570 ## - Updating and re-fitting ... done ## - Validating ... done ## * Metric: -125.203479 ## ## ... ## ## Iteration 6: ## - Locating ... done ## * Next design point: 0.299331 0.125606 ## - Updating and re-fitting ... done ## - Transiting to a GP emulator ... done ## - Validating ... done ## * Metric: -186.039545 ## ## ... ## ## Iteration 80: ## - Locating ... done ## * Next design point: 0.907645 0.000000 ## - Updating and re-fitting ... done ## - Validating ... done ## * Metric: -186.728582 draw(m) + plot_annotation(title = 'Bayesian Optimization Tracker') + labs(y = \"Minimum Value\") + # Add a horizontal line to represent the global minimum for benchmarking geom_hline( aes(yintercept = y, linetype = \"Global Minimum\"), # Global minimum data = data.frame(y = -186.7309), color = \"#E31A1C\", size = 0.5 ) + scale_linetype_manual( values = c(\"Global Minimum\" = \"dashed\"), name = \"\" # Remove the legend title ) draw(m, type = 'design') + plot_annotation(title = 'Bayesian Optimization Design') + # Highlight the global minima on the design plot geom_point( data = data.frame( .panel_x = c(\"X1\", \"X2\"), # x labels of panels .panel_y = c(\"X2\", \"X1\"), # y labels of panels X1 = c(0.1437, 0.2999), # X1 values for the global minima X2 = c(0.2999, 0.1437) # X2 values for the global minima ), aes(x = .panel_x, y = .panel_y), size = 1.25, shape = 6, color = \"#E31A1C\" )"},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/classification.html","id":"load-packages-and-data","dir":"Articles","previous_headings":"","what":"Load packages and data","title":"DGP Classification\n","text":"start loading required packages, now load iris data set, re-scale four input variables [0,1][0,1]. building classifier, set seed set_seed() package reproducibility split data training testing:","code":"library(dgpsi) library(dplyr) data(iris) iris <- iris %>% mutate(across(1:4, ~ (. - min(.)) / (max(.) - min(.)))) set_seed(9999) test_idx <- sample(seq_len(nrow(iris)), size = 30) train_data <- iris[-test_idx, ] test_data <- iris[test_idx, ] X_train <- as.matrix(train_data[, 1:4]) Y_train <- as.matrix(train_data[, 5]) X_test <- as.matrix(test_data[, 1:4]) Y_test <- as.matrix(test_data[, 5])"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/classification.html","id":"construct-and-train-a-dgp-classifier","dir":"Articles","previous_headings":"","what":"Construct and train a DGP classifier","title":"DGP Classification\n","text":"consider three-layer DGP classifier, using Matérn-2.5 kernel first layer squared exponential kernel second layer: Visualizing DGP object helps clarify layered structure non-Gaussian (case categorical) likelihoods. global inputs, 3-layered DGP comprised 2 hidden layers containing GPs, “likelihood layer” transforms preceding GP nodes one parameters required likelihood function. example, 3 possible categories use softmax link function, 3 parameters set second layer 3 GP nodes, one .","code":"m_dgp <- dgp(X_train, Y_train, depth = 3, name = c('matern2.5', 'sexp'), likelihood = \"Categorical\") ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:31<00:00, 15.63it/s] ## Imputing ... done summary(m_dgp)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/classification.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"DGP Classification\n","text":"now ready validate classifier via validate() 30 --sample testing positions: Finally, visualize OOS validation classifier: default, plot() displays true labels predicted label proportions input position. Alternatively, setting style = 2 plot() generates confusion matrix:","code":"m_dgp <- validate(m_dgp, X_test, Y_test) ## Initializing the OOS ... done ## Calculating the OOS ... done ## Saving results to the slot 'oos' in the dgp object ... done plot(m_dgp, X_test, Y_test) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done plot(m_dgp, X_test, Y_test, style = 2) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"load-the-package","dir":"Articles","previous_headings":"","what":"Load the package","title":"A Quick Guide to dgpsi","text":"","code":"library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"set-up-the-step-function","dir":"Articles","previous_headings":"","what":"Set up the step function","title":"A Quick Guide to dgpsi","text":"dgpsi provides function init_py() helps us set , initialize, re-install, uninstall underlying Python environment. run init_py() every time dgpsi loaded manually initiate Python environment. Alternatively, activate Python environment simply executing function dgpsi. example, Python environment automatically loaded run set_seed() package specify seed reproducibility: Define step function: generate ten training data points:","code":"set_seed(9999) f <- function(x) { if (x < 0.5) return(-1) if (x >= 0.5) return(1) } X <- seq(0, 1, length = 10) Y <- sapply(X, f)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"training","dir":"Articles","previous_headings":"","what":"Training","title":"A Quick Guide to dgpsi","text":"now build train DGP emulator three layers: progress bar displayed shows long takes finish training. able switch progress bar trace information setting verb = FALSE. Note want train DGP emulator m additional iterations, can simply m <- continue(m) instead rebuilding DGP emulator. trained DGP emulator can visualized using summary() function: visualization gives key information trained DGP emulator. Note auto-generated emulator nugget terms fixed 1e-6 GP nodes emulating deterministic step function (.e., like emulator interpolate training data points). prior scales (.e., variances) GP nodes first second layers fixed 1.0 GP node final layer estimated due attachment output. information change default settings construct train DGP emulator, see ?dgp. point, use write() save emulator m local file load using read() like make predictions emulator, e.g., another computer also package installed.","code":"m <- dgp(X, Y, depth = 3) ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:03<00:00, 148.10it/s] ## Imputing ... done summary(m)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"A Quick Guide to dgpsi","text":"emulator, can validate drawing validation plots. two types validation plots provided package. first one Leave-One-(LOO) cross validation plot: second validation plot --Sample (OOS) validation plot requires --sample testing data set. generate OOS data set contains 10 testing data points: can now perform OOS validation: Note style argument plot() function can used draw different types plot (see ?plot).","code":"plot(m) ## Validating and computing ... done ## Post-processing LOO results ... done ## Plotting ... done oos_x <- sample(seq(0, 1, length = 200), 10) oos_y <- sapply(oos_x, f) plot(m,oos_x,oos_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"prediction","dir":"Articles","previous_headings":"","what":"Prediction","title":"A Quick Guide to dgpsi","text":"validation done, can make predictions DGP emulator. generate 200 data points step function [0,1][0,1]: predict locations: predict() function returns updated DGP emulator m contains slot named results gives posterior predictive means variances testing positions. can extract information plot emulation results check predictive performance constructed DGP emulator:","code":"test_x <- seq(0, 1, length = 200) test_y <- sapply(test_x, f) m <- predict(m, x = test_x) mu <- m$results$mean # extract the predictive means sd <- sqrt(m$results$var) # extract the predictive variance and compute the predictive standard deviations # compute predictive bounds which are two predictive standard deviations above and below the predictive means up <- mu + 2*sd lo <- mu - 2*sd plot(test_x, mu, type = 'l', lty = 2, lwd = 1.5, col = 'black', xlab = 'x', cex.axis = 1.3, cex.lab = 1.3, ylab = 'y', ylim = c(-1.5,1.5)) # predictive means polygon(c(test_x, rev(test_x)), c(up,rev(lo)), col = 'grey80', border = F) # credible interval lines(test_x, test_y, type = 'l', col = \"#D55E00\", lwd = 2) # Underlying truth lines(test_x, mu, type = 'l', lty = 2, lwd = 1.5, col = 'black') lines(X, Y, type = 'p', pch = 16, cex = 1, col = \"#0072B2\") # Training data points"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Large-Scale DGP Emulation\n","text":"","code":"library(dgpsi) library(lhs)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"construct-a-synthetic-simulator","dir":"Articles","previous_headings":"","what":"Construct a synthetic simulator","title":"Large-Scale DGP Emulation\n","text":"consider 2-dimensional synthetic simulator following functional form defined [0, 1] [0, 1]: now specify seed set_seed() package reproducibility generate 3000 training data points:","code":"f <- function(x) { x1 <- x[,1,drop=F] * 4 -2 x2 <- x[,2,drop=F] * 4 -2 y <- 0.5 + ((sin(x1^2-x2^2))^2 - 0.5)/(1 + 0.001*(x1^2+x2^2))^2 return(y) } set_seed(9999) X <- randomLHS(3000, 2) Y <- f(X)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"training","dir":"Articles","previous_headings":"","what":"Training","title":"Large-Scale DGP Emulation\n","text":"now build train large-scale DGP emulator using Vecchia implementation Stochastic Imputation (SI) framework:","code":"m <- dgp(X, Y, vecchia = TRUE) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 200: Layer 2: 100%|██████████| 200/200 [02:20<00:00, 1.43it/s] ## Imputing ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"Large-Scale DGP Emulation\n","text":"emulator, can validate Leave-One-(LOO) cross validation plot: --Sample (OOS) validation plot 1000 randomly generated testing locations: Note gp() can also operate Vecchia mode. problem, using m_gp <- gp(X, Y, vecchia = TRUE), found GP emulator m_gp achieved half NRMSE DGP emulator m, points outside credible intervals.","code":"plot(m) ## Validating and computing ... done ## Post-processing LOO results ... done ## Plotting ... done oos_x <- randomLHS(1000, 2) oos_y <- f(oos_x) plot(m, oos_x, oos_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"performance-tip","dir":"Articles","previous_headings":"Validation","what":"Performance tip","title":"Large-Scale DGP Emulation\n","text":"Vecchia implementation package leverages multiple cores available machine multi-thread computation. optimize performance, recommend experimenting number threads using set_thread_num(). current number threads used package can checked get_thread_num().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"load-the-package","dir":"Articles","previous_headings":"","what":"Load the package","title":"Linked (D)GP Emulation","text":"","code":"library(ggplot2) library(patchwork) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"construct-a-synthetic-system","dir":"Articles","previous_headings":"","what":"Construct a synthetic system","title":"Linked (D)GP Emulation","text":"consider following synthetic system involves three models defined : specify seed set_seed() package reproducibility generate 10 training data points Model 1 15 training data points Model 2 3:","code":"# Model 1 f1 <- function(x) { (sin(7.5*x)+1)/2 } # Model 2 f2 <- function(x) { 2/3*sin(2*(2*x - 1))+4/3*exp(-30*(2*(2*x-1))^2)-1/3 } # Model 3 f3 <- function(x) { x[1]*x[2]^2 } # Linked Model f123 <- function(x) { f3(c(f1(x),f2(f1(x)))) } set_seed(999) # Training data for Model 1 X1 <- seq(0, 1, length = 10) Y1 <- sapply(X1, f1) # Training data for Model 2 X2 <- seq(0, 1, length = 15) Y2 <- sapply(X2, f2) # Training data for Model 3 X3 <- cbind(X2, Y2) Y3 <- apply(X3, f3, MARGIN = 1)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-model-1","dir":"Articles","previous_headings":"","what":"Emulation of Model 1","title":"Linked (D)GP Emulation","text":"construct train GP emulator Matérn-2.5 kernel ID gp1: now validate trained GP emulator plot() LOO (alternatively, one can first use validate() store LOO results plotting plot()):","code":"m1 <- gp(X1, Y1, name = \"matern2.5\", id = \"gp1\") ## Auto-generating a GP structure ... done ## Initializing the GP emulator ... done ## Training the GP emulator ... done plot(m1) ## Validating and computing ... done ## Post-processing LOO results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-model-2","dir":"Articles","previous_headings":"","what":"Emulation of Model 2","title":"Linked (D)GP Emulation","text":"construct two-layered DGP emulator Matérn-2.5 kernels emulate Model 2: set ID gp2 using set_id() function: following plot visualizes LOO trained DGP emulator m2:","code":"m2 <- dgp(X2, Y2, depth = 2, name = \"matern2.5\") ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 264.72it/s] ## Imputing ... done m2 <- set_id(m2, \"gp2\") plot(m2) Validating and computing ... done Post-processing LOO results ... done Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-model-3","dir":"Articles","previous_headings":"","what":"Emulation of Model 3","title":"Linked (D)GP Emulation","text":"now construct three-layered DGP emulator Matérn-2.5 kernels emulate Model 3: following plot visualizes LOO trained DGP emulator m3:","code":"m3 <- dgp(X3, Y3, depth = 3, name = \"matern2.5\", id = \"gp3\" ) ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:04<00:00, 104.80it/s] ## Imputing ... done plot(m3) Validating and computing ... done Post-processing LOO results ... done Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-linked-model","dir":"Articles","previous_headings":"","what":"Emulation of Linked Model","title":"Linked (D)GP Emulation","text":"GP emulator m1 (Model 1), DGP emulator m2 (Model 2), DGP emulator m3 (Model 3) hand, now ready build linked emulator first defining data frame struc: struc data frame defines feed-forward connection structure three emulators linked system. row represents one--one connection output dimension (From_Output) source emulator (From_Emulator) input dimension (To_Input) target emulator (To_Emulator). example: - first row specifies global input (denoted Global)’s first dimension (column) connected first input dimension emulator gp1. - second row indicates first output dimension emulator gp1 connected first input dimension emulator gp2. Finally, can pass struc list three trained emulators lgp() create linked emulator. order emulators list matter: activating linked emulator prediction, ’s good practice first inspect structure emulator: visually check relationships emulators applying summary() m_link: everything looks correct, can activate linked emulator prediction: comparison, construct GP emulator whole system generating 15 training data points Model 1 Model 2: Finally, validate GP emulator linked emulator 300 testing data points [0,1][0,1]: plot compare performance: see linked emulator outperforms GP emulator significantly better mean prediction uncertainty quantification. real-life applications, rarely able generate many testing data points underlying computer simulators evaluate emulators whole input space. However, still able retain available realizations computer simulators validation. Say able afford 20 runs linked computer system: , can conduct OOS validation GP emulator: linked emulator: show linked emulator outperforms GP emulator significantly better predictive accuracy lower NRMSE.","code":"struc <- data.frame(From_Emulator = c(\"Global\", \"gp1\", \"gp1\", \"gp2\"), To_Emulator = c(\"gp1\", \"gp2\", \"gp3\", \"gp3\"), From_Output = c(1, 1, 1, 1), To_Input = c(1, 1, 1, 2)) struc ## From_Emulator To_Emulator From_Output To_Input ## 1 Global gp1 1 1 ## 2 gp1 gp2 1 1 ## 3 gp1 gp3 1 1 ## 4 gp2 gp3 1 2 emulators <- list(m1, m2, m3) m_link <- lgp(struc, emulators, activate = FALSE) Processing emulators ... done Linking and synchronizing emulators ... done summary(m_link) m_link <- lgp(struc, emulators, activate = TRUE) Processing emulators ... done Linking and synchronizing emulators ... done Activating the linked emulator ... done X_gp <- seq(0, 1, length = 15) Y_gp <- sapply(X_gp, f123) m_gp <- gp(X_gp, Y_gp, name = 'matern2.5') ## Auto-generating a GP structure ... done ## Initializing the GP emulator ... done ## Training the GP emulator ... done # Testing input test_x <- seq(0, 1, length = 300) # Testing output test_y <- sapply(test_x, f123) # Validate GP emulator m_gp <- validate(m_gp, x_test = test_x, y_test = test_y, verb = F) # Validate linked emulator m_link <- validate(m_link, x_test = test_x, y_test = test_y, verb = F) # GP emulator plot(m_gp, x_test = test_x, y_test = test_y, type = 'line', verb = F) + plot_annotation(title = 'GP Emulator', theme = theme(plot.title = element_text(hjust = 0.5))) # Linked emulator plot(m_link, x_test = test_x, y_test = test_y, type = 'line', verb = F) + plot_annotation(title = 'Linked Emulator', theme = theme(plot.title = element_text(hjust = 0.5))) # OOS testing input test_x_oos <- sample(seq(0, 1, length = 300), 20) # OOS testing output test_y_oos <- sapply(test_x_oos, f123) plot(m_gp, test_x_oos, test_y_oos, style = 2) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done plot(m_link, test_x_oos, test_y_oos, style = 2) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/motorcycle.html","id":"load-packages-and-data","dir":"Articles","previous_headings":"","what":"Load packages and data","title":"Non-Gaussian Emulation","text":"start loading packages: now load training data points, scale , plot : constructing emulator, first specify seed set_seed() package reproducibility split training data set testing data set:","code":"library(dgpsi) library(MASS) library(ggplot2) library(patchwork) X <- mcycle$times Y <- mcycle$accel X <- (X - min(X))/(max(X)-min(X)) Y <- scale(Y, center = TRUE, scale = TRUE) ggplot(data = data.frame(X = X, Y = Y), aes(x = X, y = Y)) + geom_point(shape = 16, size = 3) + labs(x = \"Time\", y = \"Acceleration\") + theme(axis.title = element_text(size = 13), axis.text = element_text(size = 13)) set_seed(9999) test_idx <- sample(seq_len(length(X)), size = 20) train_X <- X[-test_idx] train_Y <- Y[-test_idx,] test_x <- X[test_idx] test_y <- Y[test_idx,]"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/motorcycle.html","id":"construct-and-train-a-dgp-emulator","dir":"Articles","previous_headings":"","what":"Construct and train a DGP emulator","title":"Non-Gaussian Emulation","text":"consider three-layered DGP emulator squared exponential kernels heteroskedastic likelihood: choose heteroskedastic Gaussian likelihood setting likelihood = \"Hetero\" since data drawn plot show varying noise. can use summary() visualize structure specifications trained DGP emulator: comparison, also build GP emulator (gp()) incorporates homogeneous noise setting nugget_est = T initial nugget value 0.010.01: can also summarize trained GP emulator summary():","code":"m_dgp <- dgp(train_X, train_Y, depth = 3, likelihood = \"Hetero\") ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:14<00:00, 35.52it/s] ## Imputing ... done summary(m_dgp) m_gp <- gp(train_X, train_Y, nugget_est = T, nugget = 1e-2) ## Auto-generating a GP structure ... done ## Initializing the GP emulator ... done ## Training the GP emulator ... done summary(m_gp)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/motorcycle.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"Non-Gaussian Emulation","text":"now ready validate emulators via validate() 20 --sample testing positions generated earlier: Note using validate() plotting can save subsequent computations compared simply invoking plot(), validate() stores validation results emulator objects plot() use , can, avoid calculating fly. Finally, plot OOS validation GP emulator: DGP emulator: Note still need provide test_x test_y plot() even already provided validate(). Otherwise, plot() draw LOO cross validation plot. visualizations show DGP emulator gives better performance GP emulator modeling heteroskedastic noise embedded underlying data set, even though quite similar NRMSEs.","code":"m_dgp <- validate(m_dgp, test_x, test_y) ## Initializing the OOS ... done ## Calculating the OOS ... done ## Saving results to the slot 'oos' in the dgp object ... done m_gp <- validate(m_gp, test_x, test_y) ## Initializing the OOS ... done ## Calculating the OOS ... done ## Saving results to the slot 'oos' in the gp object ... done plot(m_gp, test_x, test_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done plot(m_dgp, test_x, test_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Sequential Design I","text":"","code":"library(tidyverse) library(lhs) library(ggplot2) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"construct-a-synthetic-simulator","dir":"Articles","previous_headings":"","what":"Construct a synthetic simulator","title":"Sequential Design I","text":"consider non-stationary synthetic simulator 2-dimensional input functional form (Ba Joseph 2018) defined : Note provide simulator sequential design , defined function input x output matrices. commands generate contour function: can see figure synthetic simulator exhibits fluctuations bottom left input space top-right part, simulator shows little variation. now specify seed set_seed() reproducibility generate initial design 5 design points using maximin Latin hypercube sampler: track qualities constructed emulators sequential design, generate validation dataset:","code":"f <- function(x) { sin(1/((0.7*x[,1,drop=F]+0.3)*(0.7*x[,2,drop=F]+0.3))) } x1 <- seq(0, 1, length.out = 100) x2 <- seq(0, 1, length.out = 100) dat <- expand_grid(x1 = x1, x2 = x2) dat <- mutate(dat, f = f(cbind(x1, x2))) ggplot(dat, aes(x1, x2, fill = f)) + geom_tile() + scale_fill_continuous(type = \"viridis\") set_seed(99) X <- maximinLHS(5,2) Y <- f(X) validate_x <- maximinLHS(200,2) validate_y <- f(validate_x)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"dgp-emulation-with-sequential-designs","dir":"Articles","previous_headings":"","what":"DGP emulation with sequential designs","title":"Sequential Design I","text":"start sequential design, initialize two-layered DGP emulator (2 GP nodes first layer 1 GP node second layer) using generated initial design: specify boundaries input parameter space f sequential design can restrict search new points. limits input parameters defined matrix row giving lower upper limits input parameter. boundaries specified, ready conduct sequential design adaptively improve emulator, m, via design(). function design() provides simple flexible implementation sequential design emulation. vignette, demonstrate basic usage refer users ?design advanced specification, e.g., checkpoints manually control design progress schedules re-fit validate emulators. illustrative purpose, implement two waves sequential design m: first wave see 1 GP node removed first layer automatic pruning DGP leaves one node first second layer DGP hierarchy respectively. helps accelerate inference DGP emulator subsequent waves sequential design maintaining accuracy. now start second wave sequential design: Finally, resume second wave 10 additional iterations: Resuming rather adding additional wave can useful feature, particularly plotting using draw(). sequential design done, can inspect enriched design applying draw() m: can seen figure added design points concentrate bottom-left corner input space simulator f exhibits variation thus needs data well-emulated. can also visualize improvement RMSE sequential design:","code":"m <- dgp(X, Y) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 353.90it/s] ## Imputing ... done lim_1 <- c(0, 1) lim_2 <- c(0, 1) lim <- rbind(lim_1, lim_2) # 1st wave with 25 steps m <- design(m, N = 25, limits = lim, f = f, x_test = validate_x, y_test = validate_y) ## Initializing ... done ## * RMSE: 0.527337 ## Iteration 1: ## - Locating ... done ## * Next design point: 0.930278 0.033542 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.532428 ## ## ... ## ## Iteration 18: ## - Locating ... done ## * Next design point: 0.706449 0.048681 ## - Updating and re-fitting ... done ## - Pruning 1 node(s) in layer 1 ... done ## - Re-fitting ... done ## - Validating ... done ## * RMSE: 0.139819 ## ## ... ## ## Iteration 25: ## - Locating ... done ## * Next design point: 0.000010 0.483511 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.071370 # 2nd wave with 10 steps m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) ## Initializing ... done ## * RMSE: 0.071370 ## Iteration 1: ## - Locating ... done ## * Next design point: 0.461239 0.415336 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.056827 ## ## ... ## ## Iteration 10: ## - Locating ... done ## * Next design point: 0.177935 0.459387 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.011508 # 2nd wave with 10 additional steps m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, new_wave = FALSE) ## Iteration 11: ## - Locating ... done ## * Next design point: 0.029874 0.763962 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.014444 ## ## ... ## ## Iteration 20: ## - Locating ... done ## * Next design point: 0.829788 0.452129 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.004783 draw(m, 'design') draw(m, 'rmse')"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"comparison-to-dgp-emulators-with-space-filling-designs","dir":"Articles","previous_headings":"","what":"Comparison to DGP emulators with space-filling designs","title":"Sequential Design I","text":"build four DGP emulators static space-filling Latin hypercube designs (LHD) size 10, 20, 30, 40, 50 respectively: extract RMSEs add sequential design validation plot (log-scale) comparison: can seen plot static space-filling designs, quality emulator may improved design size increases. increasing size space-filling design may capture regions simulator exhibits variation, thus cause emulators higher RMSEs constructed sequential design.","code":"# DGP emulator with a LHD of size 10 X1 <- maximinLHS(10,2) Y1 <- f(X1) m1 <- dgp(X1, Y1, verb = F) # DGP emulator with a LHD of size 20 X2 <- maximinLHS(20,2) Y2 <- f(X2) m2 <- dgp(X2, Y2, verb = F) # DGP emulator with a LHD of size 30 X3 <- maximinLHS(30,2) Y3 <- f(X3) m3 <- dgp(X3, Y3, verb = F) # DGP emulator with a LHD of size 40 X4 <- maximinLHS(40,2) Y4 <- f(X4) m4 <- dgp(X4, Y4, verb = F) # DGP emulator with a LHD of size 50 X5 <- maximinLHS(50,2) Y5 <- f(X5) m5 <- dgp(X5, Y5, verb = F) # validation of the DGP emulator with the LHD of size 10 m1 <- validate(m1, x_test = validate_x, y_test = validate_y, verb = F) rmse1 <- m1$oos$rmse # validation of the DGP emulator with the LHD of size 20 m2 <- validate(m2, x_test = validate_x, y_test = validate_y, verb = F) rmse2 <- m2$oos$rmse # validation of the DGP emulator with the LHD of size 30 m3 <- validate(m3, x_test = validate_x, y_test = validate_y, verb = F) rmse3 <- m3$oos$rmse # validation of the DGP emulator with the LHD of size 40 m4 <- validate(m4, x_test = validate_x, y_test = validate_y, verb = F) rmse4 <- m4$oos$rmse # validation of the DGP emulator with the LHD of size 50 m5 <- validate(m5, x_test = validate_x, y_test = validate_y, verb = F) rmse5 <- m5$oos$rmse # create a dataframe that stores the RMSEs of the four DGP emulators rmse_static <- data.frame('N' = c(10, 20, 30, 40, 50), 'rmse' = c(rmse1, rmse2, rmse3, rmse4, rmse5), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30', 'lhd-40', 'lhd-50')) draw(m, 'rmse', log = T) + geom_point(data = rmse_static, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(2, 3, 4, 8, 15))"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"see-also","dir":"Articles","previous_headings":"Comparison to DGP emulators with space-filling designs","what":"See also","title":"Sequential Design I","text":"See Sequential Design II sequential design bundle DGP emulators automatic terminations.","code":""},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Sequential Design II","text":"","code":"library(lhs) library(ggplot2) library(patchwork) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"construct-a-synthetic-simulator","dir":"Articles","previous_headings":"","what":"Construct a synthetic simulator","title":"Sequential Design II","text":"construct synthetic simulator one-dimensional input [0, 1] three-dimensional output. Note function defined way input, x, output matrices. following figure shows true functional forms three outputs simulator [0,1][0, 1]: now specify seed set_seed() package reproducibility generate initial design 5 design points using maximin Latin hypercube sampler: generate validation dataset track stop sequential design:","code":"f <- function(x) { y1 = sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) y2 = 1/3*sin(2*(2*x - 1))+2/3*exp(-30*(2*(2*x-1))^2)+1/3 y3 = (sin(7.5*x)+1)/2 return(cbind(y1, y2, y3)) } dense_x <- seq(0, 1, length = 200) dense_y <- f(dense_x) output1 <- data.frame('x' = dense_x, 'y' = dense_y[,1]) output2 <- data.frame('x' = dense_x, 'y' = dense_y[,2]) output3 <- data.frame('x' = dense_x, 'y' = dense_y[,3]) p1 <- ggplot(data = output1, aes(x = x, y = y)) + geom_line(color = 'dodgerblue2') + ggtitle('Output 1') + theme(plot.title = element_text(size = 10)) p2 <- ggplot(data = output2, aes(x = x, y = y)) + geom_line(color = '#E31A1C') + ggtitle('Output 2') + theme(plot.title = element_text(size = 10)) p3 <- ggplot(data = output3, aes(x = x, y = y)) + geom_line(color = 'green4') + ggtitle('Output 3') + theme(plot.title = element_text(size = 10)) wrap_plots(list(p1, p2, p3)) + plot_annotation(title = 'Synthetic Simulator') set_seed(9999) X <- maximinLHS(5, 1) Y <- f(X) validate_x <- maximinLHS(200, 1) validate_y <- f(validate_x)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"construct-a-bundle-of-dgp-emulators","dir":"Articles","previous_headings":"","what":"Construct a bundle of DGP emulators","title":"Sequential Design II","text":"start sequential design, build three DGP emulators emulate three outputs simulator f independently: Note global connection turned first two DGP emulators found yields better emulation performance. build bundle three DGP emulators using pack():","code":"m1 <- dgp(X, Y[,1], connect = F) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 335.63it/s] ## Imputing ... done m2 <- dgp(X, Y[,2], connect = F) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 294.20it/s] ## Imputing ... done m3 <- dgp(X, Y[,3]) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 387.69it/s] ## Imputing ... done m <- pack(m1, m2, m3)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"sequential-design-for-the-emulator-bundle","dir":"Articles","previous_headings":"","what":"Sequential design for the emulator bundle","title":"Sequential Design II","text":"begin sequential design, first specify limit input: set target RMSE stop sequential design: choose 0.01 equivalent 1% normalized error given ranges outputs [0,1]. can set different targets different outputs, e.g., setting target <- c(0.005, 0.02, 0.01). start first-wave sequential design 10 steps: can seen first step, DGP emulator third output already reached target, refinements (.e., additions design points third DGP emulator) performed remaining steps. end first wave, DGP emulators first second outputs yet reached target. point, can proceed second wave repeating command . However, demonstrate alternative approach , define aggregation function (applicable built-method functions design()). function aggregates criterion scores across three outputs, ensuring design points added three emulators step, instead selecting different design points emulator. Using aggregation approach can advantageous different outputs exhibit similar behavior respect input, reduces number simulations required iteration. However, outputs behave differently, may effective add distinct design points emulator achieve lower errors quickly. define aggregation function g compute weighted average scores: Since third emulator already reached target, assign zero weights weights 0.6 0.4 first second emulators respectively: now pass aggregate function, g(), weight argument design() second wave sequential design 15 steps: first second emulators reached target iteration 8 5 second wave, respectively. sequential design points three emulators can plotted draw(): figure shows , first emulator, design points added 0.5, second emulator, design points concentrated around 0.5. third emulator, resulting design space-filling. design point distributions align functional complexities three outputs. However, second wave, uses aggregation function, additional points added 0.5 second emulator due higher weight assigned first emulator. points may necessary second output, functional behavior require refinement region. observation aligns earlier argument using aggregation function add design points outputs differing behaviors may always effective.","code":"lim <- c(0, 1) target <- 0.01 # 1st wave of the sequential design with 10 steps m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, target = target) ## Initializing ... done ## * RMSE: 0.383722, RMSE: 0.154689, RMSE: 0.008984 ## Iteration 1: ## - Locating ... done ## * Next design point (Emulator1): 0.207895 ## * Next design point (Emulator2): 0.235873 ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.337517, RMSE: 0.155087, RMSE: 0.008984 ## ## ... ## ## Iteration 10: ## - Locating ... done ## * Next design point (Emulator1): 0.430889 ## * Next design point (Emulator2): 0.479682 ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.120320, RMSE: 0.062365, RMSE: 0.008984 ## Targets not reached for all emulators at the end of the sequential design. g <- function(x, weight){ x[,1] <- x[,1]*weight[1] x[,2] <- x[,2]*weight[2] x[,3] <- x[,3]*weight[3] return(rowSums(x)) } weight <- c(0.6, 0.4, 0) # 2nd wave with 15 steps m <- design(m, N = 15, limits = lim, f = f, x_test = validate_x, y_test = validate_y, aggregate = g, target = 0.01, weight = weight) ## Initializing ... done ## * RMSE: 0.120320, RMSE: 0.062365, RMSE: 0.008984 ## Iteration 1: ## - Locating ... done ## * Next design point (Emulator1): 0.062821 ## * Next design point (Emulator2): 0.062821 ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.151946, RMSE: 0.061865, RMSE: 0.008984 ## ## ... ## ## Iteration 6: ## - Locating ... done ## * Next design point (Emulator1): 0.233155 ## * Next design point (Emulator2): None (target reached) ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.014147, RMSE: 0.004410, RMSE: 0.008984 ## ## ... ## ## Iteration 8: ## - Locating ... done ## * Next design point (Emulator1): 0.009688 ## * Next design point (Emulator2): None (target reached) ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.005913, RMSE: 0.004410, RMSE: 0.008984 Target reached! Sequential design stopped at step 8. draw(m, 'design')"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"comparison-to-dgp-emulators-with-space-filling-designs","dir":"Articles","previous_headings":"","what":"Comparison to DGP emulators with space-filling designs","title":"Sequential Design II","text":"build three independent DGP emulators three outputs static space-filling Latin hypercube designs (LHD) size 10, 20, 30 respectively: extract RMSEs add sequential design validation plot (log-scale) comparison: can seen plot sequential design efficient batch space-filling design, achieving similar RMSE fat fewer design points, particularly first emulator bundle.","code":"# DGP emulators with a LHD of size 10 X1 <- maximinLHS(10, 1) Y1 <- f(X1) m11 <- dgp(X1, Y1[,1], connect = F, verb = F) m12 <- dgp(X1, Y1[,2], connect = F, verb = F) m13 <- dgp(X1, Y1[,3], verb = F) # DGP emulator with a LHD of size 20 X2 <- maximinLHS(20, 1) Y2 <- f(X2) m21 <- dgp(X2, Y2[,1], connect = F, verb = F) m22 <- dgp(X2, Y2[,2], connect = F, verb = F) m23 <- dgp(X2, Y2[,3], verb = F) # DGP emulator with a LHD of size 30 X3 <- maximinLHS(30, 1) Y3 <- f(X3) m31 <- dgp(X3, Y3[,1], connect = F, verb = F) m32 <- dgp(X3, Y3[,2], connect = F, verb = F) m33 <- dgp(X3, Y3[,3], verb = F) # validations of the first DGP emulator m11 <- validate(m11, x_test = validate_x, y_test = validate_y[,1], verb = F) m21 <- validate(m21, x_test = validate_x, y_test = validate_y[,1], verb = F) m31 <- validate(m31, x_test = validate_x, y_test = validate_y[,1], verb = F) rmse_static_1 <- data.frame('N' = c(10, 20, 30), 'rmse' = c(m11$oos$rmse, m21$oos$rmse, m31$oos$rmse), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30')) # validations of the second DGP emulator m12 <- validate(m12, x_test = validate_x, y_test = validate_y[,2], verb = F) m22 <- validate(m22, x_test = validate_x, y_test = validate_y[,2], verb = F) m32 <- validate(m32, x_test = validate_x, y_test = validate_y[,2], verb = F) rmse_static_2 <- data.frame('N' = c(10, 20, 30), 'rmse' = c(m12$oos$rmse, m22$oos$rmse, m32$oos$rmse), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30')) # # validations of the third DGP emulator m13 <- validate(m13, x_test = validate_x, y_test = validate_y[,3], verb = F) m23 <- validate(m23, x_test = validate_x, y_test = validate_y[,3], verb = F) m33 <- validate(m33, x_test = validate_x, y_test = validate_y[,3], verb = F) rmse_static_3 <- data.frame('N' = c(10, 20, 30), 'rmse' = c(m13$oos$rmse, m23$oos$rmse, m33$oos$rmse), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30')) p <- draw(m, type = 'rmse', log = T) p[[1]] <- p[[1]] + geom_point(data = rmse_static_1, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(3, 4, 8)) p[[2]] <- p[[2]] + geom_point(data = rmse_static_2, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(3, 4, 8)) p[[3]] <- p[[3]] + geom_point(data = rmse_static_3, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(3, 4, 8)) p"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"see-also","dir":"Articles","previous_headings":"Comparison to DGP emulators with space-filling designs","what":"See also","title":"Sequential Design II","text":"See Sequential Design sequential design automatic structure simplification DGP emulator 2D simulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Deyu Ming. Author, maintainer, copyright holder. Daniel Williamson. Author.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Ming, D. Guillas, S. (2021) Linked Gaussian process emulation systems computer models using Matérn kernels adaptive design, SIAM/ASA Journal Uncertainty Quantification. 9(4), 1615-1642. Ming, D., Williamson, D., Guillas, S. (2023) Deep Gaussian process emulation using stochastic imputation, Technometrics. (65)2, 150-161. Ming, D. Williamson, D. (2023) Linked deep Gaussian process emulation model networks, arXiv:2306.01212. Ming, D. Williamson, D. (2024) dgpsi: R package powered Python modelling linked deep Gaussian processes, R package version 2.4.0. https://CRAN.R-project.org/package=dgpsi.","code":"@Article{, title = {Linked Gaussian process emulation for systems of computer models using Matérn kernels and adaptive design}, author = {Deyu Ming and Serge Guillas}, journal = {SIAM/ASA Journal on Uncertainty Quantification}, year = {2021}, volume = {9}, number = {4}, pages = {1615--1642}, } @Article{, title = {Deep Gaussian process emulation using stochastic imputation}, author = {Deyu Ming and Daniel Williamson and Serge Guillas}, journal = {Technometrics}, year = {2023}, volume = {65}, number = {2}, pages = {150--161}, } @Unpublished{, title = {Linked deep Gaussian process emulation for model networks}, author = {Deyu Ming and Daniel Williamson}, note = {arXiv:2306.01212}, year = {2023}, } @Manual{, title = {dgpsi: An R package powered by Python for modelling linked deep Gaussian processes}, author = {Deyu Ming and Daniel Williamson}, note = {R package version 2.4.0}, url = {https://CRAN.R-project.org/package=dgpsi}, year = {2024}, }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"dgpsi-","dir":"","previous_headings":"","what":"R Interface to dgpsi","title":"R Interface to dgpsi","text":"R package dgpsi provides R interface Python package dgpsi deep linked Gaussian process emulations using stochastic imputation (SI). Hassle-free Python Setup don’t need prior knowledge Python start using package, need single click R (see Installation section ) automatically installs activates required Python environment !","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"R Interface to dgpsi","text":"dgpsi currently following features: Gaussian process emulations separable non-separable squared exponential Matérn-2.5 kernels. multiple layers; multiple GP nodes; separable non-separable squared exponential Matérn-2.5 kernels; global input connections; non-Gaussian likelihoods (Poisson, Negative-Binomial, heteroskedastic Gaussian, Categorical). Linked emulations feed-forward systems computer models linking (D)GP emulators deterministic individual computer models. Fast Leave-One-(LOO) --Sample (OOS) validations GP, DGP, linked (D)GP emulators. Multi-core predictions validations GP, DGP, Linked (D)GP emulators. Sequential designs (D)GP emulators bundles (D)GP emulators. Automatic pruning DGP emulators, statically dynamically. Large-scale GP, DGP, Linked (D)GP emulations. Scalable DGP classification using Stochastic Imputation. Bayesian optimization.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"R Interface to dgpsi","text":"Check Quick Guide dgpsi get started package. experimental features, check website development version.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R Interface to dgpsi","text":"can install package CRAN: development version GitHub: installation, run load package. install activate required Python environment automatically, can either run dgpsi::init_py() explicitly simply call function package. ’s - package ready use! Note loading dgpsi, package may take time compile initiate underlying Python environment first time function dgpsi executed. subsequent function calls won’t require re-compiling re-activation Python environment, faster. experience Python related issues using package, please try reinstall Python environment: uninstall completely Python environment: reinstall:","code":"install.packages('dgpsi') devtools::install_github('mingdeyu/dgpsi-R') library(dgpsi) dgpsi::init_py(reinstall = T) dgpsi::init_py(uninstall = T) dgpsi::init_py()"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"research-notice","dir":"","previous_headings":"","what":"Research Notice","title":"R Interface to dgpsi","text":"package part ongoing research initiative. detailed information research aspects guidelines use, please refer Research Notice.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"R Interface to dgpsi","text":"Ming, D. Williamson, D. (2023) Linked deep Gaussian process emulation model networks. arXiv:2306.01212 Ming, D., Williamson, D., Guillas, S. (2023) Deep Gaussian process emulation using stochastic imputation. Technometrics. 65(2), 150-161. Ming, D. Guillas, S. (2021) Linked Gaussian process emulation systems computer models using Matérn kernels adaptive design, SIAM/ASA Journal Uncertainty Quantification. 9(4), 1615-1642.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"function searches candidate set locate next design point(s) added (D)GP emulator bundle (D)GP emulators using Active Learning MacKay (ALM) criterion (see reference ).","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"","code":"alm(object, ...) # S3 method for class 'gp' alm( object, x_cand = NULL, n_start = 20, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, ... ) # S3 method for class 'dgp' alm( object, x_cand = NULL, n_start = 20, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... ) # S3 method for class 'bundle' alm( object, x_cand = NULL, n_start = 20, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. ... arguments (names different arguments used alm()) used aggregate can passed . x_cand matrix (row design point column input dimension) gives candidate set next design point(s) determined. object instance bundle class aggregate supplied, x_cand can also list. list must length equal number emulators object, element matrix representing candidate set corresponding emulator bundle. Defaults NULL. n_start integer gives number initial design points used determine next design point(s). argument used x_cand NULL. Defaults 20. batch_size integer gives number design points chosen. Defaults 1. M size conditioning set Vecchia approximation criterion calculation. argument used emulator object constructed Vecchia approximation. Defaults 50. workers number processes used design point selection. set NULL, number processes set max physical cores available %/% 2. Defaults 1. argument currently support Windows machines aggregate function provided, due significant overhead caused initializing Python environment worker spawning. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. argument used x_cand = NULL. Defaults NULL. int bool vector bools indicates input dimension integer type. single bool given, applied input dimensions. vector provided, length equal input dimensions applied individual input dimensions. argument used x_cand = NULL. Defaults FALSE. aggregate R function aggregates scores ALM across different output dimensions (object instance dgp class) across different emulators (object instance bundle class). function specified following basic form: first argument matrix representing scores. rows matrix correspond different design points. number columns matrix equal : emulator output dimension object instance dgp class; number emulators contained object object instance bundle class. output vector gives aggregate scores different design points. Set NULL disable aggregation. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"x_cand NULL: object instance gp class, vector length batch_size returned, containing positions (row numbers) next design points x_cand. object instance dgp class, vector length batch_size * D returned, containing positions (row numbers) next design points x_cand added DGP emulator. D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, matrix returned batch_size rows column emulator bundle, containing positions (row numbers) next design points x_cand individual emulators. x_cand NULL: object instance gp class, matrix batch_size rows returned, giving next design points evaluated. object instance dgp class, matrix batch_size * D rows returned, : D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, list returned length equal number emulators bundle. element list matrix batch_size rows, row represents design point added corresponding emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"first column matrix supplied first argument aggregate must correspond first output dimension DGP emulator object instance dgp class, subsequent columns dimensions. object instance bundle class, first column must correspond first emulator bundle, subsequent columns emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"MacKay, D. J. (1992). Information-based objective functions active data selection. Neural Computation, 4(4), 590-604.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 1D non-stationary function f <- function(x) { sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # training a 2-layered DGP emulator with the global connection off m <- dgp(X, Y, connect = F) # specify the input range lim <- c(0,1) # locate the next design point using ALM X_new <- alm(m, limits = lim) # obtain the corresponding output at the located design point Y_new <- f(X_new) # combine the new input-output pair to the existing data X <- rbind(X, X_new) Y <- rbind(Y, Y_new) # update the DGP emulator with the new input and output data and refit m <- update(m, X, Y, refit = TRUE) # plot the LOO validation plot(m) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine layers — combine","title":"Combine layers — combine","text":"function deprecated removed next release, simply wrapper list() function. construct linked (D)GP structures, please use updated lgp() function, provides simpler efficient approach building (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine layers — combine","text":"","code":"combine(...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine layers — combine","text":"... sequence lists. list represents system layer contains emulators (produced gp() dgp()) layer.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine layers — combine","text":"list defining linked (D)GP structure passed struc lgp().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Combine layers — combine","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":null,"dir":"Reference","previous_headings":"","what":"Continue training a DGP emulator — continue","title":"Continue training a DGP emulator — continue","text":"function implements additional training iterations DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Continue training a DGP emulator — continue","text":"","code":"continue( object, N = NULL, cores = 1, ess_burn = 10, verb = TRUE, burnin = NULL, B = NULL )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Continue training a DGP emulator — continue","text":"object instance dgp class. N additional number iterations train DGP emulator. set NULL, number iterations set 500 DGP emulator constructed without Vecchia approximation, set 200 Vecchia approximation used. Defaults NULL. cores number processes used optimize GP components (layer) M-step training. set NULL, number processes set (max physical cores available - 1) DGP emulator constructed without Vecchia approximation. Otherwise, number processes set max physical cores available %/% 2. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. ess_burn number burnin steps ESS-within-Gibbs -step training. Defaults 10. verb bool indicating progress bar printed training. Defaults TRUE. burnin number training iterations discarded point estimates calculation. Must smaller overall training iterations -far implemented. specified, last 25% iterations used. overrides value burnin set dgp(). Defaults NULL. B number imputations produce predictions. Increase value account imputation uncertainty. overrides value B set dgp() B NULL. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Continue training a DGP emulator — continue","text":"updated object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Continue training a DGP emulator — continue","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Continue training a DGP emulator — continue","text":"One can also use function fit untrained DGP emulator constructed dgp() training = FALSE. following slots: loo oos created validate(); results created predict() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Continue training a DGP emulator — continue","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":null,"dir":"Reference","previous_headings":"","what":"Restore the serialized emulator — deserialize","title":"Restore the serialized emulator — deserialize","text":"function restores serialized emulator created serialize().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restore the serialized emulator — deserialize","text":"","code":"deserialize(object)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restore the serialized emulator — deserialize","text":"object serialized object emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restore the serialized emulator — deserialize","text":"S3 class GP emulator, DGP emulator, linked (D)GP emulator, bundle (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Restore the serialized emulator — deserialize","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Restore the serialized emulator — deserialize","text":"See Note section serialize().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restore the serialized emulator — deserialize","text":"","code":"if (FALSE) { # \\dontrun{ library(future) library(future.apply) library(dgpsi) # model f <- function(x) { (sin(7.5*x)+1)/2 } # training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # train a DGP emulator m <- dgp(X, Y, name = \"matern2.5\") # testing input data X_dgp <- seq(0, 1, length = 100) # serialize the DGP emulator m_serialized <- serialize(m) # start a multi-session with three cores for parallel predictions plan(multisession, workers = 3) # perform parallel predictions results <- future_lapply(1:length(X_dgp), function(i) { m_deserialized <- deserialize(m_serialized) mean_i <- predict(m_deserialized, X_dgp[i])$results$mean }, future.seed = TRUE) # reset the future plan to sequential plan(sequential) # combine mean predictions pred_mean <- do.call(rbind, results) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":null,"dir":"Reference","previous_headings":"","what":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"function implements sequential design active learning (D)GP emulator bundle (D)GP emulators, supporting array popular methods well user-specified approaches. can also used wrapper Bayesian optimization methods.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"","code":"design( object, N, x_cand, y_cand, n_sample, n_cand, limits, f, reps, freq, x_test, y_test, reset, target, method, batch_size, eval, verb, autosave, new_wave, M_val, cores, ... ) # S3 method for class 'gp' design( object, N, x_cand = NULL, y_cand = NULL, n_sample = 200, n_cand = lifecycle::deprecated(), limits = NULL, f = NULL, reps = 1, freq = c(1, 1), x_test = NULL, y_test = NULL, reset = FALSE, target = NULL, method = vigf, batch_size = 1, eval = NULL, verb = TRUE, autosave = list(), new_wave = TRUE, M_val = 50, cores = 1, ... ) # S3 method for class 'dgp' design( object, N, x_cand = NULL, y_cand = NULL, n_sample = 200, n_cand = lifecycle::deprecated(), limits = NULL, f = NULL, reps = 1, freq = c(1, 1), x_test = NULL, y_test = NULL, reset = FALSE, target = NULL, method = vigf, batch_size = 1, eval = NULL, verb = TRUE, autosave = list(), new_wave = TRUE, M_val = 50, cores = 1, train_N = NULL, refit_cores = 1, pruning = TRUE, control = list(), ... ) # S3 method for class 'bundle' design( object, N, x_cand = NULL, y_cand = NULL, n_sample = 200, n_cand = lifecycle::deprecated(), limits = NULL, f = NULL, reps = 1, freq = c(1, 1), x_test = NULL, y_test = NULL, reset = FALSE, target = NULL, method = vigf, batch_size = 1, eval = NULL, verb = TRUE, autosave = list(), new_wave = TRUE, M_val = 50, cores = 1, train_N = NULL, refit_cores = 1, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. N number iterations sequential design. x_cand matrix (row design point column input dimension) gives candidate set next design points determined. Defaults NULL. y_cand matrix (row simulator evaluation column output dimension) gives realizations simulator input positions x_cand. Defaults NULL. n_sample integer gives size sub-set sampled candidate set x_cand step sequential design determine next design point, x_cand NULL. Defaults 200. n_cand argument deprecated. Use n_sample instead. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. Set limits = NULL x_cand supplied. argument used x_cand supplied, .e., x_cand = NULL. Defaults NULL. provide custom method function argument called limits, value limits passed function. f R function representing simulator. f must adhere following rules: First argument: matrix rows correspond different design points, columns represent input dimensions. Function output: matrix rows correspond different outputs (matching input design points) columns represent output dimensions. one output dimension, function return matrix single column. alternatively, list : first element output matrix described . additional named elements can optionally update values arguments matching names passed via .... list output useful additional arguments f, method, eval need updated sequential design iteration. See Note section additional details. argument required must supplied y_cand = NULL. Defaults NULL. reps integer gives number repetitions located design points created used evaluations f. Set argument integer greater 1 f stochastic function can generate different responses given input supplied emulator object can deal stochastic responses, e.g., (D)GP emulator nugget_est = TRUE DGP emulator likelihood layer. argument used f supplied. Defaults 1. freq vector two integers first element indicating number iterations taken re-estimating emulator hyperparameters, second element defining number iterations take re-calculation evaluating metrics validation set (see x_test ) via eval function. Defaults c(1, 1). x_test matrix (row input testing data point column input dimension) gives testing input data evaluate emulator freq[2] iterations sequential design. Set NULL LOO-based emulator validation. Defaults NULL. argument used eval = NULL. y_test testing output data corresponding x_test emulator validation freq[2] iterations sequential design: object instance gp class, y_test matrix one column row contains testing output data point corresponding row x_test. object instance dgp class, y_test matrix rows containing testing output data points corresponding rows x_test columns representing output dimensions. object instance bundle class, y_test matrix row representing outputs corresponding row x_test column representing output different emulators bundle. Set NULL LOO-based emulator validation. Defaults NULL. argument used eval = NULL. reset bool vector bools indicating whether reset hyperparameters emulator(s) initial values (set initial construction) re-fitting. re-fitting occurs based frequency specified freq[1]. option useful hyperparameters suspected converged local optimum affecting validation performance. single bool provided, applies every iteration sequential design. vector provided, length must equal N (even re-fit frequency specified freq[1] 1) apply corresponding iterations sequential design. Defaults FALSE. target number vector specifying target evaluation metric value(s) sequential design terminate. Defaults NULL, case sequential design stops N steps. See Note section details target. method R function determines next design points evaluated f. function must adhere following rules: First argument: emulator object, can one following: instance gp class (produced gp()); instance dgp class (produced dgp()); instance bundle class (produced pack()). Second argument (x_cand NULL): candidate matrix representing set potential design points method function selects next points. Function output: x_cand NULL: gp dgp objects, output must vector row indices corresponding selected design points candidate matrix (second argument). bundle objects, output must matrix containing row indices selected design points candidate matrix. column corresponds indices individual emulator bundle. x_cand NULL: gp dgp objects, output must matrix row represents new design point added. bundle objects, output must list length equal number emulators bundle. element list matrix rows represent new design points corresponding emulator. See alm(), mice(), vigf() examples built-method functions. Defaults vigf(). batch_size integer specifying number design points select single iteration. Defaults 1. argument used built-method functions alm(), mice(), vigf(). provide custom method function argument named batch_size, value batch_size passed function. eval R function computes customized metric evaluating emulator performance. function must adhere following rules: First argument: emulator object, can one following: instance gp class (produced gp()); instance dgp class (produced dgp()); instance bundle class (produced pack()). Function output: gp objects, output must single metric value. dgp objects, output can single metric value vector metric values length equal number output dimensions. bundle objects, output can single metric value vector metric values length equal number emulators bundle. custom function provided, built-evaluation metric (RMSE log-loss, case DGP emulators categorical likelihoods) used. Defaults NULL. See Note section additional details. verb bool indicating trace information printed sequential design. Defaults TRUE. autosave list contains configuration settings automatic saving emulator: switch: bool indicating whether enable automatic saving emulator sequential design. set TRUE, emulator final iteration always saved. Defaults FALSE. directory: string specifying directory path emulators stored. Emulators stored sub-directory directory named 'emulator-id'. Defaults './check_points'. fname: string representing base name saved emulator files. Defaults 'check_point'. save_freq: integer indicating frequency automatic saves, measured number iterations. Defaults 5. overwrite: bool value controlling file saving behavior. set TRUE, new automatic save overwrites previous one, keeping latest version. FALSE, automatic save creates new file, preserving previous versions. Defaults FALSE. new_wave bool indicating whether current call design() create new wave sequential designs add next sequence designs recent wave. argument relevant waves already exist emulator. Creating new waves can improve visualization sequential design performance across different calls design() via draw(), allows specifying different evaluation frequency freq. However, disabling option can help limit number waves visualized draw() avoid issues running distinct colors large numbers waves. Defaults TRUE. M_val integer gives size conditioning set Vecchia approximation emulator validations. argument used emulator object constructed Vecchia approximation. Defaults 50. cores integer gives number processes used emulator validation. set NULL, number processes set max physical cores available %/% 2. Defaults 1. argument used eval = NULL. ... arguments names differ used design() required f, method, eval can passed . design() forward relevant arguments f, method, eval based names additional arguments provided. train_N number training iterations used re-fitting DGP emulator step sequential design: train_N integer, DGP emulator re-fitted step (based re-fit frequency specified freq[1]) using train_N iterations. train_N vector, length must N, even re-fit frequency specified freq[1] 1. train_N NULL, DGP emulator re-fitted step (based re-fit frequency specified freq[1]) using: 100 iterations DGP emulator constructed without Vecchia approximation, 50 iterations Vecchia approximation used. Defaults NULL. refit_cores number processes used re-fit GP components (layer DGP emulator) M-step re-fitting. set NULL, number processes set (max physical cores available - 1) DGP emulator constructed without Vecchia approximation. Otherwise, number processes set max physical cores available %/% 2. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. pruning bool indicating dynamic pruning DGP structures implemented sequential design total number design points exceeds min_size control. argument applicable DGP emulators (.e., object instance dgp class) produced dgp(). Defaults TRUE. control list can supply following components control dynamic pruning DGP emulator: min_size, minimum number design points required trigger dynamic pruning. Defaults 10 times number input dimensions. threshold, \\(R^2\\) value GP node considered redundant. Defaults 0.97. nexceed, minimum number consecutive iterations \\(R^2\\) value GP node must exceed threshold trigger removal node DGP structure. Defaults 3. argument used pruning = TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"updated object returned slot called design contains: S slots, named wave1, wave2,..., waveS, contain information S waves sequential design applied emulator. slot contains following elements: N, integer gives numbers iterations implemented corresponding wave; rmse, matrix providing evaluation metric values emulators constructed corresponding wave, eval = NULL. row matrix represents iteration. object class gp, matrix contains single column RMSE values. object class dgp without categorical likelihood, row contains mean/median squared errors corresponding different output dimensions. object class dgp categorical likelihood, matrix contains single column log-loss values. object class bundle, row contains either mean/median squared errors log-loss values emulators bundle. metric: matrix providing values custom evaluation metrics, computed user-supplied eval function, emulators constructed corresponding wave. freq, integer gives frequency emulator validations implemented corresponding wave. enrichment, vector size N gives number new design points added step sequential design (object instance gp dgp class), matrix gives number new design points added emulators bundle step sequential design (object instance bundle class). target NULL, following additional elements also included: target: target evaluating metric computed eval built-function stop sequential design. reached: indicates whether target reached end sequential design: bool object instance gp dgp class. vector bools object instance bundle class, length determined follows: equal number emulators bundle eval = NULL. equal length output eval custom eval function provided. slot called type gives type validation: either LOO ('loo') OOS ('oos') eval = NULL. See validate() information LOO OOS. 'customized' customized R function provided eval. two slots called x_test y_test contain data points OOS validation type slot 'oos'. y_cand = NULL x_cand supplied, NAs returned supplied f sequential design, slot called exclusion included records located design positions produced NAs via f. sequential design use information avoid re-visiting locations later runs design(). See Note section information.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"Validation emulator forced final step sequential design even N multiple second element freq. loo oos slot already exists object cleaned, new slot called loo oos created returned object depending whether x_test y_test provided. new slot gives validation information emulator constructed final step sequential design. See validate() information slots loo oos. object previously used design() sequential design, information current wave sequential design replace old waves contained returned object, unless validation type (LOO OOS depending whether x_test y_test supplied ) current wave sequential design validation types (shown type design slot object) previous waves, validation type OOS, x_test y_test current wave must also identical previous waves; current previous waves sequential design supply customized evaluation functions eval. Users need ensure customized evaluation functions consistent among different waves. Otherwise, trace plot RMSEs produced draw() show values different evaluation metrics different waves. two cases, information current wave sequential design added design slot returned object name waveS. object instance gp class eval = NULL, matrix rmse slot single-columned. object instance dgp bundle class eval = NULL, matrix rmse slot can multiple columns correspond different output dimensions different emulators bundle. object instance gp class eval = NULL, target needs single value giving RMSE threshold. object instance dgp bundle class eval = NULL, target can vector values gives thresholds evaluating metrics different output dimensions different emulators. single value provided, used threshold output dimensions (object instance dgp) emulators (object instance bundle). customized function supplied eval target given vector, user needs ensure length target equal output eval. defining f, important ensure : column order first argument f consistent training input used emulator; column order output matrix f consistent order emulator output dimensions (object instance dgp class), order emulators placed object (object instance bundle class). output matrix produced f may include NAs. especially beneficial allows sequential design process continue without interruption, even errors NA outputs encountered f certain input locations identified sequential design. Users ensure errors within f handled appropriately returning NAs. defining eval, output metric needs positive draw() used log = T. one needs ensure lower metric value indicates better emulation performance target set.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 2D non-stationary function that takes a matrix as the input f <- function(x) { sin(1/((0.7*x[,1,drop=F]+0.3)*(0.7*x[,2,drop=F]+0.3))) } # generate the initial design X <- maximinLHS(5,2) Y <- f(X) # generate the validation data validate_x <- maximinLHS(30,2) validate_y <- f(validate_x) # training a 2-layered DGP emulator with the initial design m <- dgp(X, Y) # specify the ranges of the input dimensions lim_1 <- c(0, 1) lim_2 <- c(0, 1) lim <- rbind(lim_1, lim_2) # 1st wave of the sequential design with 10 steps m <- design(m, N=10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) # 2nd wave of the sequential design with 10 steps m <- design(m, N=10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) # 3rd wave of the sequential design with 10 steps m <- design(m, N=10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) # draw the design created by the sequential design draw(m,'design') # inspect the trace of RMSEs during the sequential design draw(m,'rmse') # reduce the number of imputations for faster OOS m_faster <- set_imp(m, 5) # plot the OOS validation with the faster DGP emulator plot(m_faster, x_test = validate_x, y_test = validate_y) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":null,"dir":"Reference","previous_headings":"","what":"Deep Gaussian process emulator construction — dgp","title":"Deep Gaussian process emulator construction — dgp","text":"function builds trains DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deep Gaussian process emulator construction — dgp","text":"","code":"dgp( X, Y, depth = 2, node = ncol(X), name = \"sexp\", lengthscale = 1, bounds = NULL, prior = \"ga\", share = TRUE, nugget_est = FALSE, nugget = NULL, scale_est = TRUE, scale = 1, connect = TRUE, likelihood = NULL, training = TRUE, verb = TRUE, check_rep = TRUE, vecchia = FALSE, M = 25, ord = NULL, N = ifelse(vecchia, 200, 500), cores = 1, blocked_gibbs = TRUE, ess_burn = 10, burnin = NULL, B = 10, internal_input_idx = NULL, linked_idx = NULL, id = NULL )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deep Gaussian process emulator construction — dgp","text":"X matrix row input training data point column represents input dimension. Y matrix containing observed training output data. matrix rows output data points columns representing output dimensions. likelihood (see ) NULL, Y must matrix single column. depth number layers (including likelihood layer) DGP structure. depth must least 2. Defaults 2. node number GP nodes layer (except final layer layer feeding likelihood node) DGP. Defaults ncol(X). name character vector characters indicates kernel functions (either \"sexp\" squared exponential kernel \"matern2.5\" Matérn-2.5 kernel) used DGP emulator: single character supplied, corresponding kernel function used GP nodes DGP hierarchy. vector characters supplied, character vector specifies kernel function applied GP nodes corresponding layer. Defaults \"sexp\". lengthscale initial lengthscales GP nodes DGP emulator. can single numeric value vector: single numeric value, value applied initial lengthscales GP nodes DGP hierarchy. vector, element vector specifies initial lengthscales applied GP nodes corresponding layer. vector length depth likelihood = NULL length depth - 1 likelihood NULL. Defaults numeric value 1.0. bounds lower upper bounds lengthscales GP nodes. can vector matrix: vector, lower bound (first element vector) upper bound (second element vector) applied lengthscales GP nodes DGP hierarchy. matrix, row matrix specifies lower upper bounds lengthscales GP nodes corresponding layer. matrix row number equal depth likelihood = NULL depth - 1 likelihood NULL. Defaults NULL bounds specified lengthscales. prior prior used MAP estimation lengthscales nuggets GP nodes DGP hierarchy: gamma prior (\"ga\"), inverse gamma prior (\"inv_ga\"), jointly robust prior (\"ref\"). Defaults \"ga\". share bool indicating input dimensions GP node share common lengthscale. Defaults TRUE. nugget_est bool bool vector indicates nuggets GP nodes () final layer estimated. single bool provided, applied GP nodes () final layer. bool vector (must length ncol(Y)) provided, bool element vector applied corresponding GP node () final layer. value bool following effects: FALSE: nugget corresponding GP final layer fixed corresponding value defined nugget (see ). TRUE: nugget corresponding GP final layer estimated initial value given correspondence nugget (see ). Defaults FALSE. nugget initial nugget value(s) GP nodes () layer: single numeric value, value applied initial nugget GP nodes DGP hierarchy. vector, element vector specifies initial nugget applied GP nodes corresponding layer. vector length depth likelihood = NULL length depth - 1 likelihood NULL. Set nugget small value bools nugget_est FALSE deterministic emulation, emulator interpolates training data points. Set nugget larger value bools nugget_est TRUE stochastic emulation computer model outputs assumed follow homogeneous Gaussian distribution. Defaults 1e-6 nugget_est = FALSE 0.01 nugget_est = TRUE. likelihood NULL nugget_est = FALSE, nuggets GPs feed likelihood layer default 1e-4. scale_est bool bool vector indicates variance GP nodes () final layer estimated. single bool provided, applied GP nodes () final layer. bool vector (must length ncol(Y)) provided, bool element vector applied corresponding GP node () final layer. value bool following effects: FALSE: variance corresponding GP final layer fixed corresponding value defined scale (see ). TRUE: variance corresponding GP final layer estimated initial value given correspondence scale (see ). Defaults TRUE. scale initial variance value(s) GP nodes () final layer. single numeric value, applied GP nodes () final layer. vector (must length ncol(Y)), numeric vector applied corresponding GP node () final layer. Defaults 1. connect bool indicating whether implement global input connection DGP structure. Setting FALSE may produce better emulator cases cost slower training. Defaults TRUE. likelihood likelihood type DGP emulator: NULL: likelihood layer included emulator. \"Hetero\": heteroskedastic Gaussian likelihood layer added stochastic emulation computer model outputs assumed follow heteroskedastic Gaussian distribution (.e., computer model outputs input-dependent noise). \"Poisson\": Poisson likelihood layer added emulation computer model outputs counts Poisson distribution used model . \"NegBin\": negative Binomial likelihood layer added emulation computer model outputs counts negative Binomial distribution used capture dispersion variability input space. \"Categorical\": categorical likelihood layer added emulation (classification), computer model output categorical. likelihood NULL, value nugget_est overridden FALSE. Defaults NULL. training bool indicating initialized DGP emulator trained. set FALSE, dgp() returns untrained DGP emulator, one can apply summary() inspect specifications apply predict() check emulation performance training. Defaults TRUE. verb bool indicating trace information DGP emulator construction training printed function execution. Defaults TRUE. check_rep bool indicating whether check repetitions dataset, .e., one input position multiple outputs. Defaults TRUE. vecchia bool indicating whether use Vecchia approximation large-scale DGP emulator construction prediction. Defaults FALSE. M size conditioning set Vecchia approximation DGP emulator training. Defaults 25. ord R function returns ordering input GP node contained DGP emulator Vecchia approximation. function must satisfy following basic rules: first argument represents input GP node scaled lengthscales. output function vector indices gives ordering input GP node. ord = NULL, default random ordering used. Defaults NULL. N number iterations training. Defaults 500 vecchia = FALSE 200 vecchia = TRUE. argument used training = TRUE. cores number processes used optimize GP components (layer) M-step training. set NULL, number processes set (max physical cores available - 1) vecchia = FALSE max physical cores available %/% 2 vecchia = TRUE. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. blocked_gibbs bool indicating latent variables imputed layer-wise using ESS-within-Blocked-Gibbs. ESS-within-Blocked-Gibbs faster efficient ESS-within-Gibbs imputes latent variables node-wise reduces number components sampled Gibbs steps, especially large number GP nodes layers due higher input dimensions. Default TRUE. ess_burn number burnin steps ESS-within-Gibbs -step training. Defaults 10. argument used training = TRUE. burnin number training iterations discarded point estimates model parameters. Must smaller training iterations N. specified, last 25% iterations used. Defaults NULL. argument used training = TRUE. B number imputations used produce predictions. Increase value refine representation imputation uncertainty. Defaults 10. internal_input_idx argument removed next release. set connections emulators linked emulations, please use updated lgp() function instead. Column indices X generated linked emulators preceding layers. Set internal_input_idx = NULL DGP emulator first layer system columns X generated linked emulators preceding layers. Defaults NULL. linked_idx argument removed next release. set connections emulators linked emulation, please use updated lgp() function instead. Either vector list vectors: linked_idx vector, gives indices columns pooled output matrix (formed column-combined outputs emulators feeding layer) feed DGP emulator. length vector shall equal length internal_input_idx internal_input_idx NULL. DGP emulator first layer linked emulator system, vector gives column indices global input (formed column-combining input matrices emulators first layer) DGP emulator use. DGP emulator used first subsequent layers, one initially set linked_idx appropriate values situation emulator first layer. , use function set_linked_idx() reset linking information emulator first layer. DGP emulator first layer linked emulator system, linked_idx can list gives information connections DGP emulator emulators preceding layers. length list equal number layers DGP emulator. element list vector gives indices columns pooled output matrix (formed column-combined outputs emulators) corresponding layer feed DGP emulator. DGP emulator connections emulator certain layer, set NULL corresponding position list. order input dimensions X[,internal_input_idx] consistent linked_idx. example, DGP emulator 4th-layer fed output dimension 2 4 emulators layer 2 output dimension 1 3 emulators layer 3 linked_idx = list( NULL, c(2,4), c(1,2,3) ). addition, first second columns X[,internal_input_idx] correspond output dimensions 2 4 layer 2, third fifth columns X[,internal_input_idx] correspond output dimensions 1 3 layer 3. Set linked_idx = NULL DGP emulator used linked emulations. However, longer case, one can use set_linked_idx() add linking information DGP emulator. Defaults NULL. id ID assigned DGP emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Default NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deep Gaussian process emulator construction — dgp","text":"S3 class named dgp contains five slots: id: number character string assigned id argument. data: list contains two elements: X Y training input output data respectively. specs: list contains L (.e., number layers DGP hierarchy) sub-lists named layer1, layer2,..., layerL. sub-list contains D (.e., number GP/likelihood nodes corresponding layer) sub-lists named node1, node2,..., nodeD. sub-list corresponds likelihood node, contains one element called type gives name (Hetero, Poisson, NegBin, Categorical) likelihood node. sub-list corresponds GP node, contains four elements: kernel: type kernel function used GP node. lengthscales: vector lengthscales kernel function. scale: variance value kernel function. nugget: nugget value kernel function. internal_dims: column indices X correspond linked emulators preceding layers linked system. slot removed next release. external_dims: column indices X correspond global inputs linked system emulators. shown FALSE internal_input_idx = NULL. slot removed next release. linked_idx: value passed argument linked_idx. shown FALSE argument linked_idx NULL. slot removed next release. seed: random seed generated produce imputations. information stored reproducibility DGP emulator (saved write() light option light = TRUE) loaded back R read(). B: number imputations used generate emulator. vecchia: whether Vecchia approximation used GP emulator training. M: size conditioning set Vecchia approximation DGP emulator training. M generated vecchia = TRUE. constructor_obj: 'python' object stores information constructed DGP emulator. container_obj: 'python' object stores information linked emulation. emulator_obj: 'python' object stores information predictions DGP emulator. returned dgp object can used predict() DGP predictions. continue() additional DGP training iterations. validate() LOO OOS validations. plot() validation plots. lgp() linked (D)GP emulator constructions. window() model parameter trimming. summary() summarize trained DGP emulator. write() save DGP emulator .pkl file. set_imp() change number imputations. design() sequential design. update() update DGP emulator new inputs outputs. alm(), mice(), vigf() locate next design points.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Deep Gaussian process emulator construction — dgp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Deep Gaussian process emulator construction — dgp","text":"R vector detected X Y treated column vector automatically converted single-column R matrix. Thus, X single data point multiple dimensions, must given matrix.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deep Gaussian process emulator construction — dgp","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # construct a step function f <- function(x) { if (x < 0.5) return(-1) if (x >= 0.5) return(1) } # generate training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # set a random seed set_seed(999) # training a DGP emulator m <- dgp(X, Y) # continue for further training iterations m <- continue(m) # summarizing summary(m) # trace plot trace_plot(m) # trim the traces of model parameters m <- window(m, 800) # LOO cross validation m <- validate(m) plot(m) # prediction test_x <- seq(0, 1, length = 200) m <- predict(m, x = test_x) # OOS validation validate_x <- sample(test_x, 10) validate_y <- sapply(validate_x, f) plot(m, validate_x, validate_y) # write and read the constructed emulator write(m, 'step_dgp') m <- read('step_dgp') } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgpsi-package.html","id":null,"dir":"Reference","previous_headings":"","what":"dgpsi: Interface to 'dgpsi' for Deep and Linked Gaussian Process Emulations — dgpsi-package","title":"dgpsi: Interface to 'dgpsi' for Deep and Linked Gaussian Process Emulations — dgpsi-package","text":"Interface 'python' package 'dgpsi' Gaussian process, deep Gaussian process, linked deep Gaussian process emulations computer models networks using stochastic imputation (SI). implementations follow Ming & Guillas (2021) doi:10.1137/20M1323771 Ming, Williamson, & Guillas (2023) doi:10.1080/00401706.2022.2124311 Ming & Williamson (2023) doi:10.48550/arXiv.2306.01212 . get started package, see https://mingdeyu.github.io/dgpsi-R/.","code":""},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgpsi-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"dgpsi: Interface to 'dgpsi' for Deep and Linked Gaussian Process Emulations — dgpsi-package","text":"Maintainer: Deyu Ming deyu.ming.16@ucl.ac.uk [copyright holder] Authors: Daniel Williamson d.williamson@exeter.ac.uk","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":null,"dir":"Reference","previous_headings":"","what":"Validation and diagnostic plots for a sequential design — draw","title":"Validation and diagnostic plots for a sequential design — draw","text":"function draws diagnostic validation plots sequential design (D)GP emulator bundle (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validation and diagnostic plots for a sequential design — draw","text":"","code":"draw(object, ...) # S3 method for class 'gp' draw(object, type = \"rmse\", log = FALSE, ...) # S3 method for class 'dgp' draw(object, type = \"rmse\", log = FALSE, ...) # S3 method for class 'bundle' draw(object, type = \"rmse\", log = FALSE, emulator = NULL, ...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validation and diagnostic plots for a sequential design — draw","text":"object can one following emulator classes: S3 class gp. S3 class dgp. S3 class bundle. ... N/. type specifies type plot visualization generate: \"rmse\": generates trace plot RMSEs, log-losses DGP emulators categorical likelihoods, custom evaluation metrics specified via \"eval\" argument [design()] function. \"design\": shows visualizations input designs created sequential design procedure. Defaults \"rmse\". log bool indicating whether plot RMSEs, log-losses (DGP emulators categorical likelihoods), custom evaluation metrics log scale type = \"rmse\". Defaults FALSE. emulator index vector indices emulators packed object. argument used object instance bundle class. set NULL, emulators bundle drawn. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validation and diagnostic plots for a sequential design — draw","text":"patchwork object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validation and diagnostic plots for a sequential design — draw","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validation and diagnostic plots for a sequential design — draw","text":"","code":"if (FALSE) { # \\dontrun{ # See design() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of threads — get_thread_num","title":"Get the number of threads — get_thread_num","text":"function gets number threads used parallel computations involved package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of threads — get_thread_num","text":"","code":"get_thread_num()"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of threads — get_thread_num","text":"number threads.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get the number of threads — get_thread_num","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Gaussian process emulator construction — gp","title":"Gaussian process emulator construction — gp","text":"function builds trains GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gaussian process emulator construction — gp","text":"","code":"gp( X, Y, name = \"sexp\", lengthscale = rep(0.1, ncol(X)), bounds = NULL, prior = \"ref\", nugget_est = FALSE, nugget = ifelse(nugget_est, 0.01, 1e-08), scale_est = TRUE, scale = 1, training = TRUE, verb = TRUE, vecchia = FALSE, M = 25, ord = NULL, internal_input_idx = NULL, linked_idx = NULL, id = NULL )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gaussian process emulator construction — gp","text":"X matrix row input data point column input dimension. Y matrix one column row output data point. name kernel function used. Either \"sexp\" squared exponential kernel \"matern2.5\" Matérn-2.5 kernel. Defaults \"sexp\". lengthscale initial values lengthscales kernel function. can single numeric value vector length ncol(X): single numeric value, assumed kernel functions across input dimensions share lengthscale; vector, assumed kernel functions across input dimensions different lengthscales. Defaults vector 0.1. bounds lower upper bounds lengthscales kernel function. vector length two first element lower bound second element upper bound. bounds applied lengthscales kernel function. Defaults NULL bounds specified lengthscales. prior prior used Maximum Posterior lengthscales nugget GP: gamma prior (\"ga\"), inverse gamma prior (\"inv_ga\"), jointly robust prior (\"ref\"). Defaults \"ref\". See reference jointly robust prior. nugget_est bool indicating nugget term estimated: FALSE: nugget term fixed nugget. TRUE: nugget term estimated. Defaults FALSE. nugget initial nugget value. nugget_est = FALSE, assigned value fixed training. Set nugget small value (e.g., 1e-8) corresponding bool nugget_est FALSE deterministic computer models emulator interpolate training data points. Set nugget larger value corresponding bool nugget_est TRUE stochastic emulation computer model outputs assumed follow homogeneous Gaussian distribution. Defaults 1e-8 nugget_est = FALSE 0.01 nugget_est = TRUE. scale_est bool indicating variance estimated: FALSE: variance fixed scale. TRUE: variance term estimated. Defaults TRUE. scale initial variance value. scale_est = FALSE, assigned value fixed training. Defaults 1. training bool indicating initialized GP emulator trained. set FALSE, gp() returns untrained GP emulator, one can apply summary() inspect specification apply predict() check emulation performance training. Defaults TRUE. verb bool indicating trace information GP emulator construction training printed function execution. Defaults TRUE. vecchia bool indicating whether use Vecchia approximation large-scale GP emulator construction prediction. Defaults FALSE. Vecchia approximation implemented GP emulation largely follows Katzfuss et al. (2022). See reference . M size conditioning set Vecchia approximation GP emulator training. Defaults 25. ord R function returns ordering input GP emulator Vecchia approximation. function must satisfy following basic rules: first argument represents input scaled lengthscales. output function vector indices gives ordering input GP emulator. ord = NULL, default random ordering used. Defaults NULL. internal_input_idx column indices X generated linked emulators preceding layers. Set internal_input_idx = NULL GP emulator first layer system columns X generated linked emulators preceding layers. Defaults NULL. argument removed next release. set connections emulators linked emulations, please use updated lgp() function instead. linked_idx Either vector list vectors: linked_idx vector, gives indices columns pooled output matrix (formed column-combined outputs emulators feeding layer) feed GP emulator. length vector shall equal length internal_input_idx internal_input_idx NULL. GP emulator first layer linked emulator system, vector gives column indices global input (formed column-combining input matrices emulators first layer) GP emulator use. GP emulator used first subsequent layers, one initially set linked_idx appropriate values situation emulator first layer. , use function set_linked_idx() reset linking information emulator first layer. GP emulator first layer linked emulator system, linked_idx can list gives information connections GP emulator emulators preceding layers. length list equal number layers GP emulator. element list vector gives indices columns pooled output matrix (formed column-combined outputs emulators) corresponding layer feed GP emulator. GP emulator connections emulator certain layer, set NULL corresponding position list. order input dimensions X[,internal_input_idx] consistent linked_idx. example, GP emulator second layer fed output dimension 1 3 emulators layer 1 linked_idx = list( c(1,3) ). addition, first second columns X[,internal_input_idx] correspond output dimensions 1 3 layer 1. Set linked_idx = NULL GP emulator used linked emulations. However, longer case, one can use set_linked_idx() add linking information GP emulator. Defaults NULL. argument removed next release. set connections emulators linked emulations, please use updated lgp() function instead. id ID assigned GP emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Default NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gaussian process emulator construction — gp","text":"S3 class named gp contains five slots: id: number character string assigned id argument. data: list contains two elements: X Y training input output data respectively. specs: list contains seven elements: kernel: type kernel function used. Either \"sexp\" squared exponential kernel \"matern2.5\" Matérn-2.5 kernel. lengthscales: vector lengthscales kernel function. scale: variance value kernel function. nugget: nugget value kernel function. internal_dims: column indices X correspond linked emulators preceding layers linked system. slot removed next release. external_dims: column indices X correspond global inputs linked system emulators. shown FALSE internal_input_idx = NULL. slot removed next release. linked_idx: value passed argument linked_idx. shown FALSE argument linked_idx NULL. slot removed next release. vecchia: whether Vecchia approximation used GP emulator training. M: size conditioning set Vecchia approximation GP emulator training. constructor_obj: 'python' object stores information constructed GP emulator. container_obj: 'python' object stores information linked emulation. emulator_obj: 'python' object stores information predictions GP emulator. returned gp object can used predict() GP predictions. validate() LOO OOS validations. plot() validation plots. lgp() linked (D)GP emulator constructions. summary() summarize trained GP emulator. write() save GP emulator .pkl file. design() sequential designs. update() update GP emulator new inputs outputs. alm(), mice(), vigf() locate next design points.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gaussian process emulator construction — gp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Gaussian process emulator construction — gp","text":"R vector detected X Y treated column vector automatically converted single-column R matrix. Thus, X single data point multiple dimensions, must given matrix.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Gaussian process emulator construction — gp","text":"Gu, M. (2019). Jointly robust prior Gaussian stochastic process emulation, calibration variable selection. Bayesian Analysis, 14(3), 857-885. Katzfuss, M., Guinness, J., & Lawrence, E. (2022). Scaled Vecchia approximation fast computer-model emulation. SIAM/ASA Journal Uncertainty Quantification, 10(2), 537-554.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gaussian process emulator construction — gp","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # construct a step function f <- function(x) { if (x < 0.5) return(-1) if (x >= 0.5) return(1) } # generate training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # training m <- gp(X, Y) # summarizing summary(m) # LOO cross validation m <- validate(m) plot(m) # prediction test_x <- seq(0, 1, length = 200) m <- predict(m, x = test_x) # OOS validation validate_x <- sample(test_x, 10) validate_y <- sapply(validate_x, f) plot(m, validate_x, validate_y) # write and read the constructed emulator write(m, 'step_gp') m <- read('step_gp') } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":null,"dir":"Reference","previous_headings":"","what":"'python' environment initialization — init_py","title":"'python' environment initialization — init_py","text":"function initializes 'python' environment package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"'python' environment initialization — init_py","text":"","code":"init_py( py_ver = NULL, dgpsi_ver = NULL, reinstall = FALSE, uninstall = FALSE, verb = TRUE )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"'python' environment initialization — init_py","text":"py_ver string gives 'python' version installed. py_ver = NULL, default 'python' version '3.9.13' installed. dgpsi_ver string gives 'python' version 'dgpsi' used. dgpsi_ver = NULL, latest 'python' version 'dgpsi' used, package installed CRAN; development 'python' version 'dgpsi' used, package installed GitHub. reinstall bool indicates whether reinstall 'python' version 'dgpsi' specified dgpsi_ver already installed. argument useful development version R package installed one may want regularly update development 'python' version 'dgpsi'. Defaults FALSE. uninstall bool indicates whether uninstall 'python' version 'dgpsi' specified dgpsi_ver already installed. argument useful 'python' environment corrupted one wants completely uninstall reinstall . Defaults FALSE. verb bool indicating trace information printed function execution. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"'python' environment initialization — init_py","text":"return value, called install required 'python' environment.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"'python' environment initialization — init_py","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"'python' environment initialization — init_py","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":null,"dir":"Reference","previous_headings":"","what":"Linked (D)GP emulator construction — lgp","title":"Linked (D)GP emulator construction — lgp","text":"function constructs linked (D)GP emulator model chain network.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linked (D)GP emulator construction — lgp","text":"","code":"lgp(struc, emulators = NULL, B = 10, activate = TRUE, verb = TRUE, id = NULL)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linked (D)GP emulator construction — lgp","text":"struc structure linked emulator, can take one two forms: list contains L (number layers systems computer models) sub-lists, represents layer contains (D)GP emulators (represented instances S3 class gp dgp) computer models. sub-lists placed list order specified computer model system's hierarchy. option deprecated removed next release. data frame defines connection structure emulators linked system, following columns: From_Emulator: ID emulator providing output. ID must match id slot corresponding emulator object (produced gp() dgp()) within emulators argument lgp(), special value \"Global\", indicating global inputs model chain network. id slot either automatically generated gp() dgp(), can manually specified via id argument functions set set_id() function. To_Emulator: ID emulator receiving input, also matching id slot corresponding emulator object. From_Output: single integer specifying output dimension From_Emulator connected input dimension To_Emulator specified To_Input. From_Emulator \"Global\", From_Output indicates dimension global input passed To_Emulator. To_Input: single integer specifying input dimension To_Emulator receiving From_Output dimension From_Emulator. row represents single one--one connection specified output dimension From_Emulator corresponding input dimension To_Emulator. multiple connections required two emulators, connection specified separate row. Note: using data frame option struc, emulators argument must provided. emulators list emulator objects, containing id slot uniquely identifies within linked system. id slot emulator object must match From_Emulator/To_Emulator columns struc. emulator used multiple times within linked system, list must contain distinct copies emulator, unique ID stored id slot. Use set_id() function produce copies different IDs ensure instance can uniquely referenced. B number imputations used prediction. Increase value refine representation imputation uncertainty. system consists GP emulators, B set 1 automatically. Defaults 10. activate bool indicating whether initialized linked emulator activated: activate = FALSE, lgp() returns inactive linked emulator, allowing inspection structure using summary(). activate = TRUE, lgp() returns active linked emulator, ready prediction validation using predict() validate(), respectively. Defaults TRUE. argument applicable struc specified data frame. verb bool indicating trace information linked (D)GP emulator construction printed function call. Defaults TRUE. argument applicable struc specified data frame. id ID assigned linked (D)GP emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linked (D)GP emulator construction — lgp","text":"S3 class named lgp contains three slots: id: number character string assigned id argument. constructor_obj: list 'python' objects stores information constructed linked emulator. emulator_obj, 'python' object stores information predictions linked emulator. specs: list contains seed: random seed generated produce imputations. information stored reproducibility linked (D)GP emulator (saved write() light option light = TRUE) loaded back R read(). B: number imputations used generate linked (D)GP emulator. struc data frame, specs also includes: metadata: data frame providing configuration details emulator linked system, following columns: Emulator: ID emulator. Layer: layer linked system emulator positioned. lower Layer number indicates position closer input, layer numbering increasing move away input. Pos_in_Layer: position emulator within layer. lower Pos_in_Layer number indicates position higher layer. Total_Input_Dims: total number input dimensions emulator. Total_Output_Dims: total number output dimensions emulator. struc: linked system structure, supplied struc. returned lgp object can used predict() linked (D)GP predictions. validate() OOS validation. plot() validation plots. summary() summarize constructed linked (D)GP emulator. write() save linked (D)GP emulator .pkl file.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linked (D)GP emulator construction — lgp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linked (D)GP emulator construction — lgp","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # model 1 f1 <- function(x) { (sin(7.5*x)+1)/2 } # model 2 f2 <- function(x) { 2/3*sin(2*(2*x - 1))+4/3*exp(-30*(2*(2*x-1))^2)-1/3 } # linked model f12 <- function(x) { f2(f1(x)) } # training data for Model 1 X1 <- seq(0, 1, length = 9) Y1 <- sapply(X1, f1) # training data for Model 2 X2 <- seq(0, 1, length = 13) Y2 <- sapply(X2, f2) # emulation of model 1 m1 <- gp(X1, Y1, name = \"matern2.5\", id = \"emulator1\") # emulation of model 2 m2 <- dgp(X2, Y2, depth = 2, name = \"matern2.5\", id = \"emulator2\") struc <- data.frame(From_Emulator = c(\"Global\", \"emulator1\"), To_Emulator = c(\"emulator1\", \"emulator2\"), From_Output = c(1, 1), To_Input = c(1, 1)) emulators <- list(m1, m2) # construct the linked emulator for visual inspection m_link <- lgp(struc, emulators, activate = FALSE) # visual inspection summary(m_link) # build the linked emulator for prediction m_link <- lgp(struc, emulators, activate = TRUE) test_x <- seq(0, 1, length = 300) m_link <- predict(m_link, x = test_x) # OOS validation validate_x <- sample(test_x, 20) validate_y <- sapply(validate_x, f12) plot(m_link, validate_x, validate_y, style = 2) # write and read the constructed linked emulator write(m_link, 'linked_emulator') m_link <- read('linked_emulator') } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"function searches candidate set locate next design point(s) added (D)GP emulator bundle (D)GP emulators using Mutual Information Computer Experiments (MICE), see reference .","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"","code":"mice(object, ...) # S3 method for class 'gp' mice( object, x_cand = NULL, n_cand = 200, batch_size = 1, M = 50, nugget_s = 1e-06, workers = 1, limits = NULL, int = FALSE, ... ) # S3 method for class 'dgp' mice( object, x_cand = NULL, n_cand = 200, batch_size = 1, M = 50, nugget_s = 1e-06, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... ) # S3 method for class 'bundle' mice( object, x_cand = NULL, n_cand = 200, batch_size = 1, M = 50, nugget_s = 1e-06, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. ... arguments (names different arguments used mice()) used aggregate can passed . x_cand matrix (row design point column input dimension) gives candidate set next design point(s) determined. object instance bundle class aggregate supplied, x_cand can also list. list must length equal number emulators object, element matrix representing candidate set corresponding emulator bundle. Defaults NULL. n_cand integer specifying size candidate set generated selecting next design point(s). argument used x_cand NULL. Defaults 200. batch_size integer gives number design points chosen. Defaults 1. M size conditioning set Vecchia approximation criterion calculation. argument used emulator object constructed Vecchia approximation. Defaults 50. nugget_s value smoothing nugget term used MICE. Defaults 1e-6. workers number processes used criterion calculation. set NULL, number processes set max physical cores available %/% 2. Defaults 1. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. argument used x_cand = NULL. Defaults NULL. int bool vector bools indicates input dimension integer type. single bool given, applied input dimensions. vector provided, length equal input dimensions applied individual input dimensions. argument used x_cand = NULL. Defaults FALSE. aggregate R function aggregates scores MICE across different output dimensions (object instance dgp class) across different emulators (object instance bundle class). function specified following basic form: first argument matrix representing scores. rows matrix correspond different design points. number columns matrix equals : emulator output dimension object instance dgp class; number emulators contained object object instance bundle class. output vector gives aggregate scores different design points. Set NULL disable aggregation. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"x_cand NULL: object instance gp class, vector length batch_size returned, containing positions (row numbers) next design points x_cand. object instance dgp class, vector length batch_size * D returned, containing positions (row numbers) next design points x_cand added DGP emulator. D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, matrix returned batch_size rows column emulator bundle, containing positions (row numbers) next design points x_cand individual emulators. x_cand NULL: object instance gp class, matrix batch_size rows returned, giving next design points evaluated. object instance dgp class, matrix batch_size * D rows returned, : D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, list returned length equal number emulators bundle. element list matrix batch_size rows, row represents design point added corresponding emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"first column matrix supplied first argument aggregate must correspond first output dimension DGP emulator object instance dgp class, subsequent columns dimensions. object instance bundle class, first column must correspond first emulator bundle, subsequent columns emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"Beck, J., & Guillas, S. (2016). Sequential design mutual information computer experiments (MICE): emulation tsunami model. SIAM/ASA Journal Uncertainty Quantification, 4(1), 739-766.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 1D non-stationary function f <- function(x) { sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # training a 2-layered DGP emulator with the global connection off m <- dgp(X, Y, connect = F) # generate a candidate set x_cand <- maximinLHS(200,1) # locate the next design point using MICE next_point <- mice(m, x_cand = x_cand) X_new <- x_cand[next_point,,drop = F] # obtain the corresponding output at the located design point Y_new <- f(X_new) # combine the new input-output pair to the existing data X <- rbind(X, X_new) Y <- rbind(Y, Y_new) # update the DGP emulator with the new input and output data and refit m <- update(m, X, Y, refit = TRUE) # plot the LOO validation plot(m) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the predictive negative log-likelihood — nllik","title":"Calculate the predictive negative log-likelihood — nllik","text":"function computes predictive negative log-likelihood DGP emulator likelihood layer.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the predictive negative log-likelihood — nllik","text":"","code":"nllik(object, x, y)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the predictive negative log-likelihood — nllik","text":"object instance dgp class produced dgp() likelihood NULL; x matrix row input testing data point column input dimension. y matrix one column row scalar-valued testing output data point.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the predictive negative log-likelihood — nllik","text":"updated object returned additional slot named NLL contains two elements. first one, named meanNLL, scalar gives average negative predicted log-likelihood across testing data points. second one, named allNLL, vector gives negative predicted log-likelihood testing data point.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the predictive negative log-likelihood — nllik","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":null,"dir":"Reference","previous_headings":"","what":"Pack GP and DGP emulators into a bundle — pack","title":"Pack GP and DGP emulators into a bundle — pack","text":"function packs GP emulators DGP emulators bundle class sequential designs emulator emulates one output dimension underlying simulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pack GP and DGP emulators into a bundle — pack","text":"","code":"pack(..., id = NULL)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pack GP and DGP emulators into a bundle — pack","text":"... sequence list emulators produced gp() dgp(). id ID assigned bundle emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Default NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pack GP and DGP emulators into a bundle — pack","text":"S3 class named bundle used design() sequential designs. : slot called id assigned id argument. N slots named emulator1,...,emulatorN, contains GP DGP emulator, N number emulators provided function. slot called data contains two elements X Y. X contains N matrices named emulator1,...,emulatorN training input data different emulators. Y contains N single-column matrices named emulator1,...,emulatorN training output data different emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pack GP and DGP emulators into a bundle — pack","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pack GP and DGP emulators into a bundle — pack","text":"","code":"if (FALSE) { # \\dontrun{ # load packages library(lhs) library(dgpsi) # construct a function with a two-dimensional output f <- function(x) { y1 = sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) y2 = 1/3*sin(2*(2*x - 1))+2/3*exp(-30*(2*(2*x-1))^2)+1/3 return(cbind(y1,y2)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # generate the validation data validate_x <- maximinLHS(30,1) validate_y <- f(validate_x) # training a 2-layered DGP emulator with respect to each output with the global connection off m1 <- dgp(X, Y[,1], connect = F) m2 <- dgp(X, Y[,2], connect = F) # specify the range of the input dimension lim <- c(0, 1) # pack emulators to form an emulator bundle m <- pack(m1, m2) # 1st wave of the sequential design with 10 iterations and the target RMSE of 0.01 m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, target = 0.01) # 2rd wave of the sequential design with additional 10 iterations and the same target m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, target = 0.01) # draw sequential designs of the two packed emulators draw(m, type = 'design') # inspect the traces of RMSEs of the two packed emulators draw(m, type = 'rmse') # write and read the constructed emulator bundle write(m, 'bundle_dgp') m <- read('bundle_dgp') # unpack the bundle into individual emulators m_unpacked <- unpack(m) # plot OOS validations of individual emulators plot(m_unpacked[[1]], x_test = validate_x, y_test = validate_y[,1]) plot(m_unpacked[[2]], x_test = validate_x, y_test = validate_y[,2]) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"function draws validation plots GP, DGP, linked (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"","code":"# S3 method for class 'dgp' plot( x, x_test = NULL, y_test = NULL, dim = NULL, method = NULL, sample_size = 50, style = 1, min_max = TRUE, normalize = TRUE, color = \"turbo\", type = \"points\", verb = TRUE, M = 50, force = FALSE, cores = 1, ... ) # S3 method for class 'lgp' plot( x, x_test = NULL, y_test = NULL, dim = NULL, method = NULL, sample_size = 50, style = 1, min_max = TRUE, color = \"turbo\", type = \"points\", M = 50, verb = TRUE, force = FALSE, cores = 1, ... ) # S3 method for class 'gp' plot( x, x_test = NULL, y_test = NULL, dim = NULL, method = NULL, sample_size = 50, style = 1, min_max = TRUE, color = \"turbo\", type = \"points\", verb = TRUE, M = 50, force = FALSE, cores = 1, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"x can one following emulator classes: S3 class gp. S3 class dgp. S3 class lgp. x_test validate(). y_test validate(). dim dim = NULL, index emulator's input within design shown x-axis validation plots. Otherwise, dim indicates dimension emulator's input shown x-axis validation plots: x instance gp dgp class, dim integer. x instance lgp class created lgp() without specifying struc argument data frame form, dim can : integer referring dimension global input emulators first layer linked emulator system; vector three integers referring dimension (specified third integer) global input emulator (specified second integer) layer (specified first integer) first layer linked emulator system. option linked (D)GP emulators deprecated removed next release. x instance lgp class created lgp() argument struc data frame form, dim integer referring dimension global input linked emulator system. argument used style = 1. Defaults NULL. method validate(). sample_size validate(). style either 1 2, indicating two different plotting styles validation. min_max bool indicating min-max normalization used scale testing output, RMSE, predictive mean std emulator. Defaults TRUE. argument applicable DGP emulators categorical likelihoods. normalize bool indicating normalization used scale counts validation plots DGP emulators categorical likelihoods style = 2. Defaults TRUE. color character string indicating color map use style = 2: 'magma' ('') 'inferno' ('B') 'plasma' ('C') 'viridis' ('D') 'cividis' ('E') 'rocket' ('F') 'mako' ('G') 'turbo' ('H') Defaults 'turbo' ('H'). type either 'line' 'points, indicating whether draw testing data OOS validation plot line individual points input emulator one-dimensional style = 1. argument applicable DGP emulators categorical likelihoods. Defaults 'points' verb bool indicating trace information plotting printed execution. Defaults TRUE. M validate(). force validate(). cores validate(). ... N/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"patchwork object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"plot() calls validate() internally obtain validation results plotting. However, plot() export emulator object validation results. Instead, returns plotting object. small-scale validations (.e., small training testing data points), direct execution plot() works well. However, moderate- large-scale validation, recommended first run validate() obtain store validation results emulator object, supply object plot(). plot() checks object's loo oos slots prior calling validate() perform calculation required information already stored. plot() use stored OOS validation x_test y_test identical used validate() produce data contained object's oos slot, otherwise plot() re-evaluate OOS validation plotting. returned patchwork::patchwork object contains ggplot2::ggplot2 objects. One can modify included individual ggplots accessing double-bracket indexing. See https://patchwork.data-imaginist.com/ information.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":null,"dir":"Reference","previous_headings":"","what":"Prediction from GP, DGP, or linked (D)GP emulators — predict","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"function implements prediction GP, DGP, linked (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"","code":"# S3 method for class 'dgp' predict( object, x, method = NULL, mode = \"label\", full_layer = FALSE, sample_size = 50, M = 50, cores = 1, chunks = NULL, ... ) # S3 method for class 'lgp' predict( object, x, method = NULL, full_layer = FALSE, sample_size = 50, M = 50, cores = 1, chunks = NULL, ... ) # S3 method for class 'gp' predict( object, x, method = NULL, sample_size = 50, M = 50, cores = 1, chunks = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"object instance gp, dgp, lgp class. x testing input data: object instance gp dgp class, x matrix row input testing data point column input dimension. object instance lgp class created lgp() without specifying argument struc data frame form, x can either matrix list: x matrix, rows treated instances Global inputs. case, assumed global input system input emulators first layer global input emulators layers. x list, L (number layers emulator system) elements. first element matrix represents global testing input data feed emulators first layer system. remaining L-1 elements L-1 sub-lists, contains number (number emulators corresponding layer) matrices (rows testing input data points columns input dimensions) represent global testing input data emulators corresponding layer. matrices must placed sub-lists based corresponding emulators placed struc argument lgp(). global input data certain emulator, set NULL corresponding sub-list x. option linked (D)GP emulators deprecated removed next release. object instance lgp class created lgp() argument struc data frame form, x must matrix representing global input, row corresponds test data point column represents global input dimension. column indices x must align indices specified From_Output column struc data frame (used lgp()), corresponding rows From_Emulator column \"Global\". method prediction approach use: either mean-variance approach (\"mean_var\") sampling approach (\"sampling\"). mean-variance approach returns means variances predictive distributions, sampling approach generates samples predictive distributions using derived means variances. DGP emulators categorical likelihood (likelihood = \"Categorical\" dgp()), method applicable full_layer = TRUE. case, sampling approach generates samples GP nodes hidden layers using derived means variances, subsequently propagates samples categorical likelihood. default, method set \"sampling\" DGP emulators Poisson, Negative Binomial, Categorical likelihoods, \"mean_var\" otherwise. mode whether predict classes (\"label\") probabilities (\"proba\") different classes object DGP emulator categorical likelihood. Defaults \"label\". full_layer bool indicating whether output predictions layers. Defaults FALSE. used object DGP linked (D)GP emulator. sample_size number samples draw given imputation method = \"sampling\". Defaults 50. M size conditioning set Vecchia approximation emulator prediction. Defaults 50. argument used emulator object constructed Vecchia approximation. cores number processes used prediction. set NULL, number processes set max physical cores available %/% 2. Defaults 1. chunks number chunks testing input matrix x divided multi-cores work . used cores 1. specified (.e., chunks = NULL), number chunks set value cores. Defaults NULL. ... N/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"object instance gp class: method = \"mean_var\": updated object returned additional slot called results contains two matrices named mean predictive means var predictive variances. matrix one column rows corresponding testing positions (.e., rows x). method = \"sampling\": updated object returned additional slot called results contains matrix whose rows correspond testing positions columns correspond sample_size number samples drawn predictive distribution GP. object instance dgp class: method = \"mean_var\" full_layer = FALSE: updated object returned additional slot called results contains two matrices named mean predictive means var predictive variances respectively. matrix rows corresponding testing positions columns corresponding DGP global output dimensions (.e., number GP/likelihood nodes final layer). method = \"mean_var\" full_layer = TRUE: updated object returned additional slot called results contains two sub-lists named mean predictive means var predictive variances respectively. sub-list contains L (.e., number layers) matrices named layer1, layer2,..., layerL. matrix rows corresponding testing positions columns corresponding output dimensions (.e., number GP/likelihood nodes associated layer). method = \"sampling\" full_layer = FALSE: updated object returned additional slot called results contains D (.e., number GP/likelihood nodes final layer) matrices named output1, output2,..., outputD. matrix rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified dgp(). method = \"sampling\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers) sub-lists named layer1, layer2,..., layerL. sub-list represents samples drawn GP/likelihood nodes corresponding layer, contains D (.e., number GP/likelihood nodes corresponding layer) matrices named output1, output2,..., outputD. matrix gives samples output one D GP/likelihood nodes, rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified dgp(). object instance dgp class categorical likelihood: full_layer = FALSE mode = \"label\": updated object returned additional slot called results contains one matrix named label. matrix rows corresponding testing positions columns corresponding sample labels size: B * sample_size, B number imputations specified dgp(). full_layer = FALSE mode = \"proba\", updated object returned additional slot called results. slot contains D matrices (D number classes training output), matrix gives probability samples corresponding class rows corresponding testing positions columns containing probabilities. number columns matrix B * sample_size, B number imputations specified dgp() function. method = \"mean_var\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers) sub-lists named layer1, layer2,..., layerL. first L-1 sub-lists contains two matrices named mean predictive means var predictive variances GP nodes associated layer. Rows matrix correspond testing positions. mode = \"label\", sub-list LayerL contains one matrix named label. matrix rows corresponding testing positions columns corresponding label samples size: B * sample_size. B number imputations specified dgp(). mode = \"proba\", sub-list LayerL contains D matrices (D number classes training output), matrix gives probability samples corresponding class rows corresponding testing positions columns containing probabilities. number columns matrix B * sample_size. B number imputations specified dgp(). method = \"sampling\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers) sub-lists named layer1, layer2,..., layerL. first L-1 sub-lists represents samples drawn GP nodes corresponding layer, contains D (.e., number GP nodes corresponding layer) matrices named output1, output2,..., outputD. matrix gives samples output one D GP nodes, rows corresponding testing positions columns corresponding samples size: B * sample_size. mode = \"label\", sub-list LayerL contains one matrix named label. matrix rows corresponding testing positions columns corresponding label samples size: B * sample_size. mode = \"proba\", sub-list LayerL contains D matrices (D number classes training output), matrix gives probability samples corresponding class rows corresponding testing positions columns containing probabilities. number columns matrix B * sample_size. B number imputations specified dgp(). object instance lgp class: method = \"mean_var\" full_layer = FALSE: updated object returned additional slot called results contains two sub-lists named mean predictive means var predictive variances respectively. sub-list contains K (number emulators final layer system) matrices named using IDs corresponding emulators final layer. matrix rows corresponding global testing positions columns corresponding output dimensions associated emulator final layer. method = \"mean_var\" full_layer = TRUE: updated object returned additional slot called results contains two sub-lists named mean predictive means var predictive variances respectively. sub-list contains L (.e., number layers emulated system) components named layer1, layer2,..., layerL. component represents layer contains K (number emulators corresponding layer system) matrices named using IDs corresponding emulators layer. matrix rows corresponding global testing positions columns corresponding output dimensions associated GP/DGP emulator corresponding layer. method = \"sampling\" full_layer = FALSE: updated object returned additional slot called results contains K (number emulators final layer system) sub-lists named using IDs corresponding emulators final layer. sub-list contains D matrices, named output1, output2,..., outputD, correspond output dimensions GP/DGP emulator. matrix rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified lgp(). method = \"sampling\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers emulated system) sub-lists named layer1, layer2,..., layerL. sub-list represents layer contains K (number emulators corresponding layer system) components named using IDs corresponding emulators layer. component contains D matrices, named output1, output2,..., outputD, correspond output dimensions GP/DGP emulator. matrix rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified lgp(). object instance lgp class created lgp() without specifying struc argument data frame form, IDs, used names sub-lists matrices within results, replaced emulator1, emulator2, . results slot also include: value M, represents size conditioning set Vecchia approximation, used, emulator prediction. value sample_size method = \"sampling\".","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":null,"dir":"Reference","previous_headings":"","what":"Static pruning of a DGP emulator — prune","title":"Static pruning of a DGP emulator — prune","text":"function implements static pruning DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Static pruning of a DGP emulator — prune","text":"","code":"prune(object, control = list(), verb = TRUE)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Static pruning of a DGP emulator — prune","text":"object instance dgp class generated dgp(). control list can supply following two components control static pruning DGP emulator: min_size, minimum number design points required trigger pruning. Defaults 10 times input dimensions. threshold, \\(R^2\\) value GP node considered redundant removable. Defaults 0.97. verb bool indicating trace information printed function execution. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Static pruning of a DGP emulator — prune","text":"updated object instance gp, dgp, bundle (GP emulators) class.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Static pruning of a DGP emulator — prune","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Static pruning of a DGP emulator — prune","text":"function requires DGP emulator trained dataset comprising minimum size equal min_size control. training dataset size smaller , recommended design DGP emulator enriched structure pruned dynamically using design() function. Depending design DGP emulator, static pruning may accurate. thus recommended dynamic pruning implemented part sequential design via design(). following slots: loo oos created validate(); results created predict(); object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Static pruning of a DGP emulator — prune","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # construct the borehole function over a hypercube f <- function(x){ x[,1] <- (0.15 - 0.5) * x[,1] + 0.5 x[,2] <- exp((log(50000) - log(100)) * x[,2] + log(100)) x[,3] <- (115600 - 63070) *x[,3] + 63070 x[,4] <- (1110 - 990) * x[,4] + 990 x[,5] <- (116 - 63.1) * x[,5] + 63.1 x[,6] <- (820 - 700) * x[,6] + 700 x[,7] <- (1680 - 1120) * x[,7] + 1120 x[,8] <- (12045 - 9855) * x[,8] + 9855 y <- apply(x, 1, RobustGaSP::borehole) } # set a random seed set_seed(999) # generate training data X <- maximinLHS(80, 8) Y <- f(X) # generate validation data validate_x <- maximinLHS(500, 8) validate_y <- f(validate_x) # training a DGP emulator with anisotropic squared exponential kernels m <- dgp(X, Y, share = F) # OOS validation of the DGP emulator plot(m, validate_x, validate_y) # prune the emulator until no more GP nodes are removable m <- prune(m) # OOS validation of the resulting emulator plot(m, validate_x, validate_y) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":null,"dir":"Reference","previous_headings":"","what":"Load the stored emulator — read","title":"Load the stored emulator — read","text":"function loads .pkl file stores emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load the stored emulator — read","text":"","code":"read(pkl_file)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load the stored emulator — read","text":"pkl_file path name .pkl file emulator stored.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load the stored emulator — read","text":"S3 class GP emulator, DGP emulator, linked (D)GP emulator, bundle (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Load the stored emulator — read","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Load the stored emulator — read","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), lgp(), or pack() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":null,"dir":"Reference","previous_headings":"","what":"Serialize the constructed emulator — serialize","title":"Serialize the constructed emulator — serialize","text":"function serializes constructed emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Serialize the constructed emulator — serialize","text":"","code":"serialize(object, light = TRUE)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Serialize the constructed emulator — serialize","text":"object instance S3 class gp, dgp, lgp, bundle. light bool indicating light version constructed emulator (requires small storage) serialized. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Serialize the constructed emulator — serialize","text":"serialized version object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Serialize the constructed emulator — serialize","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Serialize the constructed emulator — serialize","text":"Since constructed emulators 'python' objects, directly exported R processes parallel processing multi-session workers created spawning. function provides solution converting emulators serialized objects, can restored using deserialize() multi-session processing. Note forking, serialization generally required.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Serialize the constructed emulator — serialize","text":"","code":"if (FALSE) { # \\dontrun{ library(future) library(future.apply) library(dgpsi) # model f <- function(x) { (sin(7.5*x)+1)/2 } # training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # train a DGP emulator m <- dgp(X, Y, name = \"matern2.5\") # testing input data X_dgp <- seq(0, 1, length = 100) # serialize the DGP emulator m_serialized <- serialize(m) # start a multi-session with three cores for parallel predictions plan(multisession, workers = 3) # perform parallel predictions results <- future_lapply(1:length(X_dgp), function(i) { m_deserialized <- deserialize(m_serialized) mean_i <- predict(m_deserialized, X_dgp[i])$results$mean }, future.seed = TRUE) # reset the future plan to sequential plan(sequential) # combine mean predictions pred_mean <- do.call(rbind, results) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Emulator ID — set_id","title":"Set Emulator ID — set_id","text":"function assigns unique identifier emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Emulator ID — set_id","text":"","code":"set_id(object, id)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Emulator ID — set_id","text":"object emulator object ID assigned. id unique identifier emulator either numeric character string. Ensure ID conflict emulator IDs, especially used linked emulations.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Emulator ID — set_id","text":"updated object, assigned ID stored id slot.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Emulator ID — set_id","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Emulator ID — set_id","text":"","code":"if (FALSE) { # \\dontrun{ # See lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":null,"dir":"Reference","previous_headings":"","what":"Reset number of imputations for a DGP emulator — set_imp","title":"Reset number of imputations for a DGP emulator — set_imp","text":"function resets number imputations prediction DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reset number of imputations for a DGP emulator — set_imp","text":"","code":"set_imp(object, B = 5)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reset number of imputations for a DGP emulator — set_imp","text":"object instance S3 class dgp. B number imputations produce predictions object. Increase value improve imputation uncertainty quantification. Decrease value improve speed prediction. Defaults 5.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reset number of imputations for a DGP emulator — set_imp","text":"updated object information B incorporated.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reset number of imputations for a DGP emulator — set_imp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Reset number of imputations for a DGP emulator — set_imp","text":"function useful DGP emulator trained one wants make faster predictions decreasing number imputations without rebuilding emulator. following slots: loo oos created validate(); results created predict() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reset number of imputations for a DGP emulator — set_imp","text":"","code":"if (FALSE) { # \\dontrun{ # See design() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":null,"dir":"Reference","previous_headings":"","what":"Set linked indices — set_linked_idx","title":"Set linked indices — set_linked_idx","text":"function deprecated removed next release. updated lgp() function now offers simpler, efficient way specify linked information (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set linked indices — set_linked_idx","text":"","code":"set_linked_idx(object, idx)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set linked indices — set_linked_idx","text":"object instance S3 class gp dgp. idx argument linked_idx gp() dgp().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set linked indices — set_linked_idx","text":"updated object information idx incorporated.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set linked indices — set_linked_idx","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Set linked indices — set_linked_idx","text":"function useful different models emulated different teams. team can create (D)GP emulator even without knowing different emulators connected together. information available different emulators collected, connection information emulators can assigned individual emulators function.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set linked indices — set_linked_idx","text":"","code":"if (FALSE) { # \\dontrun{ # See lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":null,"dir":"Reference","previous_headings":"","what":"Random seed generator — set_seed","title":"Random seed generator — set_seed","text":"function initializes random number generator sets random seed R Python ensure reproducible results package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random seed generator — set_seed","text":"","code":"set_seed(seed)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random seed generator — set_seed","text":"seed single integer value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Random seed generator — set_seed","text":"return value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Random seed generator — set_seed","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random seed generator — set_seed","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the number of threads — set_thread_num","title":"Set the number of threads — set_thread_num","text":"function sets number threads parallel computations involved package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the number of threads — set_thread_num","text":"","code":"set_thread_num(num)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the number of threads — set_thread_num","text":"num number threads. greater maximum number threads available, number threads set maximum value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set the number of threads — set_thread_num","text":"return value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set the number of threads — set_thread_num","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":null,"dir":"Reference","previous_headings":"","what":"Add or remove the Vecchia approximation — set_vecchia","title":"Add or remove the Vecchia approximation — set_vecchia","text":"function adds removes Vecchia approximation GP, DGP linked (D)GP emulator constructed gp(), dgp() lgp().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add or remove the Vecchia approximation — set_vecchia","text":"","code":"set_vecchia(object, vecchia = TRUE, M = 25, ord = NULL)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add or remove the Vecchia approximation — set_vecchia","text":"object instance S3 class gp, dgp, lgp. vecchia bool list bools indicate addition removal Vecchia approximation: object instance gp dgp class, vecchia bool indicates either addition (vecchia = TRUE) removal (vecchia = FALSE) Vecchia approximation object. object instance lgp class, x can bool list bools: vecchia bool, indicates either addition (vecchia = TRUE) removal (vecchia = FALSE) Vecchia approximation individual (D)GP emulators contained object. vecchia list bools, shape struc supplied lgp(). bool list indicates corresponding (D)GP emulator contained object shall Vecchia approximation added removed. M size conditioning set Vecchia approximation (D)GP emulator training. Defaults 25. ord R function returns ordering input (D)GP emulator Vecchia approximation. function must satisfy following basic rules: first argument represents lengthscale-scaled input GP emulator lengthscale-scaled input GP node DGP emulator. output function vector indices gives ordering input GP emulator input GP nodes DGP emulator. ord = NULL, default random ordering used. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add or remove the Vecchia approximation — set_vecchia","text":"updated object Vecchia approximation either added removed.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add or remove the Vecchia approximation — set_vecchia","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Add or remove the Vecchia approximation — set_vecchia","text":"function useful quickly switching Vecchia non-Vecchia approximations existing emulator without need reconstruct emulator. emulator built without Vecchia approximation, function can add , emulator built Vecchia approximation, function can remove . current state already matches requested state, emulator remains unchanged.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"function provides summary key information GP, DGP, linked (D)GP emulator generating either table interactive plot emulator’s structure.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"","code":"# S3 method for class 'gp' summary(object, type = \"plot\", ...) # S3 method for class 'dgp' summary(object, type = \"plot\", ...) # S3 method for class 'lgp' summary(object, type = \"plot\", group_size = 1, ...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"object can one following: S3 class gp. S3 class dgp. S3 class lgp. type character string, either \"table\" \"plot\", indicating format output. set \"table\", function returns summary table. set \"plot\", function returns interactive visualization. Defaults \"plot\". object created lgp() struc data frame, type automatically default \"table\". ... arguments can passed kableExtra::kbl() type = \"table\". group_size integer specifying number consecutive layers grouped together interactive visualization linked emulators type = \"plot\". argument applicable object instance lgp class. Defaults 1.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"Either summary table (returned kableExtra object) interactive visualization (returned visNetwork object) emulator. visualization compatible R Markdown documents RStudio Viewer. summary table can customized kableExtra::kableExtra package. resulting visNetwork object can saved HTML file using visNetwork::visSave() visNetwork::visNetwork package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Trace plot for DGP hyperparameters — trace_plot","title":"Trace plot for DGP hyperparameters — trace_plot","text":"function draws trace plots hyperparameters chosen GP node DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trace plot for DGP hyperparameters — trace_plot","text":"","code":"trace_plot(object, layer = NULL, node = 1)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trace plot for DGP hyperparameters — trace_plot","text":"object instance dgp class. layer index layer. Defaults NULL final layer. node index GP node layer specified layer. Defaults 1 first GP node corresponding layer.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trace plot for DGP hyperparameters — trace_plot","text":"ggplot object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Trace plot for DGP hyperparameters — trace_plot","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trace plot for DGP hyperparameters — trace_plot","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":null,"dir":"Reference","previous_headings":"","what":"Unpack a bundle of (D)GP emulators — unpack","title":"Unpack a bundle of (D)GP emulators — unpack","text":"function unpacks bundle (D)GP emulators safely manipulations unpacked individual emulators impact bundle.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unpack a bundle of (D)GP emulators — unpack","text":"","code":"unpack(object)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unpack a bundle of (D)GP emulators — unpack","text":"object instance class bundle.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unpack a bundle of (D)GP emulators — unpack","text":"named list contains individual emulators (named emulator1,...,emulatorS) packed object, S number emulators object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Unpack a bundle of (D)GP emulators — unpack","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unpack a bundle of (D)GP emulators — unpack","text":"","code":"if (FALSE) { # \\dontrun{ # See pack() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update a GP or DGP emulator — update","title":"Update a GP or DGP emulator — update","text":"function updates training input output GP DGP emulator option refit emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update a GP or DGP emulator — update","text":"","code":"update(object, X, Y, refit, reset, verb, ...) # S3 method for class 'dgp' update( object, X, Y, refit = TRUE, reset = FALSE, verb = TRUE, N = NULL, cores = 1, ess_burn = 10, B = NULL, ... ) # S3 method for class 'gp' update(object, X, Y, refit = TRUE, reset = FALSE, verb = TRUE, ...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update a GP or DGP emulator — update","text":"object can one following: S3 class gp. S3 class dgp. X new input data matrix row input training data point column represents input dimension. Y new output data: object instance gp class, Y matrix one column row output data point. object instance dgp class, Y matrix rows output data points columns output dimensions. likelihood (see ) NULL, Y must matrix one column. refit bool indicating whether re-fit emulator object training input output updated. Defaults TRUE. reset bool indicating whether reset hyperparameters emulator object initial values first obtained emulator constructed. Use suspected local mode hyperparameters reached successive updates. Defaults FALSE. verb bool indicating trace information printed function execution. Defaults TRUE. ... N/. N number training iterations used re-fit emulator object instance dgp class. set NULL, number iterations set 100 DGP emulator constructed without Vecchia approximation, set 50 Vecchia approximation used. Defaults NULL. cores number processes used re-fit GP components (layer) M-step re-fitting. set NULL, number processes set (max physical cores available - 1) vecchia = FALSE max physical cores available %/% 2 vecchia = TRUE. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. ess_burn number burnin steps ESS-within-Gibbs sampler -step training emulator object instance dgp class. Defaults 10. B number imputations predictions updated emulator object instance dgp class. overrides number imputations set object. Set NULL use number imputations set object. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update a GP or DGP emulator — update","text":"updated object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update a GP or DGP emulator — update","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Update a GP or DGP emulator — update","text":"following slots: loo oos created validate(); results created predict(); design created design() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update a GP or DGP emulator — update","text":"","code":"if (FALSE) { # \\dontrun{ # See alm(), mice(), or vigf() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"function calculates Leave-One-(LOO) cross validation --Sample (OOS) validation statistics constructed GP, DGP, linked (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"","code":"validate( object, x_test, y_test, method, sample_size, verb, M, force, cores, ... ) # S3 method for class 'gp' validate( object, x_test = NULL, y_test = NULL, method = NULL, sample_size = 50, verb = TRUE, M = 50, force = FALSE, cores = 1, ... ) # S3 method for class 'dgp' validate( object, x_test = NULL, y_test = NULL, method = NULL, sample_size = 50, verb = TRUE, M = 50, force = FALSE, cores = 1, ... ) # S3 method for class 'lgp' validate( object, x_test = NULL, y_test = NULL, method = NULL, sample_size = 50, verb = TRUE, M = 50, force = FALSE, cores = 1, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"object can one following: S3 class gp. S3 class dgp. S3 class lgp. x_test OOS testing input data: object instance gp dgp class, x_test matrix row new input location used validating emulator column input dimension. object instance lgp class, x_test can matrix list: x_test matrix, global testing input data feed emulators first layer system. rows x_test represent different input data points columns represent input dimensions across emulators first layer system. case, assumed global input system input emulators first layer global input emulators layers. x_test list, L (number layers emulator system) elements. first element matrix represents global testing input data feed emulators first layer system. remaining L-1 elements L-1 sub-lists, contains number (number emulators corresponding layer) matrices (rows testing input data points columns input dimensions) represent global testing input data emulators corresponding layer. matrices must placed sub-lists based corresponding emulators placed struc argument lgp(). global input data certain emulator, set NULL corresponding sub-list x_test. option linked (D)GP emulators deprecated removed next release. object instance lgp class created lgp() argument struc data frame form, x_test must matrix representing global input, row corresponds test data point column represents global input dimension. column indices x_test must align indices specified From_Output column struc data frame (used lgp()), corresponding rows From_Emulator column \"Global\". x_test must provided object instance lgp. x_test must also provided y_test provided. Defaults NULL, case LOO validation performed. y_test OOS output data corresponding x_test: object instance gp class, y_test matrix one column row represents output corresponding matching row x_test. object instance dgp class, y_test matrix row represents output corresponding matching row x_test columns representing output dimensions. object instance lgp class, y_test can single matrix list matrices: y_test single matrix, one emulator final layer linked emulator system y_test represents emulator's output rows testing positions columns output dimensions. y_test list, y_test L matrices, L number emulators final layer system. matrix rows corresponding testing positions columns corresponding output dimensions associated emulator final layer. y_test must provided object instance lgp. y_test must also provided x_test provided. Defaults NULL, case LOO validation performed. method prediction approach use validation: either mean-variance approach (\"mean_var\") sampling approach (\"sampling\"). details see predict(). DGP emulators categorical likelihood (likelihood = \"Categorical\" dgp()), sampling approach supported. default, method set \"sampling\" DGP emulators Poisson, Negative Binomial, Categorical likelihoods \"mean_var\" otherwise. sample_size number samples draw given imputation method = \"sampling\". Defaults 50. verb bool indicating trace information validation printed function execution. Defaults TRUE. M size conditioning set Vecchia approximation emulator validation. argument used emulator object constructed Vecchia approximation. Defaults 50. force bool indicating whether force LOO OOS re-evaluation loo oos slot already exists object. force = FALSE, validate() re-evaluate emulators x_test y_test identical values oos slot. existing loo oos validation used different M Vecchia approximation different method one prescribed call, emulator re-evaluated. Set force TRUE LOO OOS re-evaluation required. Defaults FALSE. cores number processes used validation. set NULL, number processes set max physical cores available %/% 2. Defaults 1. ... N/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"object instance gp class, updated object returned additional slot called loo (LOO cross validation) oos (OOS validation) contains: two slots called x_train (x_test) y_train (y_test) contain validation data points LOO (OOS). column matrix called mean, method = \"mean_var\", median, method = \"sampling\", contains predictive means medians GP emulator validation positions. three column matrices called std, lower, upper contain predictive standard deviations credible intervals GP emulator validation positions. method = \"mean_var\", upper lower bounds credible interval two standard deviations predictive mean. method = \"sampling\", upper lower bounds credible interval 2.5th 97.5th percentiles. numeric value called rmse contains root mean/median squared error GP emulator. numeric value called nrmse contains (max-min) normalized root mean/median squared error GP emulator. max-min normalization uses maximum minimum values validation outputs contained y_train (y_test). integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation method = \"sampling\". rows matrices (mean, median, std, lower, upper) correspond validation positions. object instance dgp class, updated object returned additional slot called loo (LOO cross validation) oos (OOS validation) contains: two slots called x_train (x_test) y_train (y_test) contain validation data points LOO (OOS). matrix called mean, method = \"mean_var\", median, method = \"sampling\", contains predictive means medians DGP emulator validation positions. three matrices called std, lower, upper contain predictive standard deviations credible intervals DGP emulator validation positions. method = \"mean_var\", upper lower bounds credible interval two standard deviations predictive mean. method = \"sampling\", upper lower bounds credible interval 2.5th 97.5th percentiles. vector called rmse contains root mean/median squared errors DGP emulator across different output dimensions. vector called nrmse contains (max-min) normalized root mean/median squared errors DGP emulator across different output dimensions. max-min normalization uses maximum minimum values validation outputs contained y_train (y_test). integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation method = \"sampling\". rows columns matrices (mean, median, std, lower, upper) correspond validation positions DGP emulator output dimensions, respectively. object instance dgp class categorical likelihood, updated object returned additional slot called loo (LOO cross validation) oos (OOS validation) contains: two slots called x_train (x_test) y_train (y_test) contain validation data points LOO (OOS). matrix called label contains predictive samples labels DGP emulator validation positions. matrix rows corresponding validation positions columns corresponding samples labels. list called probability contains predictive samples probabilities class DGP emulator validation positions. element list matrix rows corresponding validation positions columns corresponding samples probabilities. scalar called log_loss represents average log loss predicted labels DGP emulator across validation positions. Log loss measures accuracy probabilistic predictions, lower values indicating better classification performance. log_loss ranges 0 positive infinity, value closer 0 suggests confident accurate predictions. integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation. object instance lgp class, updated object returned additional slot called oos (OOS validation) contains: two slots called x_test y_test contain validation data points OOS. list called mean, method = \"mean_var\", median, method = \"sampling\", contains predictive means medians linked (D)GP emulator validation positions. three lists called std, lower, upper contain predictive standard deviations credible intervals linked (D)GP emulator validation positions. method = \"mean_var\", upper lower bounds credible interval two standard deviations predictive mean. method = \"sampling\", upper lower bounds credible interval 2.5th 97.5th percentiles. list called rmse contains root mean/median squared errors linked (D)GP emulator. list called nrmse contains (max-min) normalized root mean/median squared errors linked (D)GP emulator. max-min normalization uses maximum minimum values validation outputs contained y_test. integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation method = \"sampling\". element mean, median, std, lower, upper, rmse, nrmse corresponds (D)GP emulator final layer linked (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"x_test y_test NULL, LOO cross validation implemented. Otherwise, OOS validation implemented. LOO validation applicable GP DGP emulator (.e., object instance gp dgp class). linked (D)GP emulator (.e., object instance lgp class) provided, x_test y_test must also provided OOS validation.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"function searches candidate set locate next design point(s) added (D)GP emulator bundle (D)GP emulators using Variance Improvement Global Fit (VIGF). VIGF GP emulators, see reference .","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"","code":"vigf(object, ...) # S3 method for class 'gp' vigf( object, x_cand = NULL, n_start = 10, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, ... ) # S3 method for class 'dgp' vigf( object, x_cand = NULL, n_start = 10, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... ) # S3 method for class 'bundle' vigf( object, x_cand = NULL, n_start = 10, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. ... arguments (names different arguments used vigf()) used aggregate can passed . x_cand matrix (row design point column input dimension) gives candidate set next design point(s) determined. object instance bundle class aggregate supplied, x_cand can also list. list must length equal number emulators object, element matrix representing candidate set corresponding emulator bundle. Defaults NULL. n_start integer gives number initial design points used determine next design point(s). argument used x_cand NULL. Defaults 10. batch_size integer gives number design points chosen. Defaults 1. M size conditioning set Vecchia approximation criterion calculation. argument used emulator object constructed Vecchia approximation. Defaults 50. workers number processes used design point selection. set NULL, number processes set max physical cores available %/% 2. Defaults 1. argument currently support Windows machines aggregate function provided, due significant overhead caused initializing Python environment worker spawning. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. argument used x_cand = NULL. Defaults NULL. int bool vector bools indicates input dimension integer type. single bool given, applied input dimensions. vector provided, length equal input dimensions applied individual input dimensions. argument used x_cand = NULL. Defaults FALSE. aggregate R function aggregates scores VIGF across different output dimensions (object instance dgp class) across different emulators (object instance bundle class). function specified following basic form: first argument matrix representing scores. rows matrix correspond different design points. number columns matrix equals : emulator output dimension object instance dgp class; number emulators contained object object instance bundle class. output vector gives aggregate scores different design points. Set NULL disable aggregation. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"x_cand NULL: object instance gp class, vector length batch_size returned, containing positions (row numbers) next design points x_cand. object instance dgp class, vector length batch_size * D returned, containing positions (row numbers) next design points x_cand added DGP emulator. D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, matrix returned batch_size rows column emulator bundle, containing positions (row numbers) next design points x_cand individual emulators. x_cand NULL: object instance gp class, matrix batch_size rows returned, giving next design points evaluated. object instance dgp class, matrix batch_size * D rows returned, : D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, list returned length equal number emulators bundle. element list matrix batch_size rows, row represents design point added corresponding emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"first column matrix supplied first argument aggregate must correspond first output dimension DGP emulator object instance dgp class, subsequent columns dimensions. object instance bundle class, first column must correspond first emulator bundle, subsequent columns emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"Mohammadi, H., & Challenor, P. (2022). Sequential adaptive design emulating costly computer codes. arXiv:2206.12113.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 1D non-stationary function f <- function(x) { sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # training a 2-layered DGP emulator with the global connection off m <- dgp(X, Y, connect = F) # specify the input range lim <- c(0,1) # locate the next design point using VIGF X_new <- vigf(m, limits = lim) # obtain the corresponding output at the located design point Y_new <- f(X_new) # combine the new input-output pair to the existing data X <- rbind(X, X_new) Y <- rbind(Y, Y_new) # update the DGP emulator with the new input and output data and refit m <- update(m, X, Y, refit = TRUE) # plot the LOO validation plot(m) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"function trims sequence hyperparameter estimates within DGP emulator generated training.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"","code":"window(object, start, end = NULL, thin = 1)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"object instance S3 class dgp. start first iteration iterations trimmed sequence. end last iteration iterations trimmed sequence. Set NULL keep iterations (including) start. Defaults NULL. thin interval start end iterations thin sequence. Defaults 1.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"updated object trimmed sequence hyperparameters.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"function useful DGP emulator trained one wants trim sequence hyperparameters estimated use trimmed sequence generate point estimates DGP model parameters prediction. following slots: loo oos created validate(); results created predict() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":null,"dir":"Reference","previous_headings":"","what":"Save the constructed emulator — write","title":"Save the constructed emulator — write","text":"function saves constructed emulator .pkl file.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save the constructed emulator — write","text":"","code":"write(object, pkl_file, light = TRUE)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save the constructed emulator — write","text":"object instance S3 class gp, dgp, lgp, bundle. pkl_file path name .pkl file emulator object saved. light bool indicating light version constructed emulator (requires less disk space store) saved. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save the constructed emulator — write","text":"return value. object saved local .pkl file specified pkl_file.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save the constructed emulator — write","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Save the constructed emulator — write","text":"Since emulators built package 'python' objects, save() R work R objects. object processed set_vecchia() add remove Vecchia approximation, light set FALSE ensure reproducibility saved emulator reloaded read().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save the constructed emulator — write","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), lgp(), or pack() for an example. } # }"},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-250","dir":"Changelog","previous_headings":"","what":"dgpsi 2.5.0","title":"dgpsi 2.5.0","text":"CRAN release: 2024-12-14 Training times DGP emulators now approximately 30%-40% faster. computation (D)GP predictions Leave-One-(LOO) evaluations now 6-7 times faster. nb_parallel argument removed relevant functions, multi-threading now integrated default. Vecchia approximation, implemented SI framework, now available across functions support large-scale emulations. Two new functions, get_thread_num() set_thread_num(), allow users inspect adjust number threads used multi-threaded computations. new function, set_vecchia(), enables users easily add remove Vecchia approximation GP, DGP, linked (D)GP emulators. Documentation now includes lifecycle status badges highlight deprecated newly introduced functions arguments. default value nugget parameter DGP emulators likelihood layers adjusted 1e-6 1e-4. Categorical likelihood option added dgp() function’s likelihood argument, enabling DGP-based classification. issue related LD_LIBRARY environment variable Linux systems resolved via init_py() function. lgp() function enhanced accept connection information among emulators form data frame, streamlining linked emulation setup. new function, set_id(), allows users assign unique IDs emulators. predict() function updated accommodate predictions DGP classifiers. plot() function updated generate validation plots DGP classifiers (.e., DGP emulators categorical likelihoods) linked emulators created lgp() using new data frame form struc. summary() function redesigned provide summary tables visualizations structure model specifications (D)GP linked (D)GP emulators. sample_size argument added validate() plot() functions, allowing users adjust number samples used validation validation method set sampling. combine() set_linked_idx() deprecated version removed next release. two functions longer maintained. Please refer updated package documentation alternative workflows. basic node functions kernel(), Hetero(), Poisson(), NegBin(), along struc argument gp() dgp() functions, removed version. Customization (D)GP specifications can achieved modifying arguments gp() dgp(). draw() function updated instances bundle class allow drawing design evaluation plots emulators single figure. plot() function updated linked emulators generated lgp() using new data frame form struc. design() function redesigned allow new specifications user-supplied method function. batch_size argument added design() enable locating multiple design points single iteration sequential design. argument compatible built-method functions: alm(), mice(), vigf(). alm() vigf() functions redesigned support continuous search next design point search discrete candidate set passed x_cand argument. alm(), mice(), vigf() functions updated output locations identified design points discrete candidate set supplied. pei() function removed package re-engineering added back future version. default refit argument update() function changed FALSE TRUE. write() function now allows light = TRUE GP emulators bundles GP emulators. Two new functions, serialize() deserialize(), added allow users export emulators multi-session workers parallel processing. Additional vignettes available, showcasing large-scale DGP emulation, DGP classification, Bayesian optimization using (D)GP emulators. Enhanced clarity consistency across documentation. Improved examples explanations vignettes better user guidance.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-240","dir":"Changelog","previous_headings":"","what":"dgpsi 2.4.0","title":"dgpsi 2.4.0","text":"CRAN release: 2024-01-14 One can now use design() implement sequential designs using f fixed candidate set passed x_cand y_cand = NULL. sizes .pkl files written write() significantly reduced. One can now set different kernel functions nodes different layers DGP emulator passing vector kernel function names name argument dgp(). default number imputations B dgp() lgp() changed 10 faster validations predictions. default method sequential designs design() changed vigf(). new argument new_wave added design() allow users resume sequential designs without separate wave. bug vigf() fixed object instance bundle class batch_size greater one. Static dynamic pruning DGP structures implemented prune() design() (via new arguments pruning control) respectively. redundant codes removed update() makes design() slightly faster. limits argument design() now required x_cand supplied avoid -sampling using limits inferred training data. design() now supports f produce NA outputs. useful prevent sequential design stopping due errors NA outputs simulator input locations identified sequential design process. bug fixed design() x_cand supplied input dimension one. alm(), mice(), pei(), vigf() now accept separate candidate sets (even different number candidate points) via x_cand bundle emulators. slot called id added instances gp, dgp, lgp, bundle classes uniquely identify emulators. id can also passed instances gp, dgp,lgp, bundle classes new id argument gp(), dgp(), lgp(), pack(). pack() can now accept list (D)GP emulators input. check_point argument removed design() replaced autosave. Automatic saving emulators sequential design added design() new argument autosave. customized evaluation function provided design() via eval, design information previous waves retained long previous waves sequential design also use customized evaluation functions. different customized evaluation functions supplied design() different waves, trace plot RMSEs produced draw() show RMSEs different evaluation functions different waves. One can now link emulator multiple times chain via lgp() setting different linking information emulator via set_linked_idx(). Updates documentations vignettes.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-230","dir":"Changelog","previous_headings":"","what":"dgpsi 2.3.0","title":"dgpsi 2.3.0","text":"CRAN release: 2023-09-03 bug underlying Python implementations fixed name = 'matern2.5' gp() dgp(). Thanks @yyimingucl, bug underlying Python implementations MICE sequential design criterion mice() fixed. argument reset added update() design() reset hyperparameters (D)GP emulator initial values (specified emulator initialized) input output emulator updated emulator refitted. argument can useful sequential designs cases hyperparameters (D)GP emulator get caught suboptimal estimates. circumstances, one can set reset = TRUE reinitialize (D)GP emulator steps sequential designs strategy escape poor estimates. refitting emulator final step sequential design longer forced design(). argument type added plot() allow users draw OOS validation plots testing data shown line instead individual points emulator’s input one-dimensional style = 1. Thanks @tjmckinley, issue relating libstdc++..6 Linux machines R restarting installation package fixed. alm() mice() can locate new design points stochastic simulators (D)GP bundle emulators can deal stochastic outputs. design() can used construct (D)GP bundle emulators adaptively utilizing multiple realizations stochastic simulator design positions new argument reps method = alm method = mice. new slot called specs added objects returned gp() dgp() contains key information kernel functions used constructions GP DGP emulators. Due bug latest version underlying Python package, emulators saved write() version 2.1.6 2.2.0 may work properly update() design() loaded back read() version. bug addressed version emulators saved version compatibility issue future version. new sequential design criterion, called Variance Improvement Global Fit (VIGF), added package function vigf(). sampling existing candidate set x_cand design() changed random sampling conditioned Latin Hypercube sampling clhs package. python environment now automatically installed invoked function package executed. One need run init_py() activate required python environment init_py() still useful re-install uninstall underlying python environment. verb argument added init_py() switch /trace information.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-220","dir":"Changelog","previous_headings":"","what":"dgpsi 2.2.0","title":"dgpsi 2.2.0","text":"CRAN release: 2023-06-05 efficiency speed imputations involved training predictions DGP emulators significantly improved (achieving roughly 3x faster training imputations) utilizing blocked Gibbs sampling imputes latent variables layer-wise rather node-wise. blocked Gibbs sampling now default method DGP emulator inference can changed back old node-wise approach setting blocked_gibbs = FALSE dgp(). One can now optimize GP components contained layer DGP emulator parallel DGP emulator training, using multiple cores setting new argument cores dgp(). option useful can accelerate training speed input dimension moderately large (case large number GP components optimized) optimization GP components computationally expensive, e.g., share = FALSE case input dimensions individual GP components different lengthscales. Thanks @tjmckinley, bug update() object instance dgp class (trimmed window()) fixed. Thanks @tjmckinley, R memory issues due underlying Python implementations rectified. set_seed() function added ensure reproducible results package. bug fixed candidate sets x_cand y_cand provided design(). One can choose different color palettes using new argument color plot() style = 2. set_linked_idx() allows constructions different (D)GP emulators (terms different connections feeding layers) (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-216","dir":"Changelog","previous_headings":"","what":"dgpsi 2.1.6","title":"dgpsi 2.1.6","text":"CRAN release: 2023-02-08 bug found multi-core predictions predict() object instance lgp class x list. bug fixed version. Thanks @tjmckinley, issue (/usr/lib/x86_64-linux-gnu/libstdc++..6: version 'GLIBCXX_3.4.30' found) encountered Linux machines fixed automatically execution init_py(). gp() dgp() allow users specify value scale parameters whether estimate parameters. gp() dgp() allow users specify bounds lengthscales. jointly robust prior (Gu, 2019) implemented default inference approach GP emulators gp(). default value lengthscale gp() changed 0.2 0.1, default value nugget gp() changed 1e-6 1e-8 nugget_est = FALSE. One can now specify number GP nodes layer (except final layer) DGP emulator via node argument dgp(). Training data now contained S3 classes gp dgp. RMSEs (without min-max normalization) emulators now contained S3 classes gp, dgp, lgp execution validate(). window() function added trim traces obtain new point estimates DGP model parameters predictions. min-max normalization can now switched plot() setting value min_max. default number imputations B dgp() changed 50 30 better balance uncertainty speed DGP emulator predictions. new function set_imp() made available change number imputations trained DGP emulator one can either achieve faster predictions reducing number imputations, account imputation uncertainties increasing number imputations, without re-training emulator. default number imputations B continue() set NULL, case number imputations used object applied. nugget argument dgp() now specifies nugget values GP nodes different layers rather GP nodes final layer. speed predictions DGP emulators squared exponential kernels significantly improved roughly 3x faster implementations version 2.1.5. implementation sequential designs (two vignettes) (D)GP emulators using different criterion made available. Thanks @tjmckinley, internal reordering issue plot() fixed. init_py() now allows users reinstall uninstall underlying Python environment. bug occurs linked DGP emulator involves DGP emulator external inputs fixed. Intel SVML now installed Python environment automatically Intel users faster implementations.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-215","dir":"Changelog","previous_headings":"","what":"dgpsi 2.1.5","title":"dgpsi 2.1.5","text":"CRAN release: 2022-09-29 Initial release R interface Python package dgpsi v2.1.5.","code":""}]
+[{"path":"http://mingdeyu.github.io/dgpsi-R/dev/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 Deyu Ming Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":null,"dir":"","previous_headings":"","what":"Research Notice","title":"Research Notice","text":"R package dgpsi repository underlying Python package https://github.com/mingdeyu/DGP contain experimental features new ideas subject change.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"use-of-package-in-academic-research","dir":"","previous_headings":"","what":"Use of Package in Academic Research","title":"Research Notice","text":"features ideas introduced repositories part ongoing research. find ideas useful research, please consider citing package, work (citation details References), reaching potential collaboration.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"disclaimer","dir":"","previous_headings":"","what":"Disclaimer","title":"Research Notice","text":"ideas code repository sister repository experimental. encourage users approach , respecting nature part ongoing academic research. also appreciate inform us research uses ideas package, helps us understand impact.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"licensing","dir":"","previous_headings":"","what":"Licensing","title":"Research Notice","text":"project released MIT License. Please refer LICENSE file full details.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/RESEARCH-NOTICE.html","id":"contact","dir":"","previous_headings":"","what":"Contact","title":"Research Notice","text":"inquiries related research aspects package, please feel free contact us.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Bayesian Optimization","text":"","code":"library(tidyverse) library(lhs) library(patchwork) library(ggplot2) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"define-the-target-function","dir":"Articles","previous_headings":"","what":"Define the target function","title":"Bayesian Optimization","text":"consider version Shubert function (Surjanovic Bingham 2013) defined domain [0,1]2[0,1]^2 follows: pass Shubert function design(), defined input x output matrices. Next, generate contour Shubert function: figure , can observe Shubert function several local minima two global minima located (0.1437, 0.2999) (0.2999, 0.1437), values around -186.7309. remainder vignette, use Expected Improvement (EI) acquisition function identify global minima.","code":"shubert <- function(x) { N <- nrow(x) x1 <- x[,1] * 4 - 2 x2 <- x[,2] * 4 - 2 ii <- c(1:5) y <- sapply(1:N, function(i) { sum(ii * cos((ii+1)*x1[i]+ii)) * sum(ii * cos((ii+1)*x2[i]+ii)) }) y <- matrix(y, ncol = 1) return(y) } x1 <- seq(0, 1, length.out = 200) x2 <- seq(0, 1, length.out = 200) dat <- expand_grid(x1 = x1, x2 = x2) dat <- mutate(dat, f = shubert(cbind(x1, x2))) ggplot(dat, aes(x1, x2, fill = f)) + geom_tile() + scale_fill_continuous(type = \"viridis\")"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"initial-emulator-construction","dir":"Articles","previous_headings":"","what":"Initial emulator construction","title":"Bayesian Optimization","text":"ensure reproducibility vignette, set seed using set_seed() function package: Next, generate initial design 20 points using maximin Latin hypercube sampler: construct initial DGP surrogate model Shubert function:","code":"set_seed(99) X <- maximinLHS(20, 2) Y <- shubert(X) m <- dgp(X, Y, name = 'matern2.5') ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:02<00:00, 249.19it/s] ## Imputing ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/bayes_opt.html","id":"bayesian-optimization-using-expected-improvement-ei","dir":"Articles","previous_headings":"","what":"Bayesian optimization using Expected Improvement (EI)","title":"Bayesian Optimization","text":"begin Bayesian optimization design(), first need define Expected Improvement (EI) acquisition function, adhering rules specified method argument design(): ei function defined takes emulator first argument, object, along additional arguments: limits, two-column matrix first column specifies lower bounds second column specifies upper bounds input dimensions, n_starts, defines number multi-start points used search location corresponding minimum (negative) EI. can, course, replace ei acquisition function, provided adheres rules method argument design() (see ?design details). track identified minimum value Shubert function Bayesian optimization, define monitor function, opt_monitor, passed eval argument design(): domain input Shubert function, within global minima searched Bayesian optimization, defined [0,1]2[0,1]^2: ingredients ready, can now run Bayesian optimization using design() 80 iterations: Bayesian optimization, dynamic pruning mechanism transitioned DGP emulator GP emulator iteration 6, leading faster optimizations remaining iterations maintaining emulator’s quality. 80 iterations, identified minimum Shubert function value -186.7286, close global minimum -186.7309. can inspect progress minima search conducted design() applying draw() m: figure shows Bayesian optimization using (D)GP emulator quickly identifies low value Shubert function within 5 iterations. Notably, lowest value, -186.7286, achieved design() 48 iterations. can also inspect locations identified process applying draw() m type = 'design': figure illustrates Bayesian optimization successfully identifies regions around two global minima, represented red inverted triangles, adding design points concentrated near two locations.","code":"ei <- function(object, limits, n_starts = 10, ...) { # Expected Improvement (EI) function ei_function <- function(x) { x <- matrix(x, nrow = 1) # Extract mean and variance from the 'object' pred <- predict(object, x, ...)$results mu <- pred$mean sigma <- sqrt(pred$var) # Handle numerical precision issues with very small sigma values sigma[sigma < 1e-10] <- 1e-10 # Best observed minimum value best_value <- min(object$data$Y) # Calculate improvement improvement <- best_value - mu # Calculate Expected Improvement (EI) z <- improvement / sigma ei <- improvement * pnorm(z) + sigma * dnorm(z) ei <- ifelse(ei < 0, 0, ei) # Ensure non-negative EI return(-ei) # Return negative EI because `optim()` minimizes by default } # Number of input dimensions num_dims <- nrow(limits) # Generate initial points using Latin Hypercube Sampling (LHS) lhd_samples <- maximinLHS(n_starts, num_dims) lhd_points <- sapply(1:num_dims, function(i) { limits[i, 1] + lhd_samples[, i] * (limits[i, 2] - limits[i, 1]) }) # Perform optimization with multiple starts using `optim()` results <- lapply(1:n_starts, function(i) { optim( par = lhd_points[i, ], fn = ei_function, method = \"L-BFGS-B\", lower = limits[, 1], upper = limits[, 2] ) }) # Find the result with the minimum (most negative) EI best_result <- results[[which.min(sapply(results, `[[`, \"value\"))]] # Return the next best point `x` as a single-row matrix return(matrix(best_result$par, nrow = 1)) } opt_monitor <- function(object) { return(min(object$data$Y)) } lim <- rbind(c(0, 1), c(0, 1)) m <- design(m, N = 80, limits = lim, f = shubert, method = ei, eval = opt_monitor) ## Initializing ... done ## * Metric: -125.203479 ## Iteration 1: ## - Locating ... done ## * Next design point: 0.352375 0.142570 ## - Updating and re-fitting ... done ## - Validating ... done ## * Metric: -125.203479 ## ## ... ## ## Iteration 6: ## - Locating ... done ## * Next design point: 0.299331 0.125606 ## - Updating and re-fitting ... done ## - Transiting to a GP emulator ... done ## - Validating ... done ## * Metric: -186.039545 ## ## ... ## ## Iteration 80: ## - Locating ... done ## * Next design point: 0.907645 0.000000 ## - Updating and re-fitting ... done ## - Validating ... done ## * Metric: -186.728582 draw(m) + plot_annotation(title = 'Bayesian Optimization Tracker') + labs(y = \"Minimum Value\") + # Add a horizontal line to represent the global minimum for benchmarking geom_hline( aes(yintercept = y, linetype = \"Global Minimum\"), # Global minimum data = data.frame(y = -186.7309), color = \"#E31A1C\", size = 0.5 ) + scale_linetype_manual( values = c(\"Global Minimum\" = \"dashed\"), name = \"\" # Remove the legend title ) draw(m, type = 'design') + plot_annotation(title = 'Bayesian Optimization Design') + # Highlight the global minima on the design plot geom_point( data = data.frame( .panel_x = c(\"X1\", \"X2\"), # x labels of panels .panel_y = c(\"X2\", \"X1\"), # y labels of panels X1 = c(0.1437, 0.2999), # X1 values for the global minima X2 = c(0.2999, 0.1437) # X2 values for the global minima ), aes(x = .panel_x, y = .panel_y), size = 1.25, shape = 6, color = \"#E31A1C\" )"},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/classification.html","id":"load-packages-and-data","dir":"Articles","previous_headings":"","what":"Load packages and data","title":"DGP Classification\n","text":"start loading required packages, now load iris data set, re-scale four input variables [0,1][0,1]. building classifier, set seed set_seed() package reproducibility split data training testing:","code":"library(dgpsi) library(dplyr) data(iris) iris <- iris %>% mutate(across(1:4, ~ (. - min(.)) / (max(.) - min(.)))) set_seed(9999) test_idx <- sample(seq_len(nrow(iris)), size = 30) train_data <- iris[-test_idx, ] test_data <- iris[test_idx, ] X_train <- as.matrix(train_data[, 1:4]) Y_train <- as.matrix(train_data[, 5]) X_test <- as.matrix(test_data[, 1:4]) Y_test <- as.matrix(test_data[, 5])"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/classification.html","id":"construct-and-train-a-dgp-classifier","dir":"Articles","previous_headings":"","what":"Construct and train a DGP classifier","title":"DGP Classification\n","text":"consider three-layer DGP classifier, using Matérn-2.5 kernel first layer squared exponential kernel second layer: Visualizing DGP object helps clarify layered structure non-Gaussian (case categorical) likelihoods. global inputs, 3-layered DGP comprised 2 hidden layers containing GPs, “likelihood layer” transforms preceding GP nodes one parameters required likelihood function. example, 3 possible categories use softmax link function, 3 parameters set second layer 3 GP nodes, one .","code":"m_dgp <- dgp(X_train, Y_train, depth = 3, name = c('matern2.5', 'sexp'), likelihood = \"Categorical\") ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:31<00:00, 15.63it/s] ## Imputing ... done summary(m_dgp)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/classification.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"DGP Classification\n","text":"now ready validate classifier via validate() 30 --sample testing positions: Finally, visualize OOS validation classifier: default, plot() displays true labels predicted label proportions input position. Alternatively, setting style = 2 plot() generates confusion matrix:","code":"m_dgp <- validate(m_dgp, X_test, Y_test) ## Initializing the OOS ... done ## Calculating the OOS ... done ## Saving results to the slot 'oos' in the dgp object ... done plot(m_dgp, X_test, Y_test) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done plot(m_dgp, X_test, Y_test, style = 2) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"load-the-package","dir":"Articles","previous_headings":"","what":"Load the package","title":"A Quick Guide to dgpsi","text":"","code":"library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"set-up-the-step-function","dir":"Articles","previous_headings":"","what":"Set up the step function","title":"A Quick Guide to dgpsi","text":"dgpsi provides function init_py() helps us set , initialize, re-install, uninstall underlying Python environment. run init_py() every time dgpsi loaded manually initiate Python environment. Alternatively, activate Python environment simply executing function dgpsi. example, Python environment automatically loaded run set_seed() package specify seed reproducibility: Define step function: generate ten training data points:","code":"set_seed(9999) f <- function(x) { if (x < 0.5) return(-1) if (x >= 0.5) return(1) } X <- seq(0, 1, length = 10) Y <- sapply(X, f)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"training","dir":"Articles","previous_headings":"","what":"Training","title":"A Quick Guide to dgpsi","text":"now build train DGP emulator three layers: progress bar displayed shows long takes finish training. able switch progress bar trace information setting verb = FALSE. Note want train DGP emulator m additional iterations, can simply m <- continue(m) instead rebuilding DGP emulator. trained DGP emulator can visualized using summary() function: visualization gives key information trained DGP emulator. Note auto-generated emulator nugget terms fixed 1e-6 GP nodes emulating deterministic step function (.e., like emulator interpolate training data points). prior scales (.e., variances) GP nodes first second layers fixed 1.0 GP node final layer estimated due attachment output. information change default settings construct train DGP emulator, see ?dgp. point, use write() save emulator m local file load using read() like make predictions emulator, e.g., another computer also package installed.","code":"m <- dgp(X, Y, depth = 3) ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:03<00:00, 148.10it/s] ## Imputing ... done summary(m)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"A Quick Guide to dgpsi","text":"emulator, can validate drawing validation plots. two types validation plots provided package. first one Leave-One-(LOO) cross validation plot: second validation plot --Sample (OOS) validation plot requires --sample testing data set. generate OOS data set contains 10 testing data points: can now perform OOS validation: Note style argument plot() function can used draw different types plot (see ?plot).","code":"plot(m) ## Validating and computing ... done ## Post-processing LOO results ... done ## Plotting ... done oos_x <- sample(seq(0, 1, length = 200), 10) oos_y <- sapply(oos_x, f) plot(m,oos_x,oos_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/dgpsi.html","id":"prediction","dir":"Articles","previous_headings":"","what":"Prediction","title":"A Quick Guide to dgpsi","text":"validation done, can make predictions DGP emulator. generate 200 data points step function [0,1][0,1]: predict locations: predict() function returns updated DGP emulator m contains slot named results gives posterior predictive means variances testing positions. can extract information plot emulation results check predictive performance constructed DGP emulator:","code":"test_x <- seq(0, 1, length = 200) test_y <- sapply(test_x, f) m <- predict(m, x = test_x) mu <- m$results$mean # extract the predictive means sd <- sqrt(m$results$var) # extract the predictive variance and compute the predictive standard deviations # compute predictive bounds which are two predictive standard deviations above and below the predictive means up <- mu + 2*sd lo <- mu - 2*sd plot(test_x, mu, type = 'l', lty = 2, lwd = 1.5, col = 'black', xlab = 'x', cex.axis = 1.3, cex.lab = 1.3, ylab = 'y', ylim = c(-1.5,1.5)) # predictive means polygon(c(test_x, rev(test_x)), c(up,rev(lo)), col = 'grey80', border = F) # credible interval lines(test_x, test_y, type = 'l', col = \"#D55E00\", lwd = 2) # Underlying truth lines(test_x, mu, type = 'l', lty = 2, lwd = 1.5, col = 'black') lines(X, Y, type = 'p', pch = 16, cex = 1, col = \"#0072B2\") # Training data points"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Large-Scale DGP Emulation\n","text":"","code":"library(dgpsi) library(lhs)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"construct-a-synthetic-simulator","dir":"Articles","previous_headings":"","what":"Construct a synthetic simulator","title":"Large-Scale DGP Emulation\n","text":"consider 2-dimensional synthetic simulator following functional form defined [0, 1] [0, 1]: now specify seed set_seed() package reproducibility generate 3000 training data points:","code":"f <- function(x) { x1 <- x[,1,drop=F] * 4 -2 x2 <- x[,2,drop=F] * 4 -2 y <- 0.5 + ((sin(x1^2-x2^2))^2 - 0.5)/(1 + 0.001*(x1^2+x2^2))^2 return(y) } set_seed(9999) X <- randomLHS(3000, 2) Y <- f(X)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"training","dir":"Articles","previous_headings":"","what":"Training","title":"Large-Scale DGP Emulation\n","text":"now build train large-scale DGP emulator using Vecchia implementation Stochastic Imputation (SI) framework:","code":"m <- dgp(X, Y, vecchia = TRUE) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 200: Layer 2: 100%|██████████| 200/200 [02:20<00:00, 1.43it/s] ## Imputing ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"Large-Scale DGP Emulation\n","text":"emulator, can validate Leave-One-(LOO) cross validation plot: --Sample (OOS) validation plot 1000 randomly generated testing locations: Note gp() can also operate Vecchia mode. problem, using m_gp <- gp(X, Y, vecchia = TRUE), found GP emulator m_gp achieved half NRMSE DGP emulator m, points outside credible intervals.","code":"plot(m) ## Validating and computing ... done ## Post-processing LOO results ... done ## Plotting ... done oos_x <- randomLHS(1000, 2) oos_y <- f(oos_x) plot(m, oos_x, oos_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/large_scale_emulation.html","id":"performance-tip","dir":"Articles","previous_headings":"Validation","what":"Performance tip","title":"Large-Scale DGP Emulation\n","text":"Vecchia implementation package leverages multiple cores available machine multi-thread computation. optimize performance, recommend experimenting number threads using set_thread_num(). current number threads used package can checked get_thread_num().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"load-the-package","dir":"Articles","previous_headings":"","what":"Load the package","title":"Linked (D)GP Emulation","text":"","code":"library(ggplot2) library(patchwork) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"construct-a-synthetic-system","dir":"Articles","previous_headings":"","what":"Construct a synthetic system","title":"Linked (D)GP Emulation","text":"consider following synthetic system involves three models defined : specify seed set_seed() package reproducibility generate 10 training data points Model 1 15 training data points Model 2 3:","code":"# Model 1 f1 <- function(x) { (sin(7.5*x)+1)/2 } # Model 2 f2 <- function(x) { 2/3*sin(2*(2*x - 1))+4/3*exp(-30*(2*(2*x-1))^2)-1/3 } # Model 3 f3 <- function(x) { x[1]*x[2]^2 } # Linked Model f123 <- function(x) { f3(c(f1(x),f2(f1(x)))) } set_seed(999) # Training data for Model 1 X1 <- seq(0, 1, length = 10) Y1 <- sapply(X1, f1) # Training data for Model 2 X2 <- seq(0, 1, length = 15) Y2 <- sapply(X2, f2) # Training data for Model 3 X3 <- cbind(X2, Y2) Y3 <- apply(X3, f3, MARGIN = 1)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-model-1","dir":"Articles","previous_headings":"","what":"Emulation of Model 1","title":"Linked (D)GP Emulation","text":"construct train GP emulator Matérn-2.5 kernel ID gp1: now validate trained GP emulator plot() LOO (alternatively, one can first use validate() store LOO results plotting plot()):","code":"m1 <- gp(X1, Y1, name = \"matern2.5\", id = \"gp1\") ## Auto-generating a GP structure ... done ## Initializing the GP emulator ... done ## Training the GP emulator ... done plot(m1) ## Validating and computing ... done ## Post-processing LOO results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-model-2","dir":"Articles","previous_headings":"","what":"Emulation of Model 2","title":"Linked (D)GP Emulation","text":"construct two-layered DGP emulator Matérn-2.5 kernels emulate Model 2: set ID gp2 using set_id() function: following plot visualizes LOO trained DGP emulator m2:","code":"m2 <- dgp(X2, Y2, depth = 2, name = \"matern2.5\") ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 264.72it/s] ## Imputing ... done m2 <- set_id(m2, \"gp2\") plot(m2) Validating and computing ... done Post-processing LOO results ... done Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-model-3","dir":"Articles","previous_headings":"","what":"Emulation of Model 3","title":"Linked (D)GP Emulation","text":"now construct three-layered DGP emulator Matérn-2.5 kernels emulate Model 3: following plot visualizes LOO trained DGP emulator m3:","code":"m3 <- dgp(X3, Y3, depth = 3, name = \"matern2.5\", id = \"gp3\" ) ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:04<00:00, 104.80it/s] ## Imputing ... done plot(m3) Validating and computing ... done Post-processing LOO results ... done Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/linked_DGP.html","id":"emulation-of-linked-model","dir":"Articles","previous_headings":"","what":"Emulation of Linked Model","title":"Linked (D)GP Emulation","text":"GP emulator m1 (Model 1), DGP emulator m2 (Model 2), DGP emulator m3 (Model 3) hand, now ready build linked emulator first defining data frame struc: struc data frame defines feed-forward connection structure three emulators linked system. row represents one--one connection output dimension (From_Output) source emulator (From_Emulator) input dimension (To_Input) target emulator (To_Emulator). example: - first row specifies global input (denoted Global)’s first dimension (column) connected first input dimension emulator gp1. - second row indicates first output dimension emulator gp1 connected first input dimension emulator gp2. Finally, can pass struc list three trained emulators lgp() create linked emulator. order emulators list matter: activating linked emulator prediction, ’s good practice first inspect structure emulator: visually check relationships emulators applying summary() m_link: everything looks correct, can activate linked emulator prediction: comparison, construct GP emulator whole system generating 15 training data points Model 1 Model 2: Finally, validate GP emulator linked emulator 300 testing data points [0,1][0,1]: plot compare performance: see linked emulator outperforms GP emulator significantly better mean prediction uncertainty quantification. real-life applications, rarely able generate many testing data points underlying computer simulators evaluate emulators whole input space. However, still able retain available realizations computer simulators validation. Say able afford 20 runs linked computer system: , can conduct OOS validation GP emulator: linked emulator: show linked emulator outperforms GP emulator significantly better predictive accuracy lower NRMSE.","code":"struc <- data.frame(From_Emulator = c(\"Global\", \"gp1\", \"gp1\", \"gp2\"), To_Emulator = c(\"gp1\", \"gp2\", \"gp3\", \"gp3\"), From_Output = c(1, 1, 1, 1), To_Input = c(1, 1, 1, 2)) struc ## From_Emulator To_Emulator From_Output To_Input ## 1 Global gp1 1 1 ## 2 gp1 gp2 1 1 ## 3 gp1 gp3 1 1 ## 4 gp2 gp3 1 2 emulators <- list(m1, m2, m3) m_link <- lgp(struc, emulators, activate = FALSE) Processing emulators ... done Linking and synchronizing emulators ... done summary(m_link) m_link <- lgp(struc, emulators, activate = TRUE) Processing emulators ... done Linking and synchronizing emulators ... done Activating the linked emulator ... done X_gp <- seq(0, 1, length = 15) Y_gp <- sapply(X_gp, f123) m_gp <- gp(X_gp, Y_gp, name = 'matern2.5') ## Auto-generating a GP structure ... done ## Initializing the GP emulator ... done ## Training the GP emulator ... done # Testing input test_x <- seq(0, 1, length = 300) # Testing output test_y <- sapply(test_x, f123) # Validate GP emulator m_gp <- validate(m_gp, x_test = test_x, y_test = test_y, verb = F) # Validate linked emulator m_link <- validate(m_link, x_test = test_x, y_test = test_y, verb = F) # GP emulator plot(m_gp, x_test = test_x, y_test = test_y, type = 'line', verb = F) + plot_annotation(title = 'GP Emulator', theme = theme(plot.title = element_text(hjust = 0.5))) # Linked emulator plot(m_link, x_test = test_x, y_test = test_y, type = 'line', verb = F) + plot_annotation(title = 'Linked Emulator', theme = theme(plot.title = element_text(hjust = 0.5))) # OOS testing input test_x_oos <- sample(seq(0, 1, length = 300), 20) # OOS testing output test_y_oos <- sapply(test_x_oos, f123) plot(m_gp, test_x_oos, test_y_oos, style = 2) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done plot(m_link, test_x_oos, test_y_oos, style = 2) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/motorcycle.html","id":"load-packages-and-data","dir":"Articles","previous_headings":"","what":"Load packages and data","title":"Non-Gaussian Emulation","text":"start loading packages: now load training data points, scale , plot : constructing emulator, first specify seed set_seed() package reproducibility split training data set testing data set:","code":"library(dgpsi) library(MASS) library(ggplot2) library(patchwork) X <- mcycle$times Y <- mcycle$accel X <- (X - min(X))/(max(X)-min(X)) Y <- scale(Y, center = TRUE, scale = TRUE) ggplot(data = data.frame(X = X, Y = Y), aes(x = X, y = Y)) + geom_point(shape = 16, size = 3) + labs(x = \"Time\", y = \"Acceleration\") + theme(axis.title = element_text(size = 13), axis.text = element_text(size = 13)) set_seed(9999) test_idx <- sample(seq_len(length(X)), size = 20) train_X <- X[-test_idx] train_Y <- Y[-test_idx,] test_x <- X[test_idx] test_y <- Y[test_idx,]"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/motorcycle.html","id":"construct-and-train-a-dgp-emulator","dir":"Articles","previous_headings":"","what":"Construct and train a DGP emulator","title":"Non-Gaussian Emulation","text":"consider three-layered DGP emulator squared exponential kernels heteroskedastic likelihood: choose heteroskedastic Gaussian likelihood setting likelihood = \"Hetero\" since data drawn plot show varying noise. can use summary() visualize structure specifications trained DGP emulator: comparison, also build GP emulator (gp()) incorporates homogeneous noise setting nugget_est = T initial nugget value 0.010.01: can also summarize trained GP emulator summary():","code":"m_dgp <- dgp(train_X, train_Y, depth = 3, likelihood = \"Hetero\") ## Auto-generating a 3-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 3: 100%|██████████| 500/500 [00:14<00:00, 35.52it/s] ## Imputing ... done summary(m_dgp) m_gp <- gp(train_X, train_Y, nugget_est = T, nugget = 1e-2) ## Auto-generating a GP structure ... done ## Initializing the GP emulator ... done ## Training the GP emulator ... done summary(m_gp)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/motorcycle.html","id":"validation","dir":"Articles","previous_headings":"","what":"Validation","title":"Non-Gaussian Emulation","text":"now ready validate emulators via validate() 20 --sample testing positions generated earlier: Note using validate() plotting can save subsequent computations compared simply invoking plot(), validate() stores validation results emulator objects plot() use , can, avoid calculating fly. Finally, plot OOS validation GP emulator: DGP emulator: Note still need provide test_x test_y plot() even already provided validate(). Otherwise, plot() draw LOO cross validation plot. visualizations show DGP emulator gives better performance GP emulator modeling heteroskedastic noise embedded underlying data set, even though quite similar NRMSEs.","code":"m_dgp <- validate(m_dgp, test_x, test_y) ## Initializing the OOS ... done ## Calculating the OOS ... done ## Saving results to the slot 'oos' in the dgp object ... done m_gp <- validate(m_gp, test_x, test_y) ## Initializing the OOS ... done ## Calculating the OOS ... done ## Saving results to the slot 'oos' in the gp object ... done plot(m_gp, test_x, test_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done plot(m_dgp, test_x, test_y) ## Validating and computing ... done ## Post-processing OOS results ... done ## Plotting ... done"},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Sequential Design I","text":"","code":"library(tidyverse) library(lhs) library(ggplot2) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"construct-a-synthetic-simulator","dir":"Articles","previous_headings":"","what":"Construct a synthetic simulator","title":"Sequential Design I","text":"consider non-stationary synthetic simulator 2-dimensional input functional form (Ba Joseph 2018) defined : Note provide simulator sequential design , defined function input x output matrices. commands generate contour function: can see figure synthetic simulator exhibits fluctuations bottom left input space top-right part, simulator shows little variation. now specify seed set_seed() reproducibility generate initial design 5 design points using maximin Latin hypercube sampler: track qualities constructed emulators sequential design, generate validation dataset:","code":"f <- function(x) { sin(1/((0.7*x[,1,drop=F]+0.3)*(0.7*x[,2,drop=F]+0.3))) } x1 <- seq(0, 1, length.out = 100) x2 <- seq(0, 1, length.out = 100) dat <- expand_grid(x1 = x1, x2 = x2) dat <- mutate(dat, f = f(cbind(x1, x2))) ggplot(dat, aes(x1, x2, fill = f)) + geom_tile() + scale_fill_continuous(type = \"viridis\") set_seed(99) X <- maximinLHS(5,2) Y <- f(X) validate_x <- maximinLHS(200,2) validate_y <- f(validate_x)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"dgp-emulation-with-sequential-designs","dir":"Articles","previous_headings":"","what":"DGP emulation with sequential designs","title":"Sequential Design I","text":"start sequential design, initialize two-layered DGP emulator (2 GP nodes first layer 1 GP node second layer) using generated initial design: specify boundaries input parameter space f sequential design can restrict search new points. limits input parameters defined matrix row giving lower upper limits input parameter. boundaries specified, ready conduct sequential design adaptively improve emulator, m, via design(). function design() provides simple flexible implementation sequential design emulation. vignette, demonstrate basic usage refer users ?design advanced specification, e.g., checkpoints manually control design progress schedules re-fit validate emulators. illustrative purpose, implement two waves sequential design m: first wave see 1 GP node removed first layer automatic pruning DGP leaves one node first second layer DGP hierarchy respectively. helps accelerate inference DGP emulator subsequent waves sequential design maintaining accuracy. now start second wave sequential design: Finally, resume second wave 10 additional iterations: Resuming rather adding additional wave can useful feature, particularly plotting using draw(). sequential design done, can inspect enriched design applying draw() m: can seen figure added design points concentrate bottom-left corner input space simulator f exhibits variation thus needs data well-emulated. can also visualize improvement RMSE sequential design:","code":"m <- dgp(X, Y) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 353.90it/s] ## Imputing ... done lim_1 <- c(0, 1) lim_2 <- c(0, 1) lim <- rbind(lim_1, lim_2) # 1st wave with 25 steps m <- design(m, N = 25, limits = lim, f = f, x_test = validate_x, y_test = validate_y) ## Initializing ... done ## * RMSE: 0.527337 ## Iteration 1: ## - Locating ... done ## * Next design point: 0.930278 0.033542 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.532428 ## ## ... ## ## Iteration 18: ## - Locating ... done ## * Next design point: 0.706449 0.048681 ## - Updating and re-fitting ... done ## - Pruning 1 node(s) in layer 1 ... done ## - Re-fitting ... done ## - Validating ... done ## * RMSE: 0.139819 ## ## ... ## ## Iteration 25: ## - Locating ... done ## * Next design point: 0.000010 0.483511 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.071370 # 2nd wave with 10 steps m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) ## Initializing ... done ## * RMSE: 0.071370 ## Iteration 1: ## - Locating ... done ## * Next design point: 0.461239 0.415336 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.056827 ## ## ... ## ## Iteration 10: ## - Locating ... done ## * Next design point: 0.177935 0.459387 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.011508 # 2nd wave with 10 additional steps m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, new_wave = FALSE) ## Iteration 11: ## - Locating ... done ## * Next design point: 0.029874 0.763962 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.014444 ## ## ... ## ## Iteration 20: ## - Locating ... done ## * Next design point: 0.829788 0.452129 ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.004783 draw(m, 'design') draw(m, 'rmse')"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"comparison-to-dgp-emulators-with-space-filling-designs","dir":"Articles","previous_headings":"","what":"Comparison to DGP emulators with space-filling designs","title":"Sequential Design I","text":"build four DGP emulators static space-filling Latin hypercube designs (LHD) size 10, 20, 30, 40, 50 respectively: extract RMSEs add sequential design validation plot (log-scale) comparison: can seen plot static space-filling designs, quality emulator may improved design size increases. increasing size space-filling design may capture regions simulator exhibits variation, thus cause emulators higher RMSEs constructed sequential design.","code":"# DGP emulator with a LHD of size 10 X1 <- maximinLHS(10,2) Y1 <- f(X1) m1 <- dgp(X1, Y1, verb = F) # DGP emulator with a LHD of size 20 X2 <- maximinLHS(20,2) Y2 <- f(X2) m2 <- dgp(X2, Y2, verb = F) # DGP emulator with a LHD of size 30 X3 <- maximinLHS(30,2) Y3 <- f(X3) m3 <- dgp(X3, Y3, verb = F) # DGP emulator with a LHD of size 40 X4 <- maximinLHS(40,2) Y4 <- f(X4) m4 <- dgp(X4, Y4, verb = F) # DGP emulator with a LHD of size 50 X5 <- maximinLHS(50,2) Y5 <- f(X5) m5 <- dgp(X5, Y5, verb = F) # validation of the DGP emulator with the LHD of size 10 m1 <- validate(m1, x_test = validate_x, y_test = validate_y, verb = F) rmse1 <- m1$oos$rmse # validation of the DGP emulator with the LHD of size 20 m2 <- validate(m2, x_test = validate_x, y_test = validate_y, verb = F) rmse2 <- m2$oos$rmse # validation of the DGP emulator with the LHD of size 30 m3 <- validate(m3, x_test = validate_x, y_test = validate_y, verb = F) rmse3 <- m3$oos$rmse # validation of the DGP emulator with the LHD of size 40 m4 <- validate(m4, x_test = validate_x, y_test = validate_y, verb = F) rmse4 <- m4$oos$rmse # validation of the DGP emulator with the LHD of size 50 m5 <- validate(m5, x_test = validate_x, y_test = validate_y, verb = F) rmse5 <- m5$oos$rmse # create a dataframe that stores the RMSEs of the four DGP emulators rmse_static <- data.frame('N' = c(10, 20, 30, 40, 50), 'rmse' = c(rmse1, rmse2, rmse3, rmse4, rmse5), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30', 'lhd-40', 'lhd-50')) draw(m, 'rmse', log = T) + geom_point(data = rmse_static, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(2, 3, 4, 8, 15))"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design.html","id":"see-also","dir":"Articles","previous_headings":"Comparison to DGP emulators with space-filling designs","what":"See also","title":"Sequential Design I","text":"See Sequential Design II sequential design bundle DGP emulators automatic terminations.","code":""},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"load-the-packages","dir":"Articles","previous_headings":"","what":"Load the packages","title":"Sequential Design II","text":"","code":"library(lhs) library(ggplot2) library(patchwork) library(dgpsi)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"construct-a-synthetic-simulator","dir":"Articles","previous_headings":"","what":"Construct a synthetic simulator","title":"Sequential Design II","text":"construct synthetic simulator one-dimensional input [0, 1] three-dimensional output. Note function defined way input, x, output matrices. following figure shows true functional forms three outputs simulator [0,1][0, 1]: now specify seed set_seed() package reproducibility generate initial design 5 design points using maximin Latin hypercube sampler: generate validation dataset track stop sequential design:","code":"f <- function(x) { y1 = sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) y2 = 1/3*sin(2*(2*x - 1))+2/3*exp(-30*(2*(2*x-1))^2)+1/3 y3 = (sin(7.5*x)+1)/2 return(cbind(y1, y2, y3)) } dense_x <- seq(0, 1, length = 200) dense_y <- f(dense_x) output1 <- data.frame('x' = dense_x, 'y' = dense_y[,1]) output2 <- data.frame('x' = dense_x, 'y' = dense_y[,2]) output3 <- data.frame('x' = dense_x, 'y' = dense_y[,3]) p1 <- ggplot(data = output1, aes(x = x, y = y)) + geom_line(color = 'dodgerblue2') + ggtitle('Output 1') + theme(plot.title = element_text(size = 10)) p2 <- ggplot(data = output2, aes(x = x, y = y)) + geom_line(color = '#E31A1C') + ggtitle('Output 2') + theme(plot.title = element_text(size = 10)) p3 <- ggplot(data = output3, aes(x = x, y = y)) + geom_line(color = 'green4') + ggtitle('Output 3') + theme(plot.title = element_text(size = 10)) wrap_plots(list(p1, p2, p3)) + plot_annotation(title = 'Synthetic Simulator') set_seed(9999) X <- maximinLHS(5, 1) Y <- f(X) validate_x <- maximinLHS(200, 1) validate_y <- f(validate_x)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"construct-a-bundle-of-dgp-emulators","dir":"Articles","previous_headings":"","what":"Construct a bundle of DGP emulators","title":"Sequential Design II","text":"start sequential design, build three DGP emulators emulate three outputs simulator f independently: Note global connection turned first two DGP emulators found yields better emulation performance. build bundle three DGP emulators using pack():","code":"m1 <- dgp(X, Y[,1], connect = F) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 335.63it/s] ## Imputing ... done m2 <- dgp(X, Y[,2], connect = F) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 294.20it/s] ## Imputing ... done m3 <- dgp(X, Y[,3]) ## Auto-generating a 2-layered DGP structure ... done ## Initializing the DGP emulator ... done ## Training the DGP emulator: ## Iteration 500: Layer 2: 100%|██████████| 500/500 [00:01<00:00, 387.69it/s] ## Imputing ... done m <- pack(m1, m2, m3)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"sequential-design-for-the-emulator-bundle","dir":"Articles","previous_headings":"","what":"Sequential design for the emulator bundle","title":"Sequential Design II","text":"begin sequential design, first specify limit input: set target RMSE stop sequential design: choose 0.01 equivalent 1% normalized error given ranges outputs [0,1]. can set different targets different outputs, e.g., setting target <- c(0.005, 0.02, 0.01). start first-wave sequential design 10 steps: can seen first step, DGP emulator third output already reached target, refinements (.e., additions design points third DGP emulator) performed remaining steps. end first wave, DGP emulators first second outputs yet reached target. point, can proceed second wave repeating command . However, demonstrate alternative approach , define aggregation function (applicable built-method functions design()). function aggregates criterion scores across three outputs, ensuring design points added three emulators step, instead selecting different design points emulator. Using aggregation approach can advantageous different outputs exhibit similar behavior respect input, reduces number simulations required iteration. However, outputs behave differently, may effective add distinct design points emulator achieve lower errors quickly. define aggregation function g compute weighted average scores: Since third emulator already reached target, assign zero weights weights 0.6 0.4 first second emulators respectively: now pass aggregate function, g(), weight argument design() second wave sequential design 15 steps: first second emulators reached target iteration 8 5 second wave, respectively. sequential design points three emulators can plotted draw(): figure shows , first emulator, design points added 0.5, second emulator, design points concentrated around 0.5. third emulator, resulting design space-filling. design point distributions align functional complexities three outputs. However, second wave, uses aggregation function, additional points added 0.5 second emulator due higher weight assigned first emulator. points may necessary second output, functional behavior require refinement region. observation aligns earlier argument using aggregation function add design points outputs differing behaviors may always effective.","code":"lim <- c(0, 1) target <- 0.01 # 1st wave of the sequential design with 10 steps m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, target = target) ## Initializing ... done ## * RMSE: 0.383722, RMSE: 0.154689, RMSE: 0.008984 ## Iteration 1: ## - Locating ... done ## * Next design point (Emulator1): 0.207895 ## * Next design point (Emulator2): 0.235873 ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.337517, RMSE: 0.155087, RMSE: 0.008984 ## ## ... ## ## Iteration 10: ## - Locating ... done ## * Next design point (Emulator1): 0.430889 ## * Next design point (Emulator2): 0.479682 ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.120320, RMSE: 0.062365, RMSE: 0.008984 ## Targets not reached for all emulators at the end of the sequential design. g <- function(x, weight){ x[,1] <- x[,1]*weight[1] x[,2] <- x[,2]*weight[2] x[,3] <- x[,3]*weight[3] return(rowSums(x)) } weight <- c(0.6, 0.4, 0) # 2nd wave with 15 steps m <- design(m, N = 15, limits = lim, f = f, x_test = validate_x, y_test = validate_y, aggregate = g, target = 0.01, weight = weight) ## Initializing ... done ## * RMSE: 0.120320, RMSE: 0.062365, RMSE: 0.008984 ## Iteration 1: ## - Locating ... done ## * Next design point (Emulator1): 0.062821 ## * Next design point (Emulator2): 0.062821 ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.151946, RMSE: 0.061865, RMSE: 0.008984 ## ## ... ## ## Iteration 6: ## - Locating ... done ## * Next design point (Emulator1): 0.233155 ## * Next design point (Emulator2): None (target reached) ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.014147, RMSE: 0.004410, RMSE: 0.008984 ## ## ... ## ## Iteration 8: ## - Locating ... done ## * Next design point (Emulator1): 0.009688 ## * Next design point (Emulator2): None (target reached) ## * Next design point (Emulator3): None (target reached) ## - Updating and re-fitting ... done ## - Validating ... done ## * RMSE: 0.005913, RMSE: 0.004410, RMSE: 0.008984 Target reached! Sequential design stopped at step 8. draw(m, 'design')"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"comparison-to-dgp-emulators-with-space-filling-designs","dir":"Articles","previous_headings":"","what":"Comparison to DGP emulators with space-filling designs","title":"Sequential Design II","text":"build three independent DGP emulators three outputs static space-filling Latin hypercube designs (LHD) size 10, 20, 30 respectively: extract RMSEs add sequential design validation plot (log-scale) comparison: can seen plot sequential design efficient batch space-filling design, achieving similar RMSE fat fewer design points, particularly first emulator bundle.","code":"# DGP emulators with a LHD of size 10 X1 <- maximinLHS(10, 1) Y1 <- f(X1) m11 <- dgp(X1, Y1[,1], connect = F, verb = F) m12 <- dgp(X1, Y1[,2], connect = F, verb = F) m13 <- dgp(X1, Y1[,3], verb = F) # DGP emulator with a LHD of size 20 X2 <- maximinLHS(20, 1) Y2 <- f(X2) m21 <- dgp(X2, Y2[,1], connect = F, verb = F) m22 <- dgp(X2, Y2[,2], connect = F, verb = F) m23 <- dgp(X2, Y2[,3], verb = F) # DGP emulator with a LHD of size 30 X3 <- maximinLHS(30, 1) Y3 <- f(X3) m31 <- dgp(X3, Y3[,1], connect = F, verb = F) m32 <- dgp(X3, Y3[,2], connect = F, verb = F) m33 <- dgp(X3, Y3[,3], verb = F) # validations of the first DGP emulator m11 <- validate(m11, x_test = validate_x, y_test = validate_y[,1], verb = F) m21 <- validate(m21, x_test = validate_x, y_test = validate_y[,1], verb = F) m31 <- validate(m31, x_test = validate_x, y_test = validate_y[,1], verb = F) rmse_static_1 <- data.frame('N' = c(10, 20, 30), 'rmse' = c(m11$oos$rmse, m21$oos$rmse, m31$oos$rmse), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30')) # validations of the second DGP emulator m12 <- validate(m12, x_test = validate_x, y_test = validate_y[,2], verb = F) m22 <- validate(m22, x_test = validate_x, y_test = validate_y[,2], verb = F) m32 <- validate(m32, x_test = validate_x, y_test = validate_y[,2], verb = F) rmse_static_2 <- data.frame('N' = c(10, 20, 30), 'rmse' = c(m12$oos$rmse, m22$oos$rmse, m32$oos$rmse), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30')) # # validations of the third DGP emulator m13 <- validate(m13, x_test = validate_x, y_test = validate_y[,3], verb = F) m23 <- validate(m23, x_test = validate_x, y_test = validate_y[,3], verb = F) m33 <- validate(m33, x_test = validate_x, y_test = validate_y[,3], verb = F) rmse_static_3 <- data.frame('N' = c(10, 20, 30), 'rmse' = c(m13$oos$rmse, m23$oos$rmse, m33$oos$rmse), 'LHD' = c('lhd-10', 'lhd-20', 'lhd-30')) p <- draw(m, type = 'rmse', log = T) p[[1]] <- p[[1]] + geom_point(data = rmse_static_1, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(3, 4, 8)) p[[2]] <- p[[2]] + geom_point(data = rmse_static_2, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(3, 4, 8)) p[[3]] <- p[[3]] + geom_point(data = rmse_static_3, mapping = aes(x = N, y = rmse, group = LHD, shape = LHD), color = '#E69F00', size = 1.5) + scale_shape_manual(values = c(3, 4, 8)) p"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/articles/seq_design_2.html","id":"see-also","dir":"Articles","previous_headings":"Comparison to DGP emulators with space-filling designs","what":"See also","title":"Sequential Design II","text":"See Sequential Design sequential design automatic structure simplification DGP emulator 2D simulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Deyu Ming. Author, maintainer, copyright holder. Daniel Williamson. Author.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Ming, D. Guillas, S. (2021) Linked Gaussian process emulation systems computer models using Matérn kernels adaptive design, SIAM/ASA Journal Uncertainty Quantification. 9(4), 1615-1642. Ming, D., Williamson, D., Guillas, S. (2023) Deep Gaussian process emulation using stochastic imputation, Technometrics. (65)2, 150-161. Ming, D. Williamson, D. (2023) Linked deep Gaussian process emulation model networks, arXiv:2306.01212. Ming, D. Williamson, D. (2024) dgpsi: R package powered Python modelling linked deep Gaussian processes, R package version 2.4.0. https://CRAN.R-project.org/package=dgpsi.","code":"@Article{, title = {Linked Gaussian process emulation for systems of computer models using Matérn kernels and adaptive design}, author = {Deyu Ming and Serge Guillas}, journal = {SIAM/ASA Journal on Uncertainty Quantification}, year = {2021}, volume = {9}, number = {4}, pages = {1615--1642}, } @Article{, title = {Deep Gaussian process emulation using stochastic imputation}, author = {Deyu Ming and Daniel Williamson and Serge Guillas}, journal = {Technometrics}, year = {2023}, volume = {65}, number = {2}, pages = {150--161}, } @Unpublished{, title = {Linked deep Gaussian process emulation for model networks}, author = {Deyu Ming and Daniel Williamson}, note = {arXiv:2306.01212}, year = {2023}, } @Manual{, title = {dgpsi: An R package powered by Python for modelling linked deep Gaussian processes}, author = {Deyu Ming and Daniel Williamson}, note = {R package version 2.4.0}, url = {https://CRAN.R-project.org/package=dgpsi}, year = {2024}, }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"dgpsi-","dir":"","previous_headings":"","what":"R Interface to dgpsi","title":"R Interface to dgpsi","text":"R package dgpsi provides R interface Python package dgpsi deep linked Gaussian process emulations using stochastic imputation (SI). Hassle-free Python Setup don’t need prior knowledge Python start using package, need single click R (see Installation section ) automatically installs activates required Python environment !","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"features","dir":"","previous_headings":"","what":"Features","title":"R Interface to dgpsi","text":"dgpsi currently following features: Gaussian process emulations separable non-separable squared exponential Matérn-2.5 kernels. multiple layers; multiple GP nodes; separable non-separable squared exponential Matérn-2.5 kernels; global input connections; non-Gaussian likelihoods (Poisson, Negative-Binomial, heteroskedastic Gaussian, Categorical). Linked emulations feed-forward systems computer models linking (D)GP emulators deterministic individual computer models. Fast Leave-One-(LOO) --Sample (OOS) validations GP, DGP, linked (D)GP emulators. Multi-core predictions validations GP, DGP, Linked (D)GP emulators. Sequential designs (D)GP emulators bundles (D)GP emulators. Automatic pruning DGP emulators, statically dynamically. Large-scale GP, DGP, Linked (D)GP emulations. Scalable DGP classification using Stochastic Imputation. Bayesian optimization.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"getting-started","dir":"","previous_headings":"","what":"Getting started","title":"R Interface to dgpsi","text":"Check Quick Guide dgpsi get started package. experimental features, check website development version.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R Interface to dgpsi","text":"can install package CRAN: development version GitHub: installation, run load package. install activate required Python environment automatically, can either run dgpsi::init_py() explicitly simply call function package. ’s - package ready use! Note loading dgpsi, package may take time compile initiate underlying Python environment first time function dgpsi executed. subsequent function calls won’t require re-compiling re-activation Python environment, faster. experience Python related issues using package, please try reinstall Python environment: uninstall completely Python environment: reinstall:","code":"install.packages('dgpsi') devtools::install_github('mingdeyu/dgpsi-R') library(dgpsi) dgpsi::init_py(reinstall = T) dgpsi::init_py(uninstall = T) dgpsi::init_py()"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"research-notice","dir":"","previous_headings":"","what":"Research Notice","title":"R Interface to dgpsi","text":"package part ongoing research initiative. detailed information research aspects guidelines use, please refer Research Notice.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"R Interface to dgpsi","text":"Ming, D. Williamson, D. (2023) Linked deep Gaussian process emulation model networks. arXiv:2306.01212 Ming, D., Williamson, D., Guillas, S. (2023) Deep Gaussian process emulation using stochastic imputation. Technometrics. 65(2), 150-161. Ming, D. Guillas, S. (2021) Linked Gaussian process emulation systems computer models using Matérn kernels adaptive design, SIAM/ASA Journal Uncertainty Quantification. 9(4), 1615-1642.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"function searches candidate set locate next design point(s) added (D)GP emulator bundle (D)GP emulators using Active Learning MacKay (ALM) criterion (see reference ).","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"","code":"alm(object, ...) # S3 method for class 'gp' alm( object, x_cand = NULL, n_start = 20, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, ... ) # S3 method for class 'dgp' alm( object, x_cand = NULL, n_start = 20, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... ) # S3 method for class 'bundle' alm( object, x_cand = NULL, n_start = 20, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. ... arguments (names different arguments used alm()) used aggregate can passed . x_cand matrix (row design point column input dimension) gives candidate set next design point(s) determined. object instance bundle class aggregate supplied, x_cand can also list. list must length equal number emulators object, element matrix representing candidate set corresponding emulator bundle. Defaults NULL. n_start integer gives number initial design points used determine next design point(s). argument used x_cand NULL. Defaults 20. batch_size integer gives number design points chosen. Defaults 1. M size conditioning set Vecchia approximation criterion calculation. argument used emulator object constructed Vecchia approximation. Defaults 50. workers number processes used design point selection. set NULL, number processes set max physical cores available %/% 2. Defaults 1. argument currently support Windows machines aggregate function provided, due significant overhead caused initializing Python environment worker spawning. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. argument used x_cand = NULL. Defaults NULL. int bool vector bools indicates input dimension integer type. single bool given, applied input dimensions. vector provided, length equal input dimensions applied individual input dimensions. argument used x_cand = NULL. Defaults FALSE. aggregate R function aggregates scores ALM across different output dimensions (object instance dgp class) across different emulators (object instance bundle class). function specified following basic form: first argument matrix representing scores. rows matrix correspond different design points. number columns matrix equal : emulator output dimension object instance dgp class; number emulators contained object object instance bundle class. output vector gives aggregate scores different design points. Set NULL disable aggregation. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"x_cand NULL: object instance gp class, vector length batch_size returned, containing positions (row numbers) next design points x_cand. object instance dgp class, vector length batch_size * D returned, containing positions (row numbers) next design points x_cand added DGP emulator. D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, matrix returned batch_size rows column emulator bundle, containing positions (row numbers) next design points x_cand individual emulators. x_cand NULL: object instance gp class, matrix batch_size rows returned, giving next design points evaluated. object instance dgp class, matrix batch_size * D rows returned, : D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, list returned length equal number emulators bundle. element list matrix batch_size rows, row represents design point added corresponding emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"first column matrix supplied first argument aggregate must correspond first output dimension DGP emulator object instance dgp class, subsequent columns dimensions. object instance bundle class, first column must correspond first emulator bundle, subsequent columns emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"MacKay, D. J. (1992). Information-based objective functions active data selection. Neural Computation, 4(4), 590-604.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/alm.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM) — alm","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 1D non-stationary function f <- function(x) { sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # training a 2-layered DGP emulator with the global connection off m <- dgp(X, Y, connect = F) # specify the input range lim <- c(0,1) # locate the next design point using ALM X_new <- alm(m, limits = lim) # obtain the corresponding output at the located design point Y_new <- f(X_new) # combine the new input-output pair to the existing data X <- rbind(X, X_new) Y <- rbind(Y, Y_new) # update the DGP emulator with the new input and output data and refit m <- update(m, X, Y, refit = TRUE) # plot the LOO validation plot(m) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine layers — combine","title":"Combine layers — combine","text":"function deprecated removed next release, simply wrapper list() function. construct linked (D)GP structures, please use updated lgp() function, provides simpler efficient approach building (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine layers — combine","text":"","code":"combine(...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine layers — combine","text":"... sequence lists. list represents system layer contains emulators (produced gp() dgp()) layer.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine layers — combine","text":"list defining linked (D)GP structure passed struc lgp().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/combine.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Combine layers — combine","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":null,"dir":"Reference","previous_headings":"","what":"Continue training a DGP emulator — continue","title":"Continue training a DGP emulator — continue","text":"function implements additional training iterations DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Continue training a DGP emulator — continue","text":"","code":"continue( object, N = NULL, cores = 1, ess_burn = 10, verb = TRUE, burnin = NULL, B = NULL )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Continue training a DGP emulator — continue","text":"object instance dgp class. N additional number iterations train DGP emulator. set NULL, number iterations set 500 DGP emulator constructed without Vecchia approximation, set 200 Vecchia approximation used. Defaults NULL. cores number processes used optimize GP components (layer) M-step training. set NULL, number processes set (max physical cores available - 1) DGP emulator constructed without Vecchia approximation. Otherwise, number processes set max physical cores available %/% 2. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. ess_burn number burnin steps ESS-within-Gibbs -step training. Defaults 10. verb bool indicating progress bar printed training. Defaults TRUE. burnin number training iterations discarded point estimates calculation. Must smaller overall training iterations -far implemented. specified, last 25% iterations used. overrides value burnin set dgp(). Defaults NULL. B number imputations produce predictions. Increase value account imputation uncertainty. overrides value B set dgp() B NULL. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Continue training a DGP emulator — continue","text":"updated object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Continue training a DGP emulator — continue","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Continue training a DGP emulator — continue","text":"One can also use function fit untrained DGP emulator constructed dgp() training = FALSE. following slots: loo oos created validate(); results created predict() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/continue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Continue training a DGP emulator — continue","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":null,"dir":"Reference","previous_headings":"","what":"Restore the serialized emulator — deserialize","title":"Restore the serialized emulator — deserialize","text":"function restores serialized emulator created serialize().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Restore the serialized emulator — deserialize","text":"","code":"deserialize(object)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Restore the serialized emulator — deserialize","text":"object serialized object emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Restore the serialized emulator — deserialize","text":"S3 class GP emulator, DGP emulator, linked (D)GP emulator, bundle (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Restore the serialized emulator — deserialize","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Restore the serialized emulator — deserialize","text":"See Note section serialize().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/deserialize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Restore the serialized emulator — deserialize","text":"","code":"if (FALSE) { # \\dontrun{ library(future) library(future.apply) library(dgpsi) # model f <- function(x) { (sin(7.5*x)+1)/2 } # training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # train a DGP emulator m <- dgp(X, Y, name = \"matern2.5\") # testing input data X_dgp <- seq(0, 1, length = 100) # serialize the DGP emulator m_serialized <- serialize(m) # start a multi-session with three cores for parallel predictions plan(multisession, workers = 3) # perform parallel predictions results <- future_lapply(1:length(X_dgp), function(i) { m_deserialized <- deserialize(m_serialized) mean_i <- predict(m_deserialized, X_dgp[i])$results$mean }, future.seed = TRUE) # reset the future plan to sequential plan(sequential) # combine mean predictions pred_mean <- do.call(rbind, results) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":null,"dir":"Reference","previous_headings":"","what":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"function implements sequential design active learning (D)GP emulator bundle (D)GP emulators, supporting array popular methods well user-specified approaches. can also used wrapper Bayesian optimization methods.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"","code":"design( object, N, x_cand, y_cand, n_sample, n_cand, limits, f, reps, freq, x_test, y_test, reset, target, method, batch_size, eval, verb, autosave, new_wave, M_val, cores, ... ) # S3 method for class 'gp' design( object, N, x_cand = NULL, y_cand = NULL, n_sample = 200, n_cand = lifecycle::deprecated(), limits = NULL, f = NULL, reps = 1, freq = c(1, 1), x_test = NULL, y_test = NULL, reset = FALSE, target = NULL, method = vigf, batch_size = 1, eval = NULL, verb = TRUE, autosave = list(), new_wave = TRUE, M_val = 50, cores = 1, ... ) # S3 method for class 'dgp' design( object, N, x_cand = NULL, y_cand = NULL, n_sample = 200, n_cand = lifecycle::deprecated(), limits = NULL, f = NULL, reps = 1, freq = c(1, 1), x_test = NULL, y_test = NULL, reset = FALSE, target = NULL, method = vigf, batch_size = 1, eval = NULL, verb = TRUE, autosave = list(), new_wave = TRUE, M_val = 50, cores = 1, train_N = NULL, refit_cores = 1, pruning = TRUE, control = list(), ... ) # S3 method for class 'bundle' design( object, N, x_cand = NULL, y_cand = NULL, n_sample = 200, n_cand = lifecycle::deprecated(), limits = NULL, f = NULL, reps = 1, freq = c(1, 1), x_test = NULL, y_test = NULL, reset = FALSE, target = NULL, method = vigf, batch_size = 1, eval = NULL, verb = TRUE, autosave = list(), new_wave = TRUE, M_val = 50, cores = 1, train_N = NULL, refit_cores = 1, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. N number iterations sequential design. x_cand matrix (row design point column input dimension) gives candidate set next design points determined. Defaults NULL. y_cand matrix (row simulator evaluation column output dimension) gives realizations simulator input positions x_cand. Defaults NULL. n_sample integer gives size sub-set sampled candidate set x_cand step sequential design determine next design point, x_cand NULL. Defaults 200. n_cand argument deprecated. Use n_sample instead. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. Set limits = NULL x_cand supplied. argument used x_cand supplied, .e., x_cand = NULL. Defaults NULL. provide custom method function argument called limits, value limits passed function. f R function representing simulator. f must adhere following rules: First argument: matrix rows correspond different design points, columns represent input dimensions. Function output: matrix rows correspond different outputs (matching input design points) columns represent output dimensions. one output dimension, function return matrix single column. alternatively, list : first element output matrix described . additional named elements can optionally update values arguments matching names passed via .... list output useful additional arguments f, method, eval need updated sequential design iteration. See Note section additional details. argument required must supplied y_cand = NULL. Defaults NULL. reps integer gives number repetitions located design points created used evaluations f. Set argument integer greater 1 f stochastic function can generate different responses given input supplied emulator object can deal stochastic responses, e.g., (D)GP emulator nugget_est = TRUE DGP emulator likelihood layer. argument used f supplied. Defaults 1. freq vector two integers first element indicating number iterations taken re-estimating emulator hyperparameters, second element defining number iterations take re-calculation evaluating metrics validation set (see x_test ) via eval function. Defaults c(1, 1). x_test matrix (row input testing data point column input dimension) gives testing input data evaluate emulator freq[2] iterations sequential design. Set NULL LOO-based emulator validation. Defaults NULL. argument used eval = NULL. y_test testing output data corresponding x_test emulator validation freq[2] iterations sequential design: object instance gp class, y_test matrix one column row contains testing output data point corresponding row x_test. object instance dgp class, y_test matrix rows containing testing output data points corresponding rows x_test columns representing output dimensions. object instance bundle class, y_test matrix row representing outputs corresponding row x_test column representing output different emulators bundle. Set NULL LOO-based emulator validation. Defaults NULL. argument used eval = NULL. reset bool vector bools indicating whether reset hyperparameters emulator(s) initial values (set initial construction) re-fitting. re-fitting occurs based frequency specified freq[1]. option useful hyperparameters suspected converged local optimum affecting validation performance. single bool provided, applies every iteration sequential design. vector provided, length must equal N (even re-fit frequency specified freq[1] 1) apply corresponding iterations sequential design. Defaults FALSE. target number vector specifying target evaluation metric value(s) sequential design terminate. Defaults NULL, case sequential design stops N steps. See Note section details target. method R function determines next design points evaluated f. function must adhere following rules: First argument: emulator object, can one following: instance gp class (produced gp()); instance dgp class (produced dgp()); instance bundle class (produced pack()). Second argument (x_cand NULL): candidate matrix representing set potential design points method function selects next points. Function output: x_cand NULL: gp dgp objects, output must vector row indices corresponding selected design points candidate matrix (second argument). bundle objects, output must matrix containing row indices selected design points candidate matrix. column corresponds indices individual emulator bundle. x_cand NULL: gp dgp objects, output must matrix row represents new design point added. bundle objects, output must list length equal number emulators bundle. element list matrix rows represent new design points corresponding emulator. See alm(), mice(), vigf() examples built-method functions. Defaults vigf(). batch_size integer specifying number design points select single iteration. Defaults 1. argument used built-method functions alm(), mice(), vigf(). provide custom method function argument named batch_size, value batch_size passed function. eval R function computes customized metric evaluating emulator performance. function must adhere following rules: First argument: emulator object, can one following: instance gp class (produced gp()); instance dgp class (produced dgp()); instance bundle class (produced pack()). Function output: gp objects, output must single metric value. dgp objects, output can single metric value vector metric values length equal number output dimensions. bundle objects, output can single metric value vector metric values length equal number emulators bundle. custom function provided, built-evaluation metric (RMSE log-loss, case DGP emulators categorical likelihoods) used. Defaults NULL. See Note section additional details. verb bool indicating trace information printed sequential design. Defaults TRUE. autosave list contains configuration settings automatic saving emulator: switch: bool indicating whether enable automatic saving emulator sequential design. set TRUE, emulator final iteration always saved. Defaults FALSE. directory: string specifying directory path emulators stored. Emulators stored sub-directory directory named 'emulator-id'. Defaults './check_points'. fname: string representing base name saved emulator files. Defaults 'check_point'. save_freq: integer indicating frequency automatic saves, measured number iterations. Defaults 5. overwrite: bool value controlling file saving behavior. set TRUE, new automatic save overwrites previous one, keeping latest version. FALSE, automatic save creates new file, preserving previous versions. Defaults FALSE. new_wave bool indicating whether current call design() create new wave sequential designs add next sequence designs recent wave. argument relevant waves already exist emulator. Creating new waves can improve visualization sequential design performance across different calls design() via draw(), allows specifying different evaluation frequency freq. However, disabling option can help limit number waves visualized draw() avoid issues running distinct colors large numbers waves. Defaults TRUE. M_val integer gives size conditioning set Vecchia approximation emulator validations. argument used emulator object constructed Vecchia approximation. Defaults 50. cores integer gives number processes used emulator validation. set NULL, number processes set max physical cores available %/% 2. Defaults 1. argument used eval = NULL. ... arguments names differ used design() required f, method, eval can passed . design() forward relevant arguments f, method, eval based names additional arguments provided. train_N number training iterations used re-fitting DGP emulator step sequential design: train_N integer, DGP emulator re-fitted step (based re-fit frequency specified freq[1]) using train_N iterations. train_N vector, length must N, even re-fit frequency specified freq[1] 1. train_N NULL, DGP emulator re-fitted step (based re-fit frequency specified freq[1]) using: 100 iterations DGP emulator constructed without Vecchia approximation, 50 iterations Vecchia approximation used. Defaults NULL. refit_cores number processes used re-fit GP components (layer DGP emulator) M-step re-fitting. set NULL, number processes set (max physical cores available - 1) DGP emulator constructed without Vecchia approximation. Otherwise, number processes set max physical cores available %/% 2. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. pruning bool indicating dynamic pruning DGP structures implemented sequential design total number design points exceeds min_size control. argument applicable DGP emulators (.e., object instance dgp class) produced dgp(). Defaults TRUE. control list can supply following components control dynamic pruning DGP emulator: min_size, minimum number design points required trigger dynamic pruning. Defaults 10 times number input dimensions. threshold, \\(R^2\\) value GP node considered redundant. Defaults 0.97. nexceed, minimum number consecutive iterations \\(R^2\\) value GP node must exceed threshold trigger removal node DGP structure. Defaults 3. argument used pruning = TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"updated object returned slot called design contains: S slots, named wave1, wave2,..., waveS, contain information S waves sequential design applied emulator. slot contains following elements: N, integer gives numbers iterations implemented corresponding wave; rmse, matrix providing evaluation metric values emulators constructed corresponding wave, eval = NULL. row matrix represents iteration. object class gp, matrix contains single column RMSE values. object class dgp without categorical likelihood, row contains mean/median squared errors corresponding different output dimensions. object class dgp categorical likelihood, matrix contains single column log-loss values. object class bundle, row contains either mean/median squared errors log-loss values emulators bundle. metric: matrix providing values custom evaluation metrics, computed user-supplied eval function, emulators constructed corresponding wave. freq, integer gives frequency emulator validations implemented corresponding wave. enrichment, vector size N gives number new design points added step sequential design (object instance gp dgp class), matrix gives number new design points added emulators bundle step sequential design (object instance bundle class). target NULL, following additional elements also included: target: target evaluating metric computed eval built-function stop sequential design. reached: indicates whether target reached end sequential design: bool object instance gp dgp class. vector bools object instance bundle class, length determined follows: equal number emulators bundle eval = NULL. equal length output eval custom eval function provided. slot called type gives type validation: either LOO ('loo') OOS ('oos') eval = NULL. See validate() information LOO OOS. 'customized' customized R function provided eval. two slots called x_test y_test contain data points OOS validation type slot 'oos'. y_cand = NULL x_cand supplied, NAs returned supplied f sequential design, slot called exclusion included records located design positions produced NAs via f. sequential design use information avoid re-visiting locations later runs design(). See Note section information.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"Validation emulator forced final step sequential design even N multiple second element freq. loo oos slot already exists object cleaned, new slot called loo oos created returned object depending whether x_test y_test provided. new slot gives validation information emulator constructed final step sequential design. See validate() information slots loo oos. object previously used design() sequential design, information current wave sequential design replace old waves contained returned object, unless validation type (LOO OOS depending whether x_test y_test supplied ) current wave sequential design validation types (shown type design slot object) previous waves, validation type OOS, x_test y_test current wave must also identical previous waves; current previous waves sequential design supply customized evaluation functions eval. Users need ensure customized evaluation functions consistent among different waves. Otherwise, trace plot RMSEs produced draw() show values different evaluation metrics different waves. two cases, information current wave sequential design added design slot returned object name waveS. object instance gp class eval = NULL, matrix rmse slot single-columned. object instance dgp bundle class eval = NULL, matrix rmse slot can multiple columns correspond different output dimensions different emulators bundle. object instance gp class eval = NULL, target needs single value giving RMSE threshold. object instance dgp bundle class eval = NULL, target can vector values gives thresholds evaluating metrics different output dimensions different emulators. single value provided, used threshold output dimensions (object instance dgp) emulators (object instance bundle). customized function supplied eval target given vector, user needs ensure length target equal output eval. defining f, important ensure : column order first argument f consistent training input used emulator; column order output matrix f consistent order emulator output dimensions (object instance dgp class), order emulators placed object (object instance bundle class). output matrix produced f may include NAs. especially beneficial allows sequential design process continue without interruption, even errors NA outputs encountered f certain input locations identified sequential design. Users ensure errors within f handled appropriately returning NAs. defining eval, output metric needs positive draw() used log = T. one needs ensure lower metric value indicates better emulation performance target set.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/design.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Sequential design of a (D)GP emulator or a bundle of (D)GP emulators — design","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 2D non-stationary function that takes a matrix as the input f <- function(x) { sin(1/((0.7*x[,1,drop=F]+0.3)*(0.7*x[,2,drop=F]+0.3))) } # generate the initial design X <- maximinLHS(5,2) Y <- f(X) # generate the validation data validate_x <- maximinLHS(30,2) validate_y <- f(validate_x) # training a 2-layered DGP emulator with the initial design m <- dgp(X, Y) # specify the ranges of the input dimensions lim_1 <- c(0, 1) lim_2 <- c(0, 1) lim <- rbind(lim_1, lim_2) # 1st wave of the sequential design with 10 steps m <- design(m, N=10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) # 2nd wave of the sequential design with 10 steps m <- design(m, N=10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) # 3rd wave of the sequential design with 10 steps m <- design(m, N=10, limits = lim, f = f, x_test = validate_x, y_test = validate_y) # draw the design created by the sequential design draw(m,'design') # inspect the trace of RMSEs during the sequential design draw(m,'rmse') # reduce the number of imputations for faster OOS m_faster <- set_imp(m, 5) # plot the OOS validation with the faster DGP emulator plot(m_faster, x_test = validate_x, y_test = validate_y) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":null,"dir":"Reference","previous_headings":"","what":"Deep Gaussian process emulator construction — dgp","title":"Deep Gaussian process emulator construction — dgp","text":"function builds trains DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deep Gaussian process emulator construction — dgp","text":"","code":"dgp( X, Y, depth = 2, node = ncol(X), name = \"sexp\", lengthscale = 1, bounds = NULL, prior = \"ga\", share = TRUE, nugget_est = FALSE, nugget = NULL, scale_est = TRUE, scale = 1, connect = TRUE, likelihood = NULL, training = TRUE, verb = TRUE, check_rep = TRUE, vecchia = FALSE, M = 25, ord = NULL, N = ifelse(vecchia, 200, 500), cores = 1, blocked_gibbs = TRUE, ess_burn = 10, burnin = NULL, B = 10, internal_input_idx = NULL, linked_idx = NULL, id = NULL )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deep Gaussian process emulator construction — dgp","text":"X matrix row input training data point column represents input dimension. Y matrix containing observed training output data. matrix rows output data points columns representing output dimensions. likelihood (see ) NULL, Y must matrix single column. depth number layers (including likelihood layer) DGP structure. depth must least 2. Defaults 2. node number GP nodes layer (except final layer layer feeding likelihood node) DGP. Defaults ncol(X). name character vector characters indicates kernel functions (either \"sexp\" squared exponential kernel \"matern2.5\" Matérn-2.5 kernel) used DGP emulator: single character supplied, corresponding kernel function used GP nodes DGP hierarchy. vector characters supplied, character vector specifies kernel function applied GP nodes corresponding layer. Defaults \"sexp\". lengthscale initial lengthscales GP nodes DGP emulator. can single numeric value vector: single numeric value, value applied initial lengthscales GP nodes DGP hierarchy. vector, element vector specifies initial lengthscales applied GP nodes corresponding layer. vector length depth likelihood = NULL length depth - 1 likelihood NULL. Defaults numeric value 1.0. bounds lower upper bounds lengthscales GP nodes. can vector matrix: vector, lower bound (first element vector) upper bound (second element vector) applied lengthscales GP nodes DGP hierarchy. matrix, row matrix specifies lower upper bounds lengthscales GP nodes corresponding layer. matrix row number equal depth likelihood = NULL depth - 1 likelihood NULL. Defaults NULL bounds specified lengthscales. prior prior used MAP estimation lengthscales nuggets GP nodes DGP hierarchy: gamma prior (\"ga\"), inverse gamma prior (\"inv_ga\"), jointly robust prior (\"ref\"). Defaults \"ga\". share bool indicating input dimensions GP node share common lengthscale. Defaults TRUE. nugget_est bool bool vector indicates nuggets GP nodes () final layer estimated. single bool provided, applied GP nodes () final layer. bool vector (must length ncol(Y)) provided, bool element vector applied corresponding GP node () final layer. value bool following effects: FALSE: nugget corresponding GP final layer fixed corresponding value defined nugget (see ). TRUE: nugget corresponding GP final layer estimated initial value given correspondence nugget (see ). Defaults FALSE. nugget initial nugget value(s) GP nodes () layer: single numeric value, value applied initial nugget GP nodes DGP hierarchy. vector, element vector specifies initial nugget applied GP nodes corresponding layer. vector length depth likelihood = NULL length depth - 1 likelihood NULL. Set nugget small value bools nugget_est FALSE deterministic emulation, emulator interpolates training data points. Set nugget larger value bools nugget_est TRUE stochastic emulation computer model outputs assumed follow homogeneous Gaussian distribution. Defaults 1e-6 nugget_est = FALSE 0.01 nugget_est = TRUE. likelihood NULL nugget_est = FALSE, nuggets GPs feed likelihood layer default 1e-4. scale_est bool bool vector indicates variance GP nodes () final layer estimated. single bool provided, applied GP nodes () final layer. bool vector (must length ncol(Y)) provided, bool element vector applied corresponding GP node () final layer. value bool following effects: FALSE: variance corresponding GP final layer fixed corresponding value defined scale (see ). TRUE: variance corresponding GP final layer estimated initial value given correspondence scale (see ). Defaults TRUE. scale initial variance value(s) GP nodes () final layer. single numeric value, applied GP nodes () final layer. vector (must length ncol(Y)), numeric vector applied corresponding GP node () final layer. Defaults 1. connect bool indicating whether implement global input connection DGP structure. Setting FALSE may produce better emulator cases cost slower training. Defaults TRUE. likelihood likelihood type DGP emulator: NULL: likelihood layer included emulator. \"Hetero\": heteroskedastic Gaussian likelihood layer added stochastic emulation computer model outputs assumed follow heteroskedastic Gaussian distribution (.e., computer model outputs input-dependent noise). \"Poisson\": Poisson likelihood layer added emulation computer model outputs counts Poisson distribution used model . \"NegBin\": negative Binomial likelihood layer added emulation computer model outputs counts negative Binomial distribution used capture dispersion variability input space. \"Categorical\": categorical likelihood layer added emulation (classification), computer model output categorical. likelihood NULL, value nugget_est overridden FALSE. Defaults NULL. training bool indicating initialized DGP emulator trained. set FALSE, dgp() returns untrained DGP emulator, one can apply summary() inspect specifications apply predict() check emulation performance training. Defaults TRUE. verb bool indicating trace information DGP emulator construction training printed function execution. Defaults TRUE. check_rep bool indicating whether check repetitions dataset, .e., one input position multiple outputs. Defaults TRUE. vecchia bool indicating whether use Vecchia approximation large-scale DGP emulator construction prediction. Defaults FALSE. M size conditioning set Vecchia approximation DGP emulator training. Defaults 25. ord R function returns ordering input GP node contained DGP emulator Vecchia approximation. function must satisfy following basic rules: first argument represents input GP node scaled lengthscales. output function vector indices gives ordering input GP node. ord = NULL, default random ordering used. Defaults NULL. N number iterations training. Defaults 500 vecchia = FALSE 200 vecchia = TRUE. argument used training = TRUE. cores number processes used optimize GP components (layer) M-step training. set NULL, number processes set (max physical cores available - 1) vecchia = FALSE max physical cores available %/% 2 vecchia = TRUE. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. blocked_gibbs bool indicating latent variables imputed layer-wise using ESS-within-Blocked-Gibbs. ESS-within-Blocked-Gibbs faster efficient ESS-within-Gibbs imputes latent variables node-wise reduces number components sampled Gibbs steps, especially large number GP nodes layers due higher input dimensions. Default TRUE. ess_burn number burnin steps ESS-within-Gibbs -step training. Defaults 10. argument used training = TRUE. burnin number training iterations discarded point estimates model parameters. Must smaller training iterations N. specified, last 25% iterations used. Defaults NULL. argument used training = TRUE. B number imputations used produce predictions. Increase value refine representation imputation uncertainty. Defaults 10. internal_input_idx argument removed next release. set connections emulators linked emulations, please use updated lgp() function instead. Column indices X generated linked emulators preceding layers. Set internal_input_idx = NULL DGP emulator first layer system columns X generated linked emulators preceding layers. Defaults NULL. linked_idx argument removed next release. set connections emulators linked emulation, please use updated lgp() function instead. Either vector list vectors: linked_idx vector, gives indices columns pooled output matrix (formed column-combined outputs emulators feeding layer) feed DGP emulator. length vector shall equal length internal_input_idx internal_input_idx NULL. DGP emulator first layer linked emulator system, vector gives column indices global input (formed column-combining input matrices emulators first layer) DGP emulator use. DGP emulator used first subsequent layers, one initially set linked_idx appropriate values situation emulator first layer. , use function set_linked_idx() reset linking information emulator first layer. DGP emulator first layer linked emulator system, linked_idx can list gives information connections DGP emulator emulators preceding layers. length list equal number layers DGP emulator. element list vector gives indices columns pooled output matrix (formed column-combined outputs emulators) corresponding layer feed DGP emulator. DGP emulator connections emulator certain layer, set NULL corresponding position list. order input dimensions X[,internal_input_idx] consistent linked_idx. example, DGP emulator 4th-layer fed output dimension 2 4 emulators layer 2 output dimension 1 3 emulators layer 3 linked_idx = list( NULL, c(2,4), c(1,2,3) ). addition, first second columns X[,internal_input_idx] correspond output dimensions 2 4 layer 2, third fifth columns X[,internal_input_idx] correspond output dimensions 1 3 layer 3. Set linked_idx = NULL DGP emulator used linked emulations. However, longer case, one can use set_linked_idx() add linking information DGP emulator. Defaults NULL. id ID assigned DGP emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Default NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deep Gaussian process emulator construction — dgp","text":"S3 class named dgp contains five slots: id: number character string assigned id argument. data: list contains two elements: X Y training input output data respectively. specs: list contains L (.e., number layers DGP hierarchy) sub-lists named layer1, layer2,..., layerL. sub-list contains D (.e., number GP/likelihood nodes corresponding layer) sub-lists named node1, node2,..., nodeD. sub-list corresponds likelihood node, contains one element called type gives name (Hetero, Poisson, NegBin, Categorical) likelihood node. sub-list corresponds GP node, contains four elements: kernel: type kernel function used GP node. lengthscales: vector lengthscales kernel function. scale: variance value kernel function. nugget: nugget value kernel function. internal_dims: column indices X correspond linked emulators preceding layers linked system. slot removed next release. external_dims: column indices X correspond global inputs linked system emulators. shown FALSE internal_input_idx = NULL. slot removed next release. linked_idx: value passed argument linked_idx. shown FALSE argument linked_idx NULL. slot removed next release. seed: random seed generated produce imputations. information stored reproducibility DGP emulator (saved write() light option light = TRUE) loaded back R read(). B: number imputations used generate emulator. vecchia: whether Vecchia approximation used GP emulator training. M: size conditioning set Vecchia approximation DGP emulator training. M generated vecchia = TRUE. constructor_obj: 'python' object stores information constructed DGP emulator. container_obj: 'python' object stores information linked emulation. emulator_obj: 'python' object stores information predictions DGP emulator. returned dgp object can used predict() DGP predictions. continue() additional DGP training iterations. validate() LOO OOS validations. plot() validation plots. lgp() linked (D)GP emulator constructions. window() model parameter trimming. summary() summarize trained DGP emulator. write() save DGP emulator .pkl file. set_imp() change number imputations. design() sequential design. update() update DGP emulator new inputs outputs. alm(), mice(), vigf() locate next design points.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Deep Gaussian process emulator construction — dgp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Deep Gaussian process emulator construction — dgp","text":"R vector detected X Y treated column vector automatically converted single-column R matrix. Thus, X single data point multiple dimensions, must given matrix.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deep Gaussian process emulator construction — dgp","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # construct a step function f <- function(x) { if (x < 0.5) return(-1) if (x >= 0.5) return(1) } # generate training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # set a random seed set_seed(999) # training a DGP emulator m <- dgp(X, Y) # continue for further training iterations m <- continue(m) # summarizing summary(m) # trace plot trace_plot(m) # trim the traces of model parameters m <- window(m, 800) # LOO cross validation m <- validate(m) plot(m) # prediction test_x <- seq(0, 1, length = 200) m <- predict(m, x = test_x) # OOS validation validate_x <- sample(test_x, 10) validate_y <- sapply(validate_x, f) plot(m, validate_x, validate_y) # write and read the constructed emulator write(m, 'step_dgp') m <- read('step_dgp') } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgpsi-package.html","id":null,"dir":"Reference","previous_headings":"","what":"dgpsi: Interface to 'dgpsi' for Deep and Linked Gaussian Process Emulations — dgpsi-package","title":"dgpsi: Interface to 'dgpsi' for Deep and Linked Gaussian Process Emulations — dgpsi-package","text":"Interface 'python' package 'dgpsi' Gaussian process, deep Gaussian process, linked deep Gaussian process emulations computer models networks using stochastic imputation (SI). implementations follow Ming & Guillas (2021) doi:10.1137/20M1323771 Ming, Williamson, & Guillas (2023) doi:10.1080/00401706.2022.2124311 Ming & Williamson (2023) doi:10.48550/arXiv.2306.01212 . get started package, see https://mingdeyu.github.io/dgpsi-R/.","code":""},{"path":[]},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/dgpsi-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"dgpsi: Interface to 'dgpsi' for Deep and Linked Gaussian Process Emulations — dgpsi-package","text":"Maintainer: Deyu Ming deyu.ming.16@ucl.ac.uk [copyright holder] Authors: Daniel Williamson d.williamson@exeter.ac.uk","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":null,"dir":"Reference","previous_headings":"","what":"Validation and diagnostic plots for a sequential design — draw","title":"Validation and diagnostic plots for a sequential design — draw","text":"function draws diagnostic validation plots sequential design (D)GP emulator bundle (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validation and diagnostic plots for a sequential design — draw","text":"","code":"draw(object, ...) # S3 method for class 'gp' draw(object, type = \"rmse\", log = FALSE, ...) # S3 method for class 'dgp' draw(object, type = \"rmse\", log = FALSE, ...) # S3 method for class 'bundle' draw(object, type = \"rmse\", log = FALSE, emulator = NULL, ...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validation and diagnostic plots for a sequential design — draw","text":"object can one following emulator classes: S3 class gp. S3 class dgp. S3 class bundle. ... N/. type specifies type plot visualization generate: \"rmse\": generates trace plot RMSEs, log-losses DGP emulators categorical likelihoods, custom evaluation metrics specified via \"eval\" argument [design()] function. \"design\": shows visualizations input designs created sequential design procedure. Defaults \"rmse\". log bool indicating whether plot RMSEs, log-losses (DGP emulators categorical likelihoods), custom evaluation metrics log scale type = \"rmse\". Defaults FALSE. emulator index vector indices emulators packed object. argument used object instance bundle class. set NULL, emulators bundle drawn. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validation and diagnostic plots for a sequential design — draw","text":"patchwork object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validation and diagnostic plots for a sequential design — draw","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/draw.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validation and diagnostic plots for a sequential design — draw","text":"","code":"if (FALSE) { # \\dontrun{ # See design() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the number of threads — get_thread_num","title":"Get the number of threads — get_thread_num","text":"function gets number threads used parallel computations involved package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the number of threads — get_thread_num","text":"","code":"get_thread_num()"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the number of threads — get_thread_num","text":"number threads.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/get_thread_num.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Get the number of threads — get_thread_num","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Gaussian process emulator construction — gp","title":"Gaussian process emulator construction — gp","text":"function builds trains GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Gaussian process emulator construction — gp","text":"","code":"gp( X, Y, name = \"sexp\", lengthscale = rep(0.1, ncol(X)), bounds = NULL, prior = \"ref\", nugget_est = FALSE, nugget = ifelse(nugget_est, 0.01, 1e-08), scale_est = TRUE, scale = 1, training = TRUE, verb = TRUE, vecchia = FALSE, M = 25, ord = NULL, internal_input_idx = NULL, linked_idx = NULL, id = NULL )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Gaussian process emulator construction — gp","text":"X matrix row input data point column input dimension. Y matrix one column row output data point. name kernel function used. Either \"sexp\" squared exponential kernel \"matern2.5\" Matérn-2.5 kernel. Defaults \"sexp\". lengthscale initial values lengthscales kernel function. can single numeric value vector length ncol(X): single numeric value, assumed kernel functions across input dimensions share lengthscale; vector, assumed kernel functions across input dimensions different lengthscales. Defaults vector 0.1. bounds lower upper bounds lengthscales kernel function. vector length two first element lower bound second element upper bound. bounds applied lengthscales kernel function. Defaults NULL bounds specified lengthscales. prior prior used Maximum Posterior lengthscales nugget GP: gamma prior (\"ga\"), inverse gamma prior (\"inv_ga\"), jointly robust prior (\"ref\"). Defaults \"ref\". See reference jointly robust prior. nugget_est bool indicating nugget term estimated: FALSE: nugget term fixed nugget. TRUE: nugget term estimated. Defaults FALSE. nugget initial nugget value. nugget_est = FALSE, assigned value fixed training. Set nugget small value (e.g., 1e-8) corresponding bool nugget_est FALSE deterministic computer models emulator interpolate training data points. Set nugget larger value corresponding bool nugget_est TRUE stochastic emulation computer model outputs assumed follow homogeneous Gaussian distribution. Defaults 1e-8 nugget_est = FALSE 0.01 nugget_est = TRUE. scale_est bool indicating variance estimated: FALSE: variance fixed scale. TRUE: variance term estimated. Defaults TRUE. scale initial variance value. scale_est = FALSE, assigned value fixed training. Defaults 1. training bool indicating initialized GP emulator trained. set FALSE, gp() returns untrained GP emulator, one can apply summary() inspect specification apply predict() check emulation performance training. Defaults TRUE. verb bool indicating trace information GP emulator construction training printed function execution. Defaults TRUE. vecchia bool indicating whether use Vecchia approximation large-scale GP emulator construction prediction. Defaults FALSE. Vecchia approximation implemented GP emulation largely follows Katzfuss et al. (2022). See reference . M size conditioning set Vecchia approximation GP emulator training. Defaults 25. ord R function returns ordering input GP emulator Vecchia approximation. function must satisfy following basic rules: first argument represents input scaled lengthscales. output function vector indices gives ordering input GP emulator. ord = NULL, default random ordering used. Defaults NULL. internal_input_idx column indices X generated linked emulators preceding layers. Set internal_input_idx = NULL GP emulator first layer system columns X generated linked emulators preceding layers. Defaults NULL. argument removed next release. set connections emulators linked emulations, please use updated lgp() function instead. linked_idx Either vector list vectors: linked_idx vector, gives indices columns pooled output matrix (formed column-combined outputs emulators feeding layer) feed GP emulator. length vector shall equal length internal_input_idx internal_input_idx NULL. GP emulator first layer linked emulator system, vector gives column indices global input (formed column-combining input matrices emulators first layer) GP emulator use. GP emulator used first subsequent layers, one initially set linked_idx appropriate values situation emulator first layer. , use function set_linked_idx() reset linking information emulator first layer. GP emulator first layer linked emulator system, linked_idx can list gives information connections GP emulator emulators preceding layers. length list equal number layers GP emulator. element list vector gives indices columns pooled output matrix (formed column-combined outputs emulators) corresponding layer feed GP emulator. GP emulator connections emulator certain layer, set NULL corresponding position list. order input dimensions X[,internal_input_idx] consistent linked_idx. example, GP emulator second layer fed output dimension 1 3 emulators layer 1 linked_idx = list( c(1,3) ). addition, first second columns X[,internal_input_idx] correspond output dimensions 1 3 layer 1. Set linked_idx = NULL GP emulator used linked emulations. However, longer case, one can use set_linked_idx() add linking information GP emulator. Defaults NULL. argument removed next release. set connections emulators linked emulations, please use updated lgp() function instead. id ID assigned GP emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Default NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Gaussian process emulator construction — gp","text":"S3 class named gp contains five slots: id: number character string assigned id argument. data: list contains two elements: X Y training input output data respectively. specs: list contains seven elements: kernel: type kernel function used. Either \"sexp\" squared exponential kernel \"matern2.5\" Matérn-2.5 kernel. lengthscales: vector lengthscales kernel function. scale: variance value kernel function. nugget: nugget value kernel function. internal_dims: column indices X correspond linked emulators preceding layers linked system. slot removed next release. external_dims: column indices X correspond global inputs linked system emulators. shown FALSE internal_input_idx = NULL. slot removed next release. linked_idx: value passed argument linked_idx. shown FALSE argument linked_idx NULL. slot removed next release. vecchia: whether Vecchia approximation used GP emulator training. M: size conditioning set Vecchia approximation GP emulator training. constructor_obj: 'python' object stores information constructed GP emulator. container_obj: 'python' object stores information linked emulation. emulator_obj: 'python' object stores information predictions GP emulator. returned gp object can used predict() GP predictions. validate() LOO OOS validations. plot() validation plots. lgp() linked (D)GP emulator constructions. summary() summarize trained GP emulator. write() save GP emulator .pkl file. design() sequential designs. update() update GP emulator new inputs outputs. alm(), mice(), vigf() locate next design points.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Gaussian process emulator construction — gp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Gaussian process emulator construction — gp","text":"R vector detected X Y treated column vector automatically converted single-column R matrix. Thus, X single data point multiple dimensions, must given matrix.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Gaussian process emulator construction — gp","text":"Gu, M. (2019). Jointly robust prior Gaussian stochastic process emulation, calibration variable selection. Bayesian Analysis, 14(3), 857-885. Katzfuss, M., Guinness, J., & Lawrence, E. (2022). Scaled Vecchia approximation fast computer-model emulation. SIAM/ASA Journal Uncertainty Quantification, 10(2), 537-554.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/gp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Gaussian process emulator construction — gp","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # construct a step function f <- function(x) { if (x < 0.5) return(-1) if (x >= 0.5) return(1) } # generate training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # training m <- gp(X, Y) # summarizing summary(m) # LOO cross validation m <- validate(m) plot(m) # prediction test_x <- seq(0, 1, length = 200) m <- predict(m, x = test_x) # OOS validation validate_x <- sample(test_x, 10) validate_y <- sapply(validate_x, f) plot(m, validate_x, validate_y) # write and read the constructed emulator write(m, 'step_gp') m <- read('step_gp') } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":null,"dir":"Reference","previous_headings":"","what":"'python' environment initialization — init_py","title":"'python' environment initialization — init_py","text":"function initializes 'python' environment package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"'python' environment initialization — init_py","text":"","code":"init_py( py_ver = NULL, dgpsi_ver = NULL, reinstall = FALSE, uninstall = FALSE, verb = TRUE )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"'python' environment initialization — init_py","text":"py_ver string gives 'python' version installed. py_ver = NULL, default 'python' version '3.9.13' installed. dgpsi_ver string gives 'python' version 'dgpsi' used. dgpsi_ver = NULL, latest 'python' version 'dgpsi' used, package installed CRAN; development 'python' version 'dgpsi' used, package installed GitHub. reinstall bool indicates whether reinstall 'python' version 'dgpsi' specified dgpsi_ver already installed. argument useful development version R package installed one may want regularly update development 'python' version 'dgpsi'. Defaults FALSE. uninstall bool indicates whether uninstall 'python' version 'dgpsi' specified dgpsi_ver already installed. argument useful 'python' environment corrupted one wants completely uninstall reinstall . Defaults FALSE. verb bool indicating trace information printed function execution. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"'python' environment initialization — init_py","text":"return value, called install required 'python' environment.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"'python' environment initialization — init_py","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/init_py.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"'python' environment initialization — init_py","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":null,"dir":"Reference","previous_headings":"","what":"Linked (D)GP emulator construction — lgp","title":"Linked (D)GP emulator construction — lgp","text":"function constructs linked (D)GP emulator model chain network.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Linked (D)GP emulator construction — lgp","text":"","code":"lgp(struc, emulators = NULL, B = 10, activate = TRUE, verb = TRUE, id = NULL)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Linked (D)GP emulator construction — lgp","text":"struc structure linked emulator, can take one two forms: list contains L (number layers systems computer models) sub-lists, represents layer contains (D)GP emulators (represented instances S3 class gp dgp) computer models. sub-lists placed list order specified computer model system's hierarchy. option deprecated removed next release. data frame defines connection structure emulators linked system, following columns: From_Emulator: ID emulator providing output. ID must match id slot corresponding emulator object (produced gp() dgp()) within emulators argument lgp(), special value \"Global\", indicating global inputs model chain network. id slot either automatically generated gp() dgp(), can manually specified via id argument functions set set_id() function. To_Emulator: ID emulator receiving input, also matching id slot corresponding emulator object. From_Output: single integer specifying output dimension From_Emulator connected input dimension To_Emulator specified To_Input. From_Emulator \"Global\", From_Output indicates dimension global input passed To_Emulator. To_Input: single integer specifying input dimension To_Emulator receiving From_Output dimension From_Emulator. row represents single one--one connection specified output dimension From_Emulator corresponding input dimension To_Emulator. multiple connections required two emulators, connection specified separate row. Note: using data frame option struc, emulators argument must provided. emulators list emulator objects, containing id slot uniquely identifies within linked system. id slot emulator object must match From_Emulator/To_Emulator columns struc. emulator used multiple times within linked system, list must contain distinct copies emulator, unique ID stored id slot. Use set_id() function produce copies different IDs ensure instance can uniquely referenced. B number imputations used prediction. Increase value refine representation imputation uncertainty. system consists GP emulators, B set 1 automatically. Defaults 10. activate bool indicating whether initialized linked emulator activated: activate = FALSE, lgp() returns inactive linked emulator, allowing inspection structure using summary(). activate = TRUE, lgp() returns active linked emulator, ready prediction validation using predict() validate(), respectively. Defaults TRUE. argument applicable struc specified data frame. verb bool indicating trace information linked (D)GP emulator construction printed function call. Defaults TRUE. argument applicable struc specified data frame. id ID assigned linked (D)GP emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Linked (D)GP emulator construction — lgp","text":"S3 class named lgp contains three slots: id: number character string assigned id argument. constructor_obj: list 'python' objects stores information constructed linked emulator. emulator_obj, 'python' object stores information predictions linked emulator. specs: list contains seed: random seed generated produce imputations. information stored reproducibility linked (D)GP emulator (saved write() light option light = TRUE) loaded back R read(). B: number imputations used generate linked (D)GP emulator. struc data frame, specs also includes: metadata: data frame providing configuration details emulator linked system, following columns: Emulator: ID emulator. Layer: layer linked system emulator positioned. lower Layer number indicates position closer input, layer numbering increasing move away input. Pos_in_Layer: position emulator within layer. lower Pos_in_Layer number indicates position higher layer. Total_Input_Dims: total number input dimensions emulator. Total_Output_Dims: total number output dimensions emulator. struc: linked system structure, supplied struc. returned lgp object can used predict() linked (D)GP predictions. validate() OOS validation. plot() validation plots. summary() summarize constructed linked (D)GP emulator. write() save linked (D)GP emulator .pkl file.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Linked (D)GP emulator construction — lgp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/lgp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Linked (D)GP emulator construction — lgp","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # model 1 f1 <- function(x) { (sin(7.5*x)+1)/2 } # model 2 f2 <- function(x) { 2/3*sin(2*(2*x - 1))+4/3*exp(-30*(2*(2*x-1))^2)-1/3 } # linked model f12 <- function(x) { f2(f1(x)) } # training data for Model 1 X1 <- seq(0, 1, length = 9) Y1 <- sapply(X1, f1) # training data for Model 2 X2 <- seq(0, 1, length = 13) Y2 <- sapply(X2, f2) # emulation of model 1 m1 <- gp(X1, Y1, name = \"matern2.5\", id = \"emulator1\") # emulation of model 2 m2 <- dgp(X2, Y2, depth = 2, name = \"matern2.5\", id = \"emulator2\") struc <- data.frame(From_Emulator = c(\"Global\", \"emulator1\"), To_Emulator = c(\"emulator1\", \"emulator2\"), From_Output = c(1, 1), To_Input = c(1, 1)) emulators <- list(m1, m2) # construct the linked emulator for visual inspection m_link <- lgp(struc, emulators, activate = FALSE) # visual inspection summary(m_link) # build the linked emulator for prediction m_link <- lgp(struc, emulators, activate = TRUE) test_x <- seq(0, 1, length = 300) m_link <- predict(m_link, x = test_x) # OOS validation validate_x <- sample(test_x, 20) validate_y <- sapply(validate_x, f12) plot(m_link, validate_x, validate_y, style = 2) # write and read the constructed linked emulator write(m_link, 'linked_emulator') m_link <- read('linked_emulator') } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"function searches candidate set locate next design point(s) added (D)GP emulator bundle (D)GP emulators using Mutual Information Computer Experiments (MICE), see reference .","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"","code":"mice(object, ...) # S3 method for class 'gp' mice( object, x_cand = NULL, n_cand = 200, batch_size = 1, M = 50, nugget_s = 1e-06, workers = 1, limits = NULL, int = FALSE, ... ) # S3 method for class 'dgp' mice( object, x_cand = NULL, n_cand = 200, batch_size = 1, M = 50, nugget_s = 1e-06, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... ) # S3 method for class 'bundle' mice( object, x_cand = NULL, n_cand = 200, batch_size = 1, M = 50, nugget_s = 1e-06, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. ... arguments (names different arguments used mice()) used aggregate can passed . x_cand matrix (row design point column input dimension) gives candidate set next design point(s) determined. object instance bundle class aggregate supplied, x_cand can also list. list must length equal number emulators object, element matrix representing candidate set corresponding emulator bundle. Defaults NULL. n_cand integer specifying size candidate set generated selecting next design point(s). argument used x_cand NULL. Defaults 200. batch_size integer gives number design points chosen. Defaults 1. M size conditioning set Vecchia approximation criterion calculation. argument used emulator object constructed Vecchia approximation. Defaults 50. nugget_s value smoothing nugget term used MICE. Defaults 1e-6. workers number processes used criterion calculation. set NULL, number processes set max physical cores available %/% 2. Defaults 1. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. argument used x_cand = NULL. Defaults NULL. int bool vector bools indicates input dimension integer type. single bool given, applied input dimensions. vector provided, length equal input dimensions applied individual input dimensions. argument used x_cand = NULL. Defaults FALSE. aggregate R function aggregates scores MICE across different output dimensions (object instance dgp class) across different emulators (object instance bundle class). function specified following basic form: first argument matrix representing scores. rows matrix correspond different design points. number columns matrix equals : emulator output dimension object instance dgp class; number emulators contained object object instance bundle class. output vector gives aggregate scores different design points. Set NULL disable aggregation. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"x_cand NULL: object instance gp class, vector length batch_size returned, containing positions (row numbers) next design points x_cand. object instance dgp class, vector length batch_size * D returned, containing positions (row numbers) next design points x_cand added DGP emulator. D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, matrix returned batch_size rows column emulator bundle, containing positions (row numbers) next design points x_cand individual emulators. x_cand NULL: object instance gp class, matrix batch_size rows returned, giving next design points evaluated. object instance dgp class, matrix batch_size * D rows returned, : D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, list returned length equal number emulators bundle. element list matrix batch_size rows, row represents design point added corresponding emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"first column matrix supplied first argument aggregate must correspond first output dimension DGP emulator object instance dgp class, subsequent columns dimensions. object instance bundle class, first column must correspond first emulator bundle, subsequent columns emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"Beck, J., & Guillas, S. (2016). Sequential design mutual information computer experiments (MICE): emulation tsunami model. SIAM/ASA Journal Uncertainty Quantification, 4(1), 739-766.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/mice.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE — mice","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 1D non-stationary function f <- function(x) { sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # training a 2-layered DGP emulator with the global connection off m <- dgp(X, Y, connect = F) # generate a candidate set x_cand <- maximinLHS(200,1) # locate the next design point using MICE next_point <- mice(m, x_cand = x_cand) X_new <- x_cand[next_point,,drop = F] # obtain the corresponding output at the located design point Y_new <- f(X_new) # combine the new input-output pair to the existing data X <- rbind(X, X_new) Y <- rbind(Y, Y_new) # update the DGP emulator with the new input and output data and refit m <- update(m, X, Y, refit = TRUE) # plot the LOO validation plot(m) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the predictive negative log-likelihood — nllik","title":"Calculate the predictive negative log-likelihood — nllik","text":"function computes predictive negative log-likelihood DGP emulator likelihood layer.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the predictive negative log-likelihood — nllik","text":"","code":"nllik(object, x, y)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the predictive negative log-likelihood — nllik","text":"object instance dgp class produced dgp() likelihood NULL; x matrix row input testing data point column input dimension. y matrix one column row scalar-valued testing output data point.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the predictive negative log-likelihood — nllik","text":"updated object returned additional slot named NLL contains two elements. first one, named meanNLL, scalar gives average negative predicted log-likelihood across testing data points. second one, named allNLL, vector gives negative predicted log-likelihood testing data point.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/nllik.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate the predictive negative log-likelihood — nllik","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":null,"dir":"Reference","previous_headings":"","what":"Pack GP and DGP emulators into a bundle — pack","title":"Pack GP and DGP emulators into a bundle — pack","text":"function packs GP emulators DGP emulators bundle class sequential designs emulator emulates one output dimension underlying simulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pack GP and DGP emulators into a bundle — pack","text":"","code":"pack(..., id = NULL)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pack GP and DGP emulators into a bundle — pack","text":"... sequence list emulators produced gp() dgp(). id ID assigned bundle emulator. ID provided (.e., id = NULL), UUID (Universally Unique Identifier) automatically generated assigned emulator. Default NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pack GP and DGP emulators into a bundle — pack","text":"S3 class named bundle used design() sequential designs. : slot called id assigned id argument. N slots named emulator1,...,emulatorN, contains GP DGP emulator, N number emulators provided function. slot called data contains two elements X Y. X contains N matrices named emulator1,...,emulatorN training input data different emulators. Y contains N single-column matrices named emulator1,...,emulatorN training output data different emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Pack GP and DGP emulators into a bundle — pack","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/pack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pack GP and DGP emulators into a bundle — pack","text":"","code":"if (FALSE) { # \\dontrun{ # load packages library(lhs) library(dgpsi) # construct a function with a two-dimensional output f <- function(x) { y1 = sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) y2 = 1/3*sin(2*(2*x - 1))+2/3*exp(-30*(2*(2*x-1))^2)+1/3 return(cbind(y1,y2)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # generate the validation data validate_x <- maximinLHS(30,1) validate_y <- f(validate_x) # training a 2-layered DGP emulator with respect to each output with the global connection off m1 <- dgp(X, Y[,1], connect = F) m2 <- dgp(X, Y[,2], connect = F) # specify the range of the input dimension lim <- c(0, 1) # pack emulators to form an emulator bundle m <- pack(m1, m2) # 1st wave of the sequential design with 10 iterations and the target RMSE of 0.01 m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, target = 0.01) # 2rd wave of the sequential design with additional 10 iterations and the same target m <- design(m, N = 10, limits = lim, f = f, x_test = validate_x, y_test = validate_y, target = 0.01) # draw sequential designs of the two packed emulators draw(m, type = 'design') # inspect the traces of RMSEs of the two packed emulators draw(m, type = 'rmse') # write and read the constructed emulator bundle write(m, 'bundle_dgp') m <- read('bundle_dgp') # unpack the bundle into individual emulators m_unpacked <- unpack(m) # plot OOS validations of individual emulators plot(m_unpacked[[1]], x_test = validate_x, y_test = validate_y[,1]) plot(m_unpacked[[2]], x_test = validate_x, y_test = validate_y[,2]) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"function draws validation plots GP, DGP, linked (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"","code":"# S3 method for class 'dgp' plot( x, x_test = NULL, y_test = NULL, dim = NULL, method = NULL, sample_size = 50, style = 1, min_max = TRUE, normalize = TRUE, color = \"turbo\", type = \"points\", verb = TRUE, M = 50, force = FALSE, cores = 1, ... ) # S3 method for class 'lgp' plot( x, x_test = NULL, y_test = NULL, dim = NULL, method = NULL, sample_size = 50, style = 1, min_max = TRUE, color = \"turbo\", type = \"points\", M = 50, verb = TRUE, force = FALSE, cores = 1, ... ) # S3 method for class 'gp' plot( x, x_test = NULL, y_test = NULL, dim = NULL, method = NULL, sample_size = 50, style = 1, min_max = TRUE, color = \"turbo\", type = \"points\", verb = TRUE, M = 50, force = FALSE, cores = 1, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"x can one following emulator classes: S3 class gp. S3 class dgp. S3 class lgp. x_test validate(). y_test validate(). dim dim = NULL, index emulator's input within design shown x-axis validation plots. Otherwise, dim indicates dimension emulator's input shown x-axis validation plots: x instance gp dgp class, dim integer. x instance lgp class created lgp() without specifying struc argument data frame form, dim can : integer referring dimension global input emulators first layer linked emulator system; vector three integers referring dimension (specified third integer) global input emulator (specified second integer) layer (specified first integer) first layer linked emulator system. option linked (D)GP emulators deprecated removed next release. x instance lgp class created lgp() argument struc data frame form, dim integer referring dimension global input linked emulator system. argument used style = 1. Defaults NULL. method validate(). sample_size validate(). style either 1 2, indicating two different plotting styles validation. min_max bool indicating min-max normalization used scale testing output, RMSE, predictive mean std emulator. Defaults TRUE. argument applicable DGP emulators categorical likelihoods. normalize bool indicating normalization used scale counts validation plots DGP emulators categorical likelihoods style = 2. Defaults TRUE. color character string indicating color map use style = 2: 'magma' ('') 'inferno' ('B') 'plasma' ('C') 'viridis' ('D') 'cividis' ('E') 'rocket' ('F') 'mako' ('G') 'turbo' ('H') Defaults 'turbo' ('H'). type either 'line' 'points, indicating whether draw testing data OOS validation plot line individual points input emulator one-dimensional style = 1. argument applicable DGP emulators categorical likelihoods. Defaults 'points' verb bool indicating trace information plotting printed execution. Defaults TRUE. M validate(). force validate(). cores validate(). ... N/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"patchwork object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"plot() calls validate() internally obtain validation results plotting. However, plot() export emulator object validation results. Instead, returns plotting object. small-scale validations (.e., small training testing data points), direct execution plot() works well. However, moderate- large-scale validation, recommended first run validate() obtain store validation results emulator object, supply object plot(). plot() checks object's loo oos slots prior calling validate() perform calculation required information already stored. plot() use stored OOS validation x_test y_test identical used validate() produce data contained object's oos slot, otherwise plot() re-evaluate OOS validation plotting. returned patchwork::patchwork object contains ggplot2::ggplot2 objects. One can modify included individual ggplots accessing double-bracket indexing. See https://patchwork.data-imaginist.com/ information.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validation plots of a constructed GP, DGP, or linked (D)GP emulator — plot","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":null,"dir":"Reference","previous_headings":"","what":"Prediction from GP, DGP, or linked (D)GP emulators — predict","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"function implements prediction GP, DGP, linked (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"","code":"# S3 method for class 'dgp' predict( object, x, method = NULL, mode = \"label\", full_layer = FALSE, sample_size = 50, M = 50, cores = 1, chunks = NULL, ... ) # S3 method for class 'lgp' predict( object, x, method = NULL, full_layer = FALSE, sample_size = 50, M = 50, cores = 1, chunks = NULL, ... ) # S3 method for class 'gp' predict( object, x, method = NULL, sample_size = 50, M = 50, cores = 1, chunks = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"object instance gp, dgp, lgp class. x testing input data: object instance gp dgp class, x matrix row input testing data point column input dimension. object instance lgp class created lgp() without specifying argument struc data frame form, x can either matrix list: x matrix, rows treated instances Global inputs. case, assumed global input system input emulators first layer global input emulators layers. x list, L (number layers emulator system) elements. first element matrix represents global testing input data feed emulators first layer system. remaining L-1 elements L-1 sub-lists, contains number (number emulators corresponding layer) matrices (rows testing input data points columns input dimensions) represent global testing input data emulators corresponding layer. matrices must placed sub-lists based corresponding emulators placed struc argument lgp(). global input data certain emulator, set NULL corresponding sub-list x. option linked (D)GP emulators deprecated removed next release. object instance lgp class created lgp() argument struc data frame form, x must matrix representing global input, row corresponds test data point column represents global input dimension. column indices x must align indices specified From_Output column struc data frame (used lgp()), corresponding rows From_Emulator column \"Global\". method prediction approach use: either mean-variance approach (\"mean_var\") sampling approach (\"sampling\"). mean-variance approach returns means variances predictive distributions, sampling approach generates samples predictive distributions using derived means variances. DGP emulators categorical likelihood (likelihood = \"Categorical\" dgp()), method applicable full_layer = TRUE. case, sampling approach generates samples GP nodes hidden layers using derived means variances, subsequently propagates samples categorical likelihood. default, method set \"sampling\" DGP emulators Poisson, Negative Binomial, Categorical likelihoods, \"mean_var\" otherwise. mode whether predict classes (\"label\") probabilities (\"proba\") different classes object DGP emulator categorical likelihood. Defaults \"label\". full_layer bool indicating whether output predictions layers. Defaults FALSE. used object DGP linked (D)GP emulator. sample_size number samples draw given imputation method = \"sampling\". Defaults 50. M size conditioning set Vecchia approximation emulator prediction. Defaults 50. argument used emulator object constructed Vecchia approximation. cores number processes used prediction. set NULL, number processes set max physical cores available %/% 2. Defaults 1. chunks number chunks testing input matrix x divided multi-cores work . used cores 1. specified (.e., chunks = NULL), number chunks set value cores. Defaults NULL. ... N/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"object instance gp class: method = \"mean_var\": updated object returned additional slot called results contains two matrices named mean predictive means var predictive variances. matrix one column rows corresponding testing positions (.e., rows x). method = \"sampling\": updated object returned additional slot called results contains matrix whose rows correspond testing positions columns correspond sample_size number samples drawn predictive distribution GP. object instance dgp class: method = \"mean_var\" full_layer = FALSE: updated object returned additional slot called results contains two matrices named mean predictive means var predictive variances respectively. matrix rows corresponding testing positions columns corresponding DGP global output dimensions (.e., number GP/likelihood nodes final layer). method = \"mean_var\" full_layer = TRUE: updated object returned additional slot called results contains two sub-lists named mean predictive means var predictive variances respectively. sub-list contains L (.e., number layers) matrices named layer1, layer2,..., layerL. matrix rows corresponding testing positions columns corresponding output dimensions (.e., number GP/likelihood nodes associated layer). method = \"sampling\" full_layer = FALSE: updated object returned additional slot called results contains D (.e., number GP/likelihood nodes final layer) matrices named output1, output2,..., outputD. matrix rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified dgp(). method = \"sampling\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers) sub-lists named layer1, layer2,..., layerL. sub-list represents samples drawn GP/likelihood nodes corresponding layer, contains D (.e., number GP/likelihood nodes corresponding layer) matrices named output1, output2,..., outputD. matrix gives samples output one D GP/likelihood nodes, rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified dgp(). object instance dgp class categorical likelihood: full_layer = FALSE mode = \"label\": updated object returned additional slot called results contains one matrix named label. matrix rows corresponding testing positions columns corresponding sample labels size: B * sample_size, B number imputations specified dgp(). full_layer = FALSE mode = \"proba\", updated object returned additional slot called results. slot contains D matrices (D number classes training output), matrix gives probability samples corresponding class rows corresponding testing positions columns containing probabilities. number columns matrix B * sample_size, B number imputations specified dgp() function. method = \"mean_var\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers) sub-lists named layer1, layer2,..., layerL. first L-1 sub-lists contains two matrices named mean predictive means var predictive variances GP nodes associated layer. Rows matrix correspond testing positions. mode = \"label\", sub-list LayerL contains one matrix named label. matrix rows corresponding testing positions columns corresponding label samples size: B * sample_size. B number imputations specified dgp(). mode = \"proba\", sub-list LayerL contains D matrices (D number classes training output), matrix gives probability samples corresponding class rows corresponding testing positions columns containing probabilities. number columns matrix B * sample_size. B number imputations specified dgp(). method = \"sampling\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers) sub-lists named layer1, layer2,..., layerL. first L-1 sub-lists represents samples drawn GP nodes corresponding layer, contains D (.e., number GP nodes corresponding layer) matrices named output1, output2,..., outputD. matrix gives samples output one D GP nodes, rows corresponding testing positions columns corresponding samples size: B * sample_size. mode = \"label\", sub-list LayerL contains one matrix named label. matrix rows corresponding testing positions columns corresponding label samples size: B * sample_size. mode = \"proba\", sub-list LayerL contains D matrices (D number classes training output), matrix gives probability samples corresponding class rows corresponding testing positions columns containing probabilities. number columns matrix B * sample_size. B number imputations specified dgp(). object instance lgp class: method = \"mean_var\" full_layer = FALSE: updated object returned additional slot called results contains two sub-lists named mean predictive means var predictive variances respectively. sub-list contains K (number emulators final layer system) matrices named using IDs corresponding emulators final layer. matrix rows corresponding global testing positions columns corresponding output dimensions associated emulator final layer. method = \"mean_var\" full_layer = TRUE: updated object returned additional slot called results contains two sub-lists named mean predictive means var predictive variances respectively. sub-list contains L (.e., number layers emulated system) components named layer1, layer2,..., layerL. component represents layer contains K (number emulators corresponding layer system) matrices named using IDs corresponding emulators layer. matrix rows corresponding global testing positions columns corresponding output dimensions associated GP/DGP emulator corresponding layer. method = \"sampling\" full_layer = FALSE: updated object returned additional slot called results contains K (number emulators final layer system) sub-lists named using IDs corresponding emulators final layer. sub-list contains D matrices, named output1, output2,..., outputD, correspond output dimensions GP/DGP emulator. matrix rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified lgp(). method = \"sampling\" full_layer = TRUE: updated object returned additional slot called results contains L (.e., number layers emulated system) sub-lists named layer1, layer2,..., layerL. sub-list represents layer contains K (number emulators corresponding layer system) components named using IDs corresponding emulators layer. component contains D matrices, named output1, output2,..., outputD, correspond output dimensions GP/DGP emulator. matrix rows corresponding testing positions columns corresponding samples size: B * sample_size, B number imputations specified lgp(). object instance lgp class created lgp() without specifying struc argument data frame form, IDs, used names sub-lists matrices within results, replaced emulator1, emulator2, . results slot also include: value M, represents size conditioning set Vecchia approximation, used, emulator prediction. value sample_size method = \"sampling\".","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/predict.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Prediction from GP, DGP, or linked (D)GP emulators — predict","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":null,"dir":"Reference","previous_headings":"","what":"Static pruning of a DGP emulator — prune","title":"Static pruning of a DGP emulator — prune","text":"function implements static pruning DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Static pruning of a DGP emulator — prune","text":"","code":"prune(object, control = list(), verb = TRUE)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Static pruning of a DGP emulator — prune","text":"object instance dgp class generated dgp(). control list can supply following two components control static pruning DGP emulator: min_size, minimum number design points required trigger pruning. Defaults 10 times input dimensions. threshold, \\(R^2\\) value GP node considered redundant removable. Defaults 0.97. verb bool indicating trace information printed function execution. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Static pruning of a DGP emulator — prune","text":"updated object instance gp, dgp, bundle (GP emulators) class.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Static pruning of a DGP emulator — prune","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Static pruning of a DGP emulator — prune","text":"function requires DGP emulator trained dataset comprising minimum size equal min_size control. training dataset size smaller , recommended design DGP emulator enriched structure pruned dynamically using design() function. Depending design DGP emulator, static pruning may accurate. thus recommended dynamic pruning implemented part sequential design via design(). following slots: loo oos created validate(); results created predict(); object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/prune.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Static pruning of a DGP emulator — prune","text":"","code":"if (FALSE) { # \\dontrun{ # load the package and the Python env library(dgpsi) # construct the borehole function over a hypercube f <- function(x){ x[,1] <- (0.15 - 0.5) * x[,1] + 0.5 x[,2] <- exp((log(50000) - log(100)) * x[,2] + log(100)) x[,3] <- (115600 - 63070) *x[,3] + 63070 x[,4] <- (1110 - 990) * x[,4] + 990 x[,5] <- (116 - 63.1) * x[,5] + 63.1 x[,6] <- (820 - 700) * x[,6] + 700 x[,7] <- (1680 - 1120) * x[,7] + 1120 x[,8] <- (12045 - 9855) * x[,8] + 9855 y <- apply(x, 1, RobustGaSP::borehole) } # set a random seed set_seed(999) # generate training data X <- maximinLHS(80, 8) Y <- f(X) # generate validation data validate_x <- maximinLHS(500, 8) validate_y <- f(validate_x) # training a DGP emulator with anisotropic squared exponential kernels m <- dgp(X, Y, share = F) # OOS validation of the DGP emulator plot(m, validate_x, validate_y) # prune the emulator until no more GP nodes are removable m <- prune(m) # OOS validation of the resulting emulator plot(m, validate_x, validate_y) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":null,"dir":"Reference","previous_headings":"","what":"Load the stored emulator — read","title":"Load the stored emulator — read","text":"function loads .pkl file stores emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Load the stored emulator — read","text":"","code":"read(pkl_file)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Load the stored emulator — read","text":"pkl_file path name .pkl file emulator stored.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Load the stored emulator — read","text":"S3 class GP emulator, DGP emulator, linked (D)GP emulator, bundle (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Load the stored emulator — read","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/read.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Load the stored emulator — read","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), lgp(), or pack() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":null,"dir":"Reference","previous_headings":"","what":"Serialize the constructed emulator — serialize","title":"Serialize the constructed emulator — serialize","text":"function serializes constructed emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Serialize the constructed emulator — serialize","text":"","code":"serialize(object, light = TRUE)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Serialize the constructed emulator — serialize","text":"object instance S3 class gp, dgp, lgp, bundle. light bool indicating light version constructed emulator (requires small storage) serialized. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Serialize the constructed emulator — serialize","text":"serialized version object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Serialize the constructed emulator — serialize","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Serialize the constructed emulator — serialize","text":"Since constructed emulators 'python' objects, directly exported R processes parallel processing multi-session workers created spawning. function provides solution converting emulators serialized objects, can restored using deserialize() multi-session processing. Note forking, serialization generally required.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/serialize.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Serialize the constructed emulator — serialize","text":"","code":"if (FALSE) { # \\dontrun{ library(future) library(future.apply) library(dgpsi) # model f <- function(x) { (sin(7.5*x)+1)/2 } # training data X <- seq(0, 1, length = 10) Y <- sapply(X, f) # train a DGP emulator m <- dgp(X, Y, name = \"matern2.5\") # testing input data X_dgp <- seq(0, 1, length = 100) # serialize the DGP emulator m_serialized <- serialize(m) # start a multi-session with three cores for parallel predictions plan(multisession, workers = 3) # perform parallel predictions results <- future_lapply(1:length(X_dgp), function(i) { m_deserialized <- deserialize(m_serialized) mean_i <- predict(m_deserialized, X_dgp[i])$results$mean }, future.seed = TRUE) # reset the future plan to sequential plan(sequential) # combine mean predictions pred_mean <- do.call(rbind, results) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Emulator ID — set_id","title":"Set Emulator ID — set_id","text":"function assigns unique identifier emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Emulator ID — set_id","text":"","code":"set_id(object, id)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Emulator ID — set_id","text":"object emulator object ID assigned. id unique identifier emulator either numeric character string. Ensure ID conflict emulator IDs, especially used linked emulations.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Emulator ID — set_id","text":"updated object, assigned ID stored id slot.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Emulator ID — set_id","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_id.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Emulator ID — set_id","text":"","code":"if (FALSE) { # \\dontrun{ # See lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":null,"dir":"Reference","previous_headings":"","what":"Reset number of imputations for a DGP emulator — set_imp","title":"Reset number of imputations for a DGP emulator — set_imp","text":"function resets number imputations prediction DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reset number of imputations for a DGP emulator — set_imp","text":"","code":"set_imp(object, B = 5)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reset number of imputations for a DGP emulator — set_imp","text":"object instance S3 class dgp. B number imputations produce predictions object. Increase value improve imputation uncertainty quantification. Decrease value improve speed prediction. Defaults 5.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reset number of imputations for a DGP emulator — set_imp","text":"updated object information B incorporated.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reset number of imputations for a DGP emulator — set_imp","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Reset number of imputations for a DGP emulator — set_imp","text":"function useful DGP emulator trained one wants make faster predictions decreasing number imputations without rebuilding emulator. following slots: loo oos created validate(); results created predict() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_imp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reset number of imputations for a DGP emulator — set_imp","text":"","code":"if (FALSE) { # \\dontrun{ # See design() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":null,"dir":"Reference","previous_headings":"","what":"Set linked indices — set_linked_idx","title":"Set linked indices — set_linked_idx","text":"function deprecated removed next release. updated lgp() function now offers simpler, efficient way specify linked information (D)GP emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set linked indices — set_linked_idx","text":"","code":"set_linked_idx(object, idx)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set linked indices — set_linked_idx","text":"object instance S3 class gp dgp. idx argument linked_idx gp() dgp().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set linked indices — set_linked_idx","text":"updated object information idx incorporated.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set linked indices — set_linked_idx","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Set linked indices — set_linked_idx","text":"function useful different models emulated different teams. team can create (D)GP emulator even without knowing different emulators connected together. information available different emulators collected, connection information emulators can assigned individual emulators function.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_linked_idx.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set linked indices — set_linked_idx","text":"","code":"if (FALSE) { # \\dontrun{ # See lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":null,"dir":"Reference","previous_headings":"","what":"Random seed generator — set_seed","title":"Random seed generator — set_seed","text":"function initializes random number generator sets random seed R Python ensure reproducible results package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Random seed generator — set_seed","text":"","code":"set_seed(seed)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Random seed generator — set_seed","text":"seed single integer value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Random seed generator — set_seed","text":"return value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Random seed generator — set_seed","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_seed.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Random seed generator — set_seed","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":null,"dir":"Reference","previous_headings":"","what":"Set the number of threads — set_thread_num","title":"Set the number of threads — set_thread_num","text":"function sets number threads parallel computations involved package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set the number of threads — set_thread_num","text":"","code":"set_thread_num(num)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set the number of threads — set_thread_num","text":"num number threads. greater maximum number threads available, number threads set maximum value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set the number of threads — set_thread_num","text":"return value.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_thread_num.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set the number of threads — set_thread_num","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":null,"dir":"Reference","previous_headings":"","what":"Add or remove the Vecchia approximation — set_vecchia","title":"Add or remove the Vecchia approximation — set_vecchia","text":"function adds removes Vecchia approximation GP, DGP linked (D)GP emulator constructed gp(), dgp() lgp().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add or remove the Vecchia approximation — set_vecchia","text":"","code":"set_vecchia(object, vecchia = TRUE, M = 25, ord = NULL)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add or remove the Vecchia approximation — set_vecchia","text":"object instance S3 class gp, dgp, lgp. vecchia bool list bools indicate addition removal Vecchia approximation: object instance gp dgp class, vecchia bool indicates either addition (vecchia = TRUE) removal (vecchia = FALSE) Vecchia approximation object. object instance lgp class, x can bool list bools: vecchia bool, indicates either addition (vecchia = TRUE) removal (vecchia = FALSE) Vecchia approximation individual (D)GP emulators contained object. vecchia list bools, shape struc supplied lgp(). bool list indicates corresponding (D)GP emulator contained object shall Vecchia approximation added removed. M size conditioning set Vecchia approximation (D)GP emulator training. Defaults 25. ord R function returns ordering input (D)GP emulator Vecchia approximation. function must satisfy following basic rules: first argument represents lengthscale-scaled input GP emulator lengthscale-scaled input GP node DGP emulator. output function vector indices gives ordering input GP emulator input GP nodes DGP emulator. ord = NULL, default random ordering used. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add or remove the Vecchia approximation — set_vecchia","text":"updated object Vecchia approximation either added removed.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add or remove the Vecchia approximation — set_vecchia","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/set_vecchia.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Add or remove the Vecchia approximation — set_vecchia","text":"function useful quickly switching Vecchia non-Vecchia approximations existing emulator without need reconstruct emulator. emulator built without Vecchia approximation, function can add , emulator built Vecchia approximation, function can remove . current state already matches requested state, emulator remains unchanged.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"function provides summary key information GP, DGP, linked (D)GP emulator generating either table interactive plot emulator’s structure.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"","code":"# S3 method for class 'gp' summary(object, type = \"plot\", ...) # S3 method for class 'dgp' summary(object, type = \"plot\", ...) # S3 method for class 'lgp' summary(object, type = \"plot\", group_size = 1, ...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"object can one following: S3 class gp. S3 class dgp. S3 class lgp. type character string, either \"table\" \"plot\", indicating format output. set \"table\", function returns summary table. set \"plot\", function returns interactive visualization. Defaults \"plot\". object created lgp() struc data frame, type automatically default \"table\". ... arguments can passed kableExtra::kbl() type = \"table\". group_size integer specifying number consecutive layers grouped together interactive visualization linked emulators type = \"plot\". argument applicable object instance lgp class. Defaults 1.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"Either summary table (returned kableExtra object) interactive visualization (returned visNetwork object) emulator. visualization compatible R Markdown documents RStudio Viewer. summary table can customized kableExtra::kableExtra package. resulting visNetwork object can saved HTML file using visNetwork::visSave() visNetwork::visNetwork package.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/summary.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Summary of a constructed GP, DGP, or linked (D)GP emulator — summary","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":null,"dir":"Reference","previous_headings":"","what":"Trace plot for DGP hyperparameters — trace_plot","title":"Trace plot for DGP hyperparameters — trace_plot","text":"function draws trace plots hyperparameters chosen GP node DGP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trace plot for DGP hyperparameters — trace_plot","text":"","code":"trace_plot(object, layer = NULL, node = 1)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trace plot for DGP hyperparameters — trace_plot","text":"object instance dgp class. layer index layer. Defaults NULL final layer. node index GP node layer specified layer. Defaults 1 first GP node corresponding layer.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trace plot for DGP hyperparameters — trace_plot","text":"ggplot object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Trace plot for DGP hyperparameters — trace_plot","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/trace_plot.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trace plot for DGP hyperparameters — trace_plot","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":null,"dir":"Reference","previous_headings":"","what":"Unpack a bundle of (D)GP emulators — unpack","title":"Unpack a bundle of (D)GP emulators — unpack","text":"function unpacks bundle (D)GP emulators safely manipulations unpacked individual emulators impact bundle.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Unpack a bundle of (D)GP emulators — unpack","text":"","code":"unpack(object)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Unpack a bundle of (D)GP emulators — unpack","text":"object instance class bundle.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Unpack a bundle of (D)GP emulators — unpack","text":"named list contains individual emulators (named emulator1,...,emulatorS) packed object, S number emulators object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Unpack a bundle of (D)GP emulators — unpack","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/unpack.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Unpack a bundle of (D)GP emulators — unpack","text":"","code":"if (FALSE) { # \\dontrun{ # See pack() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":null,"dir":"Reference","previous_headings":"","what":"Update a GP or DGP emulator — update","title":"Update a GP or DGP emulator — update","text":"function updates training input output GP DGP emulator option refit emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update a GP or DGP emulator — update","text":"","code":"update(object, X, Y, refit, reset, verb, ...) # S3 method for class 'dgp' update( object, X, Y, refit = TRUE, reset = FALSE, verb = TRUE, N = NULL, cores = 1, ess_burn = 10, B = NULL, ... ) # S3 method for class 'gp' update(object, X, Y, refit = TRUE, reset = FALSE, verb = TRUE, ...)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update a GP or DGP emulator — update","text":"object can one following: S3 class gp. S3 class dgp. X new input data matrix row input training data point column represents input dimension. Y new output data: object instance gp class, Y matrix one column row output data point. object instance dgp class, Y matrix rows output data points columns output dimensions. likelihood (see ) NULL, Y must matrix one column. refit bool indicating whether re-fit emulator object training input output updated. Defaults TRUE. reset bool indicating whether reset hyperparameters emulator object initial values first obtained emulator constructed. Use suspected local mode hyperparameters reached successive updates. Defaults FALSE. verb bool indicating trace information printed function execution. Defaults TRUE. ... N/. N number training iterations used re-fit emulator object instance dgp class. set NULL, number iterations set 100 DGP emulator constructed without Vecchia approximation, set 50 Vecchia approximation used. Defaults NULL. cores number processes used re-fit GP components (layer) M-step re-fitting. set NULL, number processes set (max physical cores available - 1) vecchia = FALSE max physical cores available %/% 2 vecchia = TRUE. use multiple processes large number GP components different layers optimization GP components computationally expensive. Defaults 1. ess_burn number burnin steps ESS-within-Gibbs sampler -step training emulator object instance dgp class. Defaults 10. B number imputations predictions updated emulator object instance dgp class. overrides number imputations set object. Set NULL use number imputations set object. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update a GP or DGP emulator — update","text":"updated object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Update a GP or DGP emulator — update","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Update a GP or DGP emulator — update","text":"following slots: loo oos created validate(); results created predict(); design created design() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/update.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update a GP or DGP emulator — update","text":"","code":"if (FALSE) { # \\dontrun{ # See alm(), mice(), or vigf() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"function calculates Leave-One-(LOO) cross validation --Sample (OOS) validation statistics constructed GP, DGP, linked (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"","code":"validate( object, x_test, y_test, method, sample_size, verb, M, force, cores, ... ) # S3 method for class 'gp' validate( object, x_test = NULL, y_test = NULL, method = NULL, sample_size = 50, verb = TRUE, M = 50, force = FALSE, cores = 1, ... ) # S3 method for class 'dgp' validate( object, x_test = NULL, y_test = NULL, method = NULL, sample_size = 50, verb = TRUE, M = 50, force = FALSE, cores = 1, ... ) # S3 method for class 'lgp' validate( object, x_test = NULL, y_test = NULL, method = NULL, sample_size = 50, verb = TRUE, M = 50, force = FALSE, cores = 1, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"object can one following: S3 class gp. S3 class dgp. S3 class lgp. x_test OOS testing input data: object instance gp dgp class, x_test matrix row new input location used validating emulator column input dimension. object instance lgp class, x_test can matrix list: x_test matrix, global testing input data feed emulators first layer system. rows x_test represent different input data points columns represent input dimensions across emulators first layer system. case, assumed global input system input emulators first layer global input emulators layers. x_test list, L (number layers emulator system) elements. first element matrix represents global testing input data feed emulators first layer system. remaining L-1 elements L-1 sub-lists, contains number (number emulators corresponding layer) matrices (rows testing input data points columns input dimensions) represent global testing input data emulators corresponding layer. matrices must placed sub-lists based corresponding emulators placed struc argument lgp(). global input data certain emulator, set NULL corresponding sub-list x_test. option linked (D)GP emulators deprecated removed next release. object instance lgp class created lgp() argument struc data frame form, x_test must matrix representing global input, row corresponds test data point column represents global input dimension. column indices x_test must align indices specified From_Output column struc data frame (used lgp()), corresponding rows From_Emulator column \"Global\". x_test must provided object instance lgp. x_test must also provided y_test provided. Defaults NULL, case LOO validation performed. y_test OOS output data corresponding x_test: object instance gp class, y_test matrix one column row represents output corresponding matching row x_test. object instance dgp class, y_test matrix row represents output corresponding matching row x_test columns representing output dimensions. object instance lgp class, y_test can single matrix list matrices: y_test single matrix, one emulator final layer linked emulator system y_test represents emulator's output rows testing positions columns output dimensions. y_test list, y_test L matrices, L number emulators final layer system. matrix rows corresponding testing positions columns corresponding output dimensions associated emulator final layer. y_test must provided object instance lgp. y_test must also provided x_test provided. Defaults NULL, case LOO validation performed. method prediction approach use validation: either mean-variance approach (\"mean_var\") sampling approach (\"sampling\"). details see predict(). DGP emulators categorical likelihood (likelihood = \"Categorical\" dgp()), sampling approach supported. default, method set \"sampling\" DGP emulators Poisson, Negative Binomial, Categorical likelihoods \"mean_var\" otherwise. sample_size number samples draw given imputation method = \"sampling\". Defaults 50. verb bool indicating trace information validation printed function execution. Defaults TRUE. M size conditioning set Vecchia approximation emulator validation. argument used emulator object constructed Vecchia approximation. Defaults 50. force bool indicating whether force LOO OOS re-evaluation loo oos slot already exists object. force = FALSE, validate() re-evaluate emulators x_test y_test identical values oos slot. existing loo oos validation used different M Vecchia approximation different method one prescribed call, emulator re-evaluated. Set force TRUE LOO OOS re-evaluation required. Defaults FALSE. cores number processes used validation. set NULL, number processes set max physical cores available %/% 2. Defaults 1. ... N/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"object instance gp class, updated object returned additional slot called loo (LOO cross validation) oos (OOS validation) contains: two slots called x_train (x_test) y_train (y_test) contain validation data points LOO (OOS). column matrix called mean, method = \"mean_var\", median, method = \"sampling\", contains predictive means medians GP emulator validation positions. three column matrices called std, lower, upper contain predictive standard deviations credible intervals GP emulator validation positions. method = \"mean_var\", upper lower bounds credible interval two standard deviations predictive mean. method = \"sampling\", upper lower bounds credible interval 2.5th 97.5th percentiles. numeric value called rmse contains root mean/median squared error GP emulator. numeric value called nrmse contains (max-min) normalized root mean/median squared error GP emulator. max-min normalization uses maximum minimum values validation outputs contained y_train (y_test). integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation method = \"sampling\". rows matrices (mean, median, std, lower, upper) correspond validation positions. object instance dgp class, updated object returned additional slot called loo (LOO cross validation) oos (OOS validation) contains: two slots called x_train (x_test) y_train (y_test) contain validation data points LOO (OOS). matrix called mean, method = \"mean_var\", median, method = \"sampling\", contains predictive means medians DGP emulator validation positions. three matrices called std, lower, upper contain predictive standard deviations credible intervals DGP emulator validation positions. method = \"mean_var\", upper lower bounds credible interval two standard deviations predictive mean. method = \"sampling\", upper lower bounds credible interval 2.5th 97.5th percentiles. vector called rmse contains root mean/median squared errors DGP emulator across different output dimensions. vector called nrmse contains (max-min) normalized root mean/median squared errors DGP emulator across different output dimensions. max-min normalization uses maximum minimum values validation outputs contained y_train (y_test). integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation method = \"sampling\". rows columns matrices (mean, median, std, lower, upper) correspond validation positions DGP emulator output dimensions, respectively. object instance dgp class categorical likelihood, updated object returned additional slot called loo (LOO cross validation) oos (OOS validation) contains: two slots called x_train (x_test) y_train (y_test) contain validation data points LOO (OOS). matrix called label contains predictive samples labels DGP emulator validation positions. matrix rows corresponding validation positions columns corresponding samples labels. list called probability contains predictive samples probabilities class DGP emulator validation positions. element list matrix rows corresponding validation positions columns corresponding samples probabilities. scalar called log_loss represents average log loss predicted labels DGP emulator across validation positions. Log loss measures accuracy probabilistic predictions, lower values indicating better classification performance. log_loss ranges 0 positive infinity, value closer 0 suggests confident accurate predictions. integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation. object instance lgp class, updated object returned additional slot called oos (OOS validation) contains: two slots called x_test y_test contain validation data points OOS. list called mean, method = \"mean_var\", median, method = \"sampling\", contains predictive means medians linked (D)GP emulator validation positions. three lists called std, lower, upper contain predictive standard deviations credible intervals linked (D)GP emulator validation positions. method = \"mean_var\", upper lower bounds credible interval two standard deviations predictive mean. method = \"sampling\", upper lower bounds credible interval 2.5th 97.5th percentiles. list called rmse contains root mean/median squared errors linked (D)GP emulator. list called nrmse contains (max-min) normalized root mean/median squared errors linked (D)GP emulator. max-min normalization uses maximum minimum values validation outputs contained y_test. integer called M contains size conditioning set used Vecchia approximation, used, emulator validation. integer called sample_size contains number samples used validation method = \"sampling\". element mean, median, std, lower, upper, rmse, nrmse corresponds (D)GP emulator final layer linked (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"x_test y_test NULL, LOO cross validation implemented. Otherwise, OOS validation implemented. LOO validation applicable GP DGP emulator (.e., object instance gp dgp class). linked (D)GP emulator (.e., object instance lgp class) provided, x_test y_test must also provided OOS validation.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/validate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Validate a constructed GP, DGP, or linked (D)GP emulator — validate","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), or lgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":null,"dir":"Reference","previous_headings":"","what":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"function searches candidate set locate next design point(s) added (D)GP emulator bundle (D)GP emulators using Variance Improvement Global Fit (VIGF). VIGF GP emulators, see reference .","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"","code":"vigf(object, ...) # S3 method for class 'gp' vigf( object, x_cand = NULL, n_start = 10, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, ... ) # S3 method for class 'dgp' vigf( object, x_cand = NULL, n_start = 10, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... ) # S3 method for class 'bundle' vigf( object, x_cand = NULL, n_start = 10, batch_size = 1, M = 50, workers = 1, limits = NULL, int = FALSE, aggregate = NULL, ... )"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"object can one following: S3 class gp. S3 class dgp. S3 class bundle. ... arguments (names different arguments used vigf()) used aggregate can passed . x_cand matrix (row design point column input dimension) gives candidate set next design point(s) determined. object instance bundle class aggregate supplied, x_cand can also list. list must length equal number emulators object, element matrix representing candidate set corresponding emulator bundle. Defaults NULL. n_start integer gives number initial design points used determine next design point(s). argument used x_cand NULL. Defaults 10. batch_size integer gives number design points chosen. Defaults 1. M size conditioning set Vecchia approximation criterion calculation. argument used emulator object constructed Vecchia approximation. Defaults 50. workers number processes used design point selection. set NULL, number processes set max physical cores available %/% 2. Defaults 1. argument currently support Windows machines aggregate function provided, due significant overhead caused initializing Python environment worker spawning. limits two-column matrix gives ranges input dimension, vector length two one input dimension. vector provided, converted two-column row matrix. rows matrix correspond input dimensions, first second columns correspond minimum maximum values input dimensions. argument used x_cand = NULL. Defaults NULL. int bool vector bools indicates input dimension integer type. single bool given, applied input dimensions. vector provided, length equal input dimensions applied individual input dimensions. argument used x_cand = NULL. Defaults FALSE. aggregate R function aggregates scores VIGF across different output dimensions (object instance dgp class) across different emulators (object instance bundle class). function specified following basic form: first argument matrix representing scores. rows matrix correspond different design points. number columns matrix equals : emulator output dimension object instance dgp class; number emulators contained object object instance bundle class. output vector gives aggregate scores different design points. Set NULL disable aggregation. Defaults NULL.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"x_cand NULL: object instance gp class, vector length batch_size returned, containing positions (row numbers) next design points x_cand. object instance dgp class, vector length batch_size * D returned, containing positions (row numbers) next design points x_cand added DGP emulator. D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, matrix returned batch_size rows column emulator bundle, containing positions (row numbers) next design points x_cand individual emulators. x_cand NULL: object instance gp class, matrix batch_size rows returned, giving next design points evaluated. object instance dgp class, matrix batch_size * D rows returned, : D number output dimensions DGP emulator likelihood layer included. DGP emulator Hetero NegBin likelihood layer, D = 2. DGP emulator Categorical likelihood layer, D = 1 binary output D = K multi-class output K classes. object instance bundle class, list returned length equal number emulators bundle. element list matrix batch_size rows, row represents design point added corresponding emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"first column matrix supplied first argument aggregate must correspond first output dimension DGP emulator object instance dgp class, subsequent columns dimensions. object instance bundle class, first column must correspond first emulator bundle, subsequent columns emulators.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"Mohammadi, H., & Challenor, P. (2022). Sequential adaptive design emulating costly computer codes. arXiv:2206.12113.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/vigf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF — vigf","text":"","code":"if (FALSE) { # \\dontrun{ # load packages and the Python env library(lhs) library(dgpsi) # construct a 1D non-stationary function f <- function(x) { sin(30*((2*x-1)/2-0.4)^5)*cos(20*((2*x-1)/2-0.4)) } # generate the initial design X <- maximinLHS(10,1) Y <- f(X) # training a 2-layered DGP emulator with the global connection off m <- dgp(X, Y, connect = F) # specify the input range lim <- c(0,1) # locate the next design point using VIGF X_new <- vigf(m, limits = lim) # obtain the corresponding output at the located design point Y_new <- f(X_new) # combine the new input-output pair to the existing data X <- rbind(X, X_new) Y <- rbind(Y, Y_new) # update the DGP emulator with the new input and output data and refit m <- update(m, X, Y, refit = TRUE) # plot the LOO validation plot(m) } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":null,"dir":"Reference","previous_headings":"","what":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"function trims sequence hyperparameter estimates within DGP emulator generated training.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"","code":"window(object, start, end = NULL, thin = 1)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"object instance S3 class dgp. start first iteration iterations trimmed sequence. end last iteration iterations trimmed sequence. Set NULL keep iterations (including) start. Defaults NULL. thin interval start end iterations thin sequence. Defaults 1.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"updated object trimmed sequence hyperparameters.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"function useful DGP emulator trained one wants trim sequence hyperparameters estimated use trimmed sequence generate point estimates DGP model parameters prediction. following slots: loo oos created validate(); results created predict() object removed contained returned object.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/window.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Trim the sequence of hyperparameter estimates within a DGP emulator — window","text":"","code":"if (FALSE) { # \\dontrun{ # See dgp() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":null,"dir":"Reference","previous_headings":"","what":"Save the constructed emulator — write","title":"Save the constructed emulator — write","text":"function saves constructed emulator .pkl file.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save the constructed emulator — write","text":"","code":"write(object, pkl_file, light = TRUE)"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save the constructed emulator — write","text":"object instance S3 class gp, dgp, lgp, bundle. pkl_file path name .pkl file emulator object saved. light bool indicating light version constructed emulator (requires less disk space store) saved. Defaults TRUE.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save the constructed emulator — write","text":"return value. object saved local .pkl file specified pkl_file.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Save the constructed emulator — write","text":"See examples tutorials https://mingdeyu.github.io/dgpsi-R/dev/.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Save the constructed emulator — write","text":"Since emulators built package 'python' objects, save() R work R objects. object processed set_vecchia() add remove Vecchia approximation, light set FALSE ensure reproducibility saved emulator reloaded read().","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/reference/write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save the constructed emulator — write","text":"","code":"if (FALSE) { # \\dontrun{ # See gp(), dgp(), lgp(), or pack() for an example. } # }"},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-250-9000-development-version","dir":"Changelog","previous_headings":"","what":"dgpsi 2.5.0-9000 (development version)","title":"dgpsi 2.5.0-9000 (development version)","text":"Prediction speed enhanced small testing data sets reducing overhead caused multi-threading implementation.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-250","dir":"Changelog","previous_headings":"","what":"dgpsi 2.5.0","title":"dgpsi 2.5.0","text":"CRAN release: 2024-12-14 Training times DGP emulators now approximately 30%-40% faster. computation (D)GP predictions Leave-One-(LOO) evaluations now 6-7 times faster. nb_parallel argument removed relevant functions, multi-threading now integrated default. Vecchia approximation, implemented SI framework, now available across functions support large-scale emulations. Two new functions, get_thread_num() set_thread_num(), allow users inspect adjust number threads used multi-threaded computations. new function, set_vecchia(), enables users easily add remove Vecchia approximation GP, DGP, linked (D)GP emulators. Documentation now includes lifecycle status badges highlight deprecated newly introduced functions arguments. default value nugget parameter DGP emulators likelihood layers adjusted 1e-6 1e-4. Categorical likelihood option added dgp() function’s likelihood argument, enabling DGP-based classification. issue related LD_LIBRARY environment variable Linux systems resolved via init_py() function. lgp() function enhanced accept connection information among emulators form data frame, streamlining linked emulation setup. new function, set_id(), allows users assign unique IDs emulators. predict() function updated accommodate predictions DGP classifiers. plot() function updated generate validation plots DGP classifiers (.e., DGP emulators categorical likelihoods) linked emulators created lgp() using new data frame form struc. summary() function redesigned provide summary tables visualizations structure model specifications (D)GP linked (D)GP emulators. sample_size argument added validate() plot() functions, allowing users adjust number samples used validation validation method set sampling. combine() set_linked_idx() deprecated version removed next release. two functions longer maintained. Please refer updated package documentation alternative workflows. basic node functions kernel(), Hetero(), Poisson(), NegBin(), along struc argument gp() dgp() functions, removed version. Customization (D)GP specifications can achieved modifying arguments gp() dgp(). draw() function updated instances bundle class allow drawing design evaluation plots emulators single figure. plot() function updated linked emulators generated lgp() using new data frame form struc. design() function redesigned allow new specifications user-supplied method function. batch_size argument added design() enable locating multiple design points single iteration sequential design. argument compatible built-method functions: alm(), mice(), vigf(). alm() vigf() functions redesigned support continuous search next design point search discrete candidate set passed x_cand argument. alm(), mice(), vigf() functions updated output locations identified design points discrete candidate set supplied. pei() function removed package re-engineering added back future version. default refit argument update() function changed FALSE TRUE. write() function now allows light = TRUE GP emulators bundles GP emulators. Two new functions, serialize() deserialize(), added allow users export emulators multi-session workers parallel processing. Additional vignettes available, showcasing large-scale DGP emulation, DGP classification, Bayesian optimization using (D)GP emulators. Enhanced clarity consistency across documentation. Improved examples explanations vignettes better user guidance.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-240","dir":"Changelog","previous_headings":"","what":"dgpsi 2.4.0","title":"dgpsi 2.4.0","text":"CRAN release: 2024-01-14 One can now use design() implement sequential designs using f fixed candidate set passed x_cand y_cand = NULL. sizes .pkl files written write() significantly reduced. One can now set different kernel functions nodes different layers DGP emulator passing vector kernel function names name argument dgp(). default number imputations B dgp() lgp() changed 10 faster validations predictions. default method sequential designs design() changed vigf(). new argument new_wave added design() allow users resume sequential designs without separate wave. bug vigf() fixed object instance bundle class batch_size greater one. Static dynamic pruning DGP structures implemented prune() design() (via new arguments pruning control) respectively. redundant codes removed update() makes design() slightly faster. limits argument design() now required x_cand supplied avoid -sampling using limits inferred training data. design() now supports f produce NA outputs. useful prevent sequential design stopping due errors NA outputs simulator input locations identified sequential design process. bug fixed design() x_cand supplied input dimension one. alm(), mice(), pei(), vigf() now accept separate candidate sets (even different number candidate points) via x_cand bundle emulators. slot called id added instances gp, dgp, lgp, bundle classes uniquely identify emulators. id can also passed instances gp, dgp,lgp, bundle classes new id argument gp(), dgp(), lgp(), pack(). pack() can now accept list (D)GP emulators input. check_point argument removed design() replaced autosave. Automatic saving emulators sequential design added design() new argument autosave. customized evaluation function provided design() via eval, design information previous waves retained long previous waves sequential design also use customized evaluation functions. different customized evaluation functions supplied design() different waves, trace plot RMSEs produced draw() show RMSEs different evaluation functions different waves. One can now link emulator multiple times chain via lgp() setting different linking information emulator via set_linked_idx(). Updates documentations vignettes.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-230","dir":"Changelog","previous_headings":"","what":"dgpsi 2.3.0","title":"dgpsi 2.3.0","text":"CRAN release: 2023-09-03 bug underlying Python implementations fixed name = 'matern2.5' gp() dgp(). Thanks @yyimingucl, bug underlying Python implementations MICE sequential design criterion mice() fixed. argument reset added update() design() reset hyperparameters (D)GP emulator initial values (specified emulator initialized) input output emulator updated emulator refitted. argument can useful sequential designs cases hyperparameters (D)GP emulator get caught suboptimal estimates. circumstances, one can set reset = TRUE reinitialize (D)GP emulator steps sequential designs strategy escape poor estimates. refitting emulator final step sequential design longer forced design(). argument type added plot() allow users draw OOS validation plots testing data shown line instead individual points emulator’s input one-dimensional style = 1. Thanks @tjmckinley, issue relating libstdc++..6 Linux machines R restarting installation package fixed. alm() mice() can locate new design points stochastic simulators (D)GP bundle emulators can deal stochastic outputs. design() can used construct (D)GP bundle emulators adaptively utilizing multiple realizations stochastic simulator design positions new argument reps method = alm method = mice. new slot called specs added objects returned gp() dgp() contains key information kernel functions used constructions GP DGP emulators. Due bug latest version underlying Python package, emulators saved write() version 2.1.6 2.2.0 may work properly update() design() loaded back read() version. bug addressed version emulators saved version compatibility issue future version. new sequential design criterion, called Variance Improvement Global Fit (VIGF), added package function vigf(). sampling existing candidate set x_cand design() changed random sampling conditioned Latin Hypercube sampling clhs package. python environment now automatically installed invoked function package executed. One need run init_py() activate required python environment init_py() still useful re-install uninstall underlying python environment. verb argument added init_py() switch /trace information.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-220","dir":"Changelog","previous_headings":"","what":"dgpsi 2.2.0","title":"dgpsi 2.2.0","text":"CRAN release: 2023-06-05 efficiency speed imputations involved training predictions DGP emulators significantly improved (achieving roughly 3x faster training imputations) utilizing blocked Gibbs sampling imputes latent variables layer-wise rather node-wise. blocked Gibbs sampling now default method DGP emulator inference can changed back old node-wise approach setting blocked_gibbs = FALSE dgp(). One can now optimize GP components contained layer DGP emulator parallel DGP emulator training, using multiple cores setting new argument cores dgp(). option useful can accelerate training speed input dimension moderately large (case large number GP components optimized) optimization GP components computationally expensive, e.g., share = FALSE case input dimensions individual GP components different lengthscales. Thanks @tjmckinley, bug update() object instance dgp class (trimmed window()) fixed. Thanks @tjmckinley, R memory issues due underlying Python implementations rectified. set_seed() function added ensure reproducible results package. bug fixed candidate sets x_cand y_cand provided design(). One can choose different color palettes using new argument color plot() style = 2. set_linked_idx() allows constructions different (D)GP emulators (terms different connections feeding layers) (D)GP emulator.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-216","dir":"Changelog","previous_headings":"","what":"dgpsi 2.1.6","title":"dgpsi 2.1.6","text":"CRAN release: 2023-02-08 bug found multi-core predictions predict() object instance lgp class x list. bug fixed version. Thanks @tjmckinley, issue (/usr/lib/x86_64-linux-gnu/libstdc++..6: version 'GLIBCXX_3.4.30' found) encountered Linux machines fixed automatically execution init_py(). gp() dgp() allow users specify value scale parameters whether estimate parameters. gp() dgp() allow users specify bounds lengthscales. jointly robust prior (Gu, 2019) implemented default inference approach GP emulators gp(). default value lengthscale gp() changed 0.2 0.1, default value nugget gp() changed 1e-6 1e-8 nugget_est = FALSE. One can now specify number GP nodes layer (except final layer) DGP emulator via node argument dgp(). Training data now contained S3 classes gp dgp. RMSEs (without min-max normalization) emulators now contained S3 classes gp, dgp, lgp execution validate(). window() function added trim traces obtain new point estimates DGP model parameters predictions. min-max normalization can now switched plot() setting value min_max. default number imputations B dgp() changed 50 30 better balance uncertainty speed DGP emulator predictions. new function set_imp() made available change number imputations trained DGP emulator one can either achieve faster predictions reducing number imputations, account imputation uncertainties increasing number imputations, without re-training emulator. default number imputations B continue() set NULL, case number imputations used object applied. nugget argument dgp() now specifies nugget values GP nodes different layers rather GP nodes final layer. speed predictions DGP emulators squared exponential kernels significantly improved roughly 3x faster implementations version 2.1.5. implementation sequential designs (two vignettes) (D)GP emulators using different criterion made available. Thanks @tjmckinley, internal reordering issue plot() fixed. init_py() now allows users reinstall uninstall underlying Python environment. bug occurs linked DGP emulator involves DGP emulator external inputs fixed. Intel SVML now installed Python environment automatically Intel users faster implementations.","code":""},{"path":"http://mingdeyu.github.io/dgpsi-R/dev/news/index.html","id":"dgpsi-215","dir":"Changelog","previous_headings":"","what":"dgpsi 2.1.5","title":"dgpsi 2.1.5","text":"CRAN release: 2022-09-29 Initial release R interface Python package dgpsi v2.1.5.","code":""}]