Skip to content

Commit

Permalink
add rng to lines in tests which are missing rng
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed Dec 21, 2021
1 parent 2b129c0 commit bfb05c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const test_props = [Proposals.Rejection(maxiter=Int(1e6)), Proposals.RWalk(ratio
sampler = Nested(D, 50D; bounds=bound, proposal=proposal)

chain, state = sample(rng, model, sampler; dlogz=0.01)
chain_res = sample(chain, Weights(vec(chain[:weights])), length(chain))
chain_res = sample(rng, chain, Weights(vec(chain[:weights])), length(chain))
# test posteriors
vals = Array(chain_res)
means = mean(vals, dims=1)
Expand Down Expand Up @@ -64,7 +64,7 @@ const test_props = [Proposals.Rejection(maxiter=Int(1e6)), Proposals.RWalk(ratio

spl = Nested(2, 1000, bounds=bound, proposal=proposal)
chain, state = sample(rng, model, spl; dlogz=0.01)
chain_res = sample(chain, Weights(vec(chain[:weights])), length(chain))
chain_res = sample(rng, chain, Weights(vec(chain[:weights])), length(chain))

diff = state.logz - analytic_logz
atol = 6state.logzerr
Expand All @@ -90,7 +90,7 @@ const test_props = [Proposals.Rejection(maxiter=Int(1e6)), Proposals.RWalk(ratio

@test state.logz logz atol = 5state.logzerr

chain_res = sample(chain, Weights(vec(chain[:weights])), length(chain))
chain_res = sample(rng, chain, Weights(vec(chain[:weights])), length(chain))
xmodes = sort!(findpeaks(chain_res[:, 1, 1])[1:5])
@test all(isapprox.(xmodes, 0.1:0.2:0.9, atol=0.2))
ymodes = sort!(findpeaks(chain_res[:, 2, 1])[1:5])
Expand Down

0 comments on commit bfb05c8

Please sign in to comment.