Skip to content

Commit 3a4b7fb

Browse files
committed
add docstring
1 parent 84a69d1 commit 3a4b7fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/TestUtils.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ function build_latent_gp(theta)
3535
return LatentGP(GP(kernel), dist_y_given_f, 1e-8)
3636
end
3737

38+
"""
39+
test_approximation_predictions(approx)
40+
41+
Test whether the prediction interface for `approx` works and whether in the
42+
conjugate case `posterior(approx, LatentGP(f, GaussianLikelihood(), jitter)(x), y)`
43+
gives approximately the same answer as exact GP regression.
44+
45+
Does not test `approx_lml`!
46+
47+
Do not rely on this as the only test of a new approximation!
48+
"""
3849
function test_approximation_predictions(approx)
3950
rng = MersenneTwister(123456)
4051
N_cond = 5
@@ -45,6 +56,7 @@ function test_approximation_predictions(approx)
4556
f = GP(Matern32Kernel())
4657
# Sample from prior.
4758
x = collect(range(-1.0, 1.0; length=N_cond))
59+
# TODO: Change to x = ColVecs(rand(2, N_cond)) once #109 is fixed
4860
noise_scale = 0.1
4961
fx = f(x, noise_scale^2)
5062
y = rand(rng, fx)

0 commit comments

Comments
 (0)