rapid_models.gp_diagnostics.metrics

Module Contents

Functions

evaluate_GP(K, Y_train, folds=None, noise_variance=0, check_args=True)

Compute a set of evaluation metrics for GP regression with noiseless (noise_variance = 0) or fixed variance iid Gaussian noise.

evaluate_GP_cholesky(L, Y_train, folds=None, check_args=True)

This is called by evaluate_GP() with the appropriate Cholesky factor: LL^T = K + np.eye(K.shape[0])*noise_variance

log_prob_normal(L, Y)

Compute log probability of the data Y under an unbiased Gaussian with covariance L*L^T

log_prob_standard_normal(Y)

Compute log probability of the data Y under an unbiased standard Gaussian

rapid_models.gp_diagnostics.metrics.evaluate_GP(K, Y_train, folds=None, noise_variance=0, check_args=True)[source]

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 – 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, Y_train, folds=None, check_args=True)[source]

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, Y)[source]

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)[source]

Compute log probability of the data Y under an unbiased standard Gaussian