mixle.doe.calibrate module¶
Kennedy-O’Hagan calibration: infer a simulator’s parameters with an explicit model-discrepancy term.
Field data rarely equals the simulator even at the true parameters – there is model-form error. Fitting
parameters by plain least squares absorbs that bias and gives wrong (over-confident) parameters. The
Kennedy-O’Hagan model writes y(x) = eta(x, theta) + delta(x) + noise with delta a GP discrepancy,
and infers theta and delta jointly, so the parameters are not contaminated by the bias.
- calibrate(simulator, x, y, theta0, *, discrepancy=True, discrepancy_lengthscale=None, seed=0, max_iter=300)[source]
Calibrate
simulator(x, theta)to field data(x, y)with a GP discrepancy term.Maximizes the marginal likelihood of the residual
r(theta) = y - eta(x, theta)under a GP + noise model, overthetaand the discrepancy amplitude + noise.discrepancy=Falsedrops the GP (plain nonlinear least squares) – useful to show the bias the discrepancy removes.The discrepancy correlation length is fixed (
discrepancy_lengthscale, default 10% of the input domain) rather than fitted: this is the standard resolution of the Kennedy-O’Hagantheta/deltaidentifiability problem – a short discrepancy length forces the GP to model only local model-form error, leaving the smooth global trend to the parametric simulator sothetastays identifiable. Set it to the scale of model error you expect.- Parameters:
simulator (Callable[[ndarray, ndarray], ndarray]) –
eta(x, theta) -> predictions(vectorized over the rows ofx).x (ndarray) – field inputs and observations.
y (ndarray) – field inputs and observations.
theta0 (Sequence[float]) – initial calibration parameters (its length sets the parameter count).
discrepancy (bool) – include the GP discrepancy term (the Kennedy-O’Hagan model).
discrepancy_lengthscale (float | None) – fixed GP correlation length (default: 10% of the input domain).
seed (int)
max_iter (int)
- Return type:
KOCalibration
- class KOCalibration(theta, ls, amp, noise, simulator, x, y)[source]
Bases:
objectResult of
calibrate(): the fitted parameters, discrepancy GP, and a calibrated predictor.- predict(x_new, *, with_discrepancy=True)[source]
Calibrated prediction at
x_new: simulator at the fittedtheta, plus the GP discrepancy (the bias-corrected estimate of reality) unlesswith_discrepancy=False(the pure simulator).