|
1 | 1 | @testset "distribution_wrappers.jl" begin
|
2 |
| - d = Normal() |
3 |
| - nd = DynamicPPL.NoDist(d) |
| 2 | + @testset "univariate" begin |
| 3 | + d = Normal() |
| 4 | + nd = DynamicPPL.NoDist(d) |
4 | 5 |
|
5 |
| - # Smoke test |
6 |
| - rand(nd) |
| 6 | + # Smoke test |
| 7 | + rand(nd) |
7 | 8 |
|
8 |
| - # Actual tests |
9 |
| - @test minimum(nd) == -Inf |
10 |
| - @test maximum(nd) == Inf |
11 |
| - @test logpdf(nd, 15.0) == 0 |
12 |
| - @test Bijectors.logpdf_with_trans(nd, 30, true) == 0 |
| 9 | + # Actual tests |
| 10 | + @test minimum(nd) == -Inf |
| 11 | + @test maximum(nd) == Inf |
| 12 | + @test logpdf(nd, 15.0) == 0 |
| 13 | + @test Bijectors.logpdf_with_trans(nd, 30, true) == 0 |
| 14 | + @test Bijectors.bijector(nd) == Bijectors.bijector(d) |
| 15 | + end |
| 16 | + |
| 17 | + @testset "multivariate" begin |
| 18 | + d = Product([Normal(), Uniform()]) |
| 19 | + nd = DynamicPPL.NoDist(d) |
| 20 | + |
| 21 | + # Smoke test |
| 22 | + @test length(rand(nd)) == 2 |
| 23 | + |
| 24 | + # Actual tests |
| 25 | + #@test length(nd) == 2 |
| 26 | + #@test size(nd) == (2,) |
| 27 | + @test minimum(nd) == [-Inf, 0.0] |
| 28 | + @test maximum(nd) == [Inf, 1.0] |
| 29 | + @test logpdf(nd, [15.0, 0.5]) == 0 |
| 30 | + @test Bijectors.logpdf_with_trans(nd, [0, 1]) == 0 |
| 31 | + @test Bijectors.bijector(nd) == Bijectors.bijector(d) |
| 32 | + end |
13 | 33 | end
|
0 commit comments