Skip to contents

Compare two GP posterior predictions numerically

Usage

compare_gp_predictions(reference, candidate)

Arguments

reference

Reference prediction object with mean and latent_variance fields.

candidate

Candidate prediction object with matching lengths.

Value

A named list of numerical accuracy differences.

Stability

Experimental: this interface may change in a minor release, and every change is listed in NEWS. See gaussianprocesses-package for the policy.

Examples

x <- seq(-3, 3, length.out = 100)
y <- sin(x)
kernel <- rbf_kernel(length_scale = 0.8)

exact <- predict_gp(fit_gp(x, y, kernel, noise_variance = 0.01), x)
sparse <- predict_sparse_gp(
  fit_sparse_gp(x, y, kernel, noise_variance = 0.01, n_inducing = 10),
  x
)

compare_gp_predictions(exact, sparse)
#> $posterior_mean_rmse
#> [1] 0.0025932
#> 
#> $posterior_mean_max_abs_error
#> [1] 0.008326664
#> 
#> $latent_variance_mae
#> [1] 0.001254913
#> 
#> $latent_variance_max_abs_error
#> [1] 0.007606531
#>