Check whether a surrogate-IES regime is favourable
Source:R/check_surrogate_regime.R
check_surrogate_regime.RdIssues a warning when the ratio of training points to parameters falls
below an empirical threshold, where the Gaussian-process surrogate
inside pesto_surrogate_ies() and surrogate_ensemble_update() is
unlikely to repay its training cost. The check is a soft guardrail —
it does not modify the run, only flags an unfavourable regime so the
caller can decide whether to fall back to pure IES.
Value
Invisibly returns TRUE when the regime is favourable
(n_train >= threshold * n_params) and FALSE otherwise.
Called for the warning side-effect.
Details
The default threshold of 5 corresponds to the soft floor
n_train >= 5 * n_params documented in
vignette("surrogate-ies", package = "PESTO"). Below that floor the
GP posterior variance typically stays above the uncertainty-driven
switching threshold and surrogate savings collapse to near zero.
This is exposed as a stand-alone helper so users can call it
explicitly before scheduling an expensive ensemble. It is not
invoked automatically by pesto_surrogate_ies() in the current
release; that wiring is tracked as a v0.2 enhancement candidate.
References
Rasmussen, C. E. & Williams, C. K. I. (2006). Gaussian Processes for Machine Learning. MIT Press.
Examples
# Favourable regime: 100 training points for 10 parameters.
check_surrogate_regime(n_params = 10L, n_train = 100L)
# Unfavourable regime: 30 training points for 30 parameters
# (the curse-of-dimensionality case from Scenario C of the
# comparison-and-simulation vignette). Emits a warning.
suppressWarnings(
check_surrogate_regime(n_params = 30L, n_train = 30L)
)
# Custom threshold for users with a smoother forward model.
check_surrogate_regime(n_params = 20L, n_train = 60L, threshold = 3)