emulators.gpr
Gaussian Process Regression (GPR) emulator.
A flexible non-parametric emulator built on GPflow, using an automatic relevance determination (ARD) squared-exponential kernel. It captures nonlinear responses and gives excellent calibrated uncertainty, at higher computational cost than the linear/Bayes-linear emulators; best for small-to-medium training sets.
Classes
| Name | Description |
|---|---|
| GPR | Gaussian Process Regression emulator implemented in GPflow. |
GPR
emulators.gpr.GPR(x=None, y=None, test_fraction=0.25)Gaussian Process Regression emulator implemented in GPflow.
Uses an ARD squared-exponential kernel to model nonlinear parameter-output relationships with well-calibrated predictive uncertainty. More expensive than the linear/Bayes-linear emulators, so it is best suited to small-to-medium training sets where prediction quality matters most.
Example
import numpy as np, pandas as pd
from historymatching.emulators.gpr import GPR
x = pd.DataFrame({'beta': np.random.rand(40), 'gamma': np.random.rand(40)})
y = pd.DataFrame({'peak': np.sin(3 * x['beta']) + x['gamma'] ** 2})
em = GPR(x, y)
em.train()
pred = em.predict(x)Methods
| Name | Description |
|---|---|
| get_hyperparameters | Return GPR hyperparameters as a JSON-serializable dict. |
| predict | Predict an output using the trained emulator. |
| print_emulator_description | Display detailed specifications (for example, emulator coefficients) |
| train | Fits a GPR model. |
get_hyperparameters
emulators.gpr.GPR.get_hyperparameters()Return GPR hyperparameters as a JSON-serializable dict.
predict
emulators.gpr.GPR.predict(x)Predict an output using the trained emulator.
print_emulator_description
emulators.gpr.GPR.print_emulator_description()Display detailed specifications (for example, emulator coefficients) for the trained emulator.
train
emulators.gpr.GPR.train()Fits a GPR model.
Inputs are normalized to [0, 1] and outputs are standardized (zero mean, unit variance) before training. This ensures: - Kernel lengthscales are comparable across parameters with very different physical scales (e.g. 0.0005–0.006 vs 1.0–3.0). - The optimizer isn’t confused by large output offsets (e.g. birth weight ~ 3000 g with a signal of a few grams).
Predictions are un-standardized automatically in predict().