We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c733b77 commit 8420fbcCopy full SHA for 8420fbc
test/turing.jl
@@ -8,7 +8,10 @@
8
return nothing
9
end
10
11
- @model logp_check() = x ~ Normal()
+ @model function logp_check()
12
+ a ~ Normal()
13
+ return b ~ Normal()
14
+ end
15
16
n_samples = 1000
17
model = demo()
@@ -55,8 +58,15 @@
55
58
)
56
59
57
60
chain_logp_check = sample(
- logp_check(), Turing.Gibbs(:x => externalsampler(sampler)), 100; progress=false
61
+ logp_check(),
62
+ Turing.Gibbs(:a => externalsampler(sampler), :b => externalsampler(sampler)),
63
+ 100;
64
+ progress=false,
65
+ )
66
+ @test isapprox(
67
+ logpdf.(Normal(), chain_logp_check[:a]) .+
68
+ logpdf.(Normal(), chain_logp_check[:b]),
69
+ chain_logp_check[:lp],
70
- @test isapprox(logpdf.(Normal(), chain_logp_check[:x]), chain_logp_check[:lp])
71
72
0 commit comments