|
1 | 1 | @testset "diffKernel" begin
|
2 |
| - @testset "smoke test" begin |
3 |
| - k = MaternKernel() |
4 |
| - k(1,1) |
5 |
| - k(1, DiffPt(1, partial=(1,1))) # Cov(Z(x), ∂₁∂₁Z(y)) where x=1, y=1 |
6 |
| - k(DiffPt([1], partial=1), [2]) # Cov(∂₁Z(x), Z(y)) where x=[1], y=[2] |
7 |
| - k(DiffPt([1,2], partial=(1)), DiffPt([1,2], partial=2))# Cov(∂₁Z(x), ∂₂Z(y)) where x=[1,2], y=[1,2] |
8 |
| - end |
| 2 | + @testset "smoke test" begin |
| 3 | + k = MaternKernel() |
| 4 | + k(1, 1) |
| 5 | + k(1, DiffPt(1; partial=(1, 1))) # Cov(Z(x), ∂₁∂₁Z(y)) where x=1, y=1 |
| 6 | + k(DiffPt([1]; partial=1), [2]) # Cov(∂₁Z(x), Z(y)) where x=[1], y=[2] |
| 7 | + k(DiffPt([1, 2]; partial=(1)), DiffPt([1, 2]; partial=2))# Cov(∂₁Z(x), ∂₂Z(y)) where x=[1,2], y=[1,2] |
| 8 | + end |
9 | 9 |
|
10 |
| - @testset "Sanity Checks with $k" for k in [SEKernel()] |
11 |
| - for x in [0, 1, -1, 42] |
12 |
| - # for stationary kernels Cov(∂Z(x) , Z(x)) = 0 |
13 |
| - @test k(DiffPt(x, partial=1), x) ≈ 0 |
| 10 | + @testset "Sanity Checks with $k" for k in [SEKernel()] |
| 11 | + for x in [0, 1, -1, 42] |
| 12 | + # for stationary kernels Cov(∂Z(x) , Z(x)) = 0 |
| 13 | + @test k(DiffPt(x; partial=1), x) ≈ 0 |
14 | 14 |
|
15 |
| - # the slope should be positively correlated with a point further down |
16 |
| - @test k( |
17 |
| - DiffPt(x, partial=1), # slope |
18 |
| - x + 1e-1 # point further down |
19 |
| - ) > 0 |
| 15 | + # the slope should be positively correlated with a point further down |
| 16 | + @test k( |
| 17 | + DiffPt(x; partial=1), # slope |
| 18 | + x + 1e-1, # point further down |
| 19 | + ) > 0 |
20 | 20 |
|
21 |
| - # correlation with self should be positive |
22 |
| - @test k(DiffPt(x, partial=1), DiffPt(x, partial=1)) > 0 |
23 |
| - end |
24 |
| - end |
| 21 | + # correlation with self should be positive |
| 22 | + @test k(DiffPt(x; partial=1), DiffPt(x; partial=1)) > 0 |
| 23 | + end |
| 24 | + end |
25 | 25 | end
|
0 commit comments