Skip to content

Commit 9c4ff2e

Browse files
committed
also on tests
1 parent 8f74495 commit 9c4ff2e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

test/diffKernel.jl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
@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
99

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
1414

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
2020

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
2525
end

0 commit comments

Comments
 (0)