Skip to content

Commit

Permalink
Revert "fix"
Browse files Browse the repository at this point in the history
This reverts commit d1f29ce.
  • Loading branch information
miguelbiron committed Dec 12, 2024
1 parent d7ebbcb commit 7e4aade
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions test/test_JuliaBUGS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,26 @@ exact_logZ = unid_target_exact_logZ(
)
end

# @testset "SliceSampler on constrained and unconstrained versions" begin
# for target in (unid_target, unid_target_constrained)
# @show target.model
# pt = pigeons(;
# target,
# explorer = SliceSampler(),
# n_chains=7,
# n_rounds=5
# )
# @test isapprox(Pigeons.stepping_stone(pt), exact_logZ, rtol=0.1)
# end
# end
@testset "SliceSampler on constrained and unconstrained versions" begin
exact_logZ = unid_target_exact_logZ(
unid_target_model.evaluation_env.n_flips,
unid_target_model.evaluation_env.n_heads
)
for target in (unid_target, unid_target_constrained)
@show target.model
pt = pigeons(;
target,
explorer = SliceSampler(),
n_chains=7,
n_rounds=5
)
@test isapprox(Pigeons.stepping_stone(pt), exact_logZ, rtol=0.1)
end
end

# @testset "Invariance test" begin
# uncond_target = JuliaBUGSPath(compile(unid_model_def, (;n_flips=100000)))
# res = Pigeons.invariance_test(uncond_target, SliceSampler(); condition_on=(:n_heads,))
# @show res.pvalues
# @test res.passed
# end
@testset "Invariance test" begin
uncond_target = JuliaBUGSPath(compile(unid_model_def, (;n_flips=100000)))
res = Pigeons.invariance_test(uncond_target, SliceSampler(); condition_on=(:n_heads,))
@show res.pvalues
@test res.passed
end

0 comments on commit 7e4aade

Please sign in to comment.