rxmc.predictive.gp_posterior_predictive#
- rxmc.predictive.gp_posterior_predictive(kernel, theta, X_train, residuals, X_pred, *, train_noise_var=None, jitter=1e-10)[source]#
Posterior mean and covariance of a GP discrepancy at
X_pred.Conditions a zero-mean GP with covariance
kernel(rebuilt attheta) on the observedresidualsatX_trainand returns its posterior atX_pred:\[\bar f_* = K_{*t} (K_{tt} + N)^{-1} r, \qquad \mathrm{cov}_* = K_{**} - K_{*t} (K_{tt} + N)^{-1} K_{t*}\]where
Nis the training-noise covariance.- Parameters:
kernel (sklearn-style kernel) – Object with
clone_with_thetaand__call__(as forkernel_term()).theta (array-like) – Kernel hyperparameters in sklearn log-theta space.
X_train, X_pred (array-like) – Training and prediction inputs (1-D promoted to a column).
residuals (array-like, shape (n_train,)) – Observed minus model-mean at
X_train.train_noise_var (float, array-like, or matrix, optional) – Training-noise variance: scalar (
var*I), per-point vector (diag), or full covariance. Defaults to none.jitter (float, optional) – Diagonal nugget added to the training covariance for stability.
- Returns:
mean (np.ndarray, shape (n_pred,))
cov (np.ndarray, shape (n_pred, n_pred))