rapid_models.gp_diagnostics.metrics
Module Contents
Functions
|
Compute a set of evaluation metrics for GP regression with noiseless |
|
This is called by evaluate_GP() with the appropriate Cholesky factor: |
|
Compute log probability of the data Y under an unbiased Gaussian with |
|
Compute log probability of the data Y under an unbiased standard Gaussian |
- rapid_models.gp_diagnostics.metrics.evaluate_GP(K: nptyping.NDArray[nptyping.Shape[N, N], nptyping.Float], Y_train: nptyping.NDArray[nptyping.Shape[N], nptyping.Float], folds: List[List[int]] | None = None, noise_variance: float = 0.0, check_args: bool = True) Dict[str, Any] | None
Compute a set of evaluation metrics for GP regression with noiseless (noise_variance = 0) or fixed variance iid Gaussian noise.
Specify the list ‘folds’ of indices for multifold cross-validation (see documentation for cv.multifold), otherwise leave-one-out is assumed.
- Parameters:
K (2d array) – GP prior covariance matrix
Y_train (array) – training observations
folds (list of lists) – The index subsets for multifold cross-validation. Folds = None -> Leave-one-out
noise_variance (float) – variance of the observational noise. Set noise_variance = 0. for noiseless observations
check_args (bool) – Check (assert) that arguments are well-specified before computation
- Returns: a dict containing
log_marginal_likelihood: The log probability of Y_train log_pseudo_likelihood: The log ‘pseudo’ likelihood is the sum of the log probabilities of each observation during cross-validation in the
standard normal space
- RMSE: The root mean squared error obtained by using the GP posterior
mean as a deterministic prediction
(The residuals are also returned, for plotting and to check for normality) residuals_mean: Mean of CV residuals residuals_var: Variance of CV residuals residuals_transformed: The residuals transformed to the standard normal
space
- rapid_models.gp_diagnostics.metrics.evaluate_GP_cholesky(L: nptyping.NDArray[nptyping.Shape[N, N], nptyping.Float], Y_train: nptyping.NDArray[nptyping.Shape[N], nptyping.Float], folds: List[List[int]] | None = None, check_args: bool = True) Dict[str, Any]
This is called by evaluate_GP() with the appropriate Cholesky factor: LL^T = K + np.eye(K.shape[0])*noise_variance
- rapid_models.gp_diagnostics.metrics.log_prob_normal(L: nptyping.NDArray[nptyping.Shape[N, N], nptyping.Float], Y: nptyping.NDArray[nptyping.Shape[N], nptyping.Float]) float
Compute log probability of the data Y under an unbiased Gaussian with covariance L*L^T
- rapid_models.gp_diagnostics.metrics.log_prob_standard_normal(Y: nptyping.NDArray[nptyping.Shape[N], nptyping.Float]) float
Compute log probability of the data Y under an unbiased standard Gaussian