twingp {twingp} | R Documentation |
A Fast Global-Local Gaussian Process Approximation
twingp(
x,
y,
x_test,
nugget = TRUE,
twins = 5,
g_num = NULL,
l_num = NULL,
v_num = NULL,
num_threads = NULL
)
x |
|
y |
|
x_test |
|
nugget |
Boolean indicating if a nugget to model observation noise is included in the model, the default is |
twins |
Number of twinning samples computed to identify the best set of global points, the default is |
g_num |
Number of global points included in the model, the default is |
l_num |
Number of local points included in the model, the default is |
v_num |
Number of validation points, the default is |
num_threads |
Number of threads for parallel computation, the default is all available threads |
We employ a combined global-local approach in building the Gaussian process approximation. Our framework uses a subset-of-data approach where the subset is a union of a set of global points designed to capture the global trend in the data, and a set of local points specific to a given testing location. We use Twinning
(Vakayil and Joseph, 2022) to identify the set of global points. The local points are identified as the nearest neighbors to the testing location. The correlation function is also modeled as a combination of a global, and a local kernel. For further details on the methodology, please refer to Vakayil and Joseph (2024).
A list of two t * 1
vectors mu
, and sigma
representing the mean prediction and associated standard error corresponding to x_test
Vakayil, A., & Joseph, V. R. (2024). A Global-Local Approximation Framework for Large-Scale Gaussian Process Modeling. Technometrics, 66(2), 295-305.
Vakayil, A., & Joseph, V. R. (2022). Data Twinning. Statistical Analysis and Data Mining: The ASA Data Science Journal, 15(5), 598-610.
grlee12 = function(x) {
term1 = sin(10 * pi * x) / (2 * x)
term2 = (x - 1)^4
y = term1 + term2
return(y)
}
x = matrix(seq(0.5, 2.5, length=500), ncol=1)
y = apply(x, 1, grlee12) + rnorm(nrow(x)) * 0.1
x_test = matrix(seq(0.5, 2.5, length=2000), ncol=1)
y_test = apply(x_test, 1, grlee12)
result = twingp(x, y, x_test, num_threads=2)
rmse = sqrt(mean((y_test - result$mu)^2))