Skip to content

Commit 06bb33d

Browse files
mhauruAoife
authored andcommitted
Fix model-manual's use of contexts
1 parent 14973ad commit 06bb33d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

developers/compiler/model-manual/index.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ Taking the `gdemo` model above as an example, the macro-based definition can be
3333
using DynamicPPL
3434
3535
# Create the model function.
36-
function gdemo2(model, varinfo, context, x)
36+
function gdemo2(model, varinfo, x)
3737
# Assume s² has an InverseGamma distribution.
3838
s², varinfo = DynamicPPL.tilde_assume!!(
39-
context, InverseGamma(2, 3), @varname(s²), varinfo
39+
model.context, InverseGamma(2, 3), @varname(s²), varinfo
4040
)
4141
4242
# Assume m has a Normal distribution.
4343
m, varinfo = DynamicPPL.tilde_assume!!(
44-
context, Normal(0, sqrt(s²)), @varname(m), varinfo
44+
model.context, Normal(0, sqrt(s²)), @varname(m), varinfo
4545
)
4646
4747
# Observe each value of x[i] according to a Normal distribution.
4848
for i in eachindex(x)
4949
_retval, varinfo = DynamicPPL.tilde_observe!!(
50-
context, Normal(m, sqrt(s²)), x[i], @varname(x[i]), varinfo
50+
model.context, Normal(m, sqrt(s²)), x[i], @varname(x[i]), varinfo
5151
)
5252
end
5353

0 commit comments

Comments
 (0)