Skip to content

Commit

Permalink
Replace truncated(d, 0, Inf) -> truncated(d; lower=0) (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
penelopeysm authored Nov 6, 2024
1 parent 1c21a52 commit efce447
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tutorials/docs-13-using-turing-performance-tips/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The following example with abstract types
p, n = size(x)
params = Vector{Real}(undef, n)
for i in 1:n
params[i] ~ truncated(Normal(), 0, Inf)
params[i] ~ truncated(Normal(); lower=0)
end
a = x * params
Expand All @@ -96,7 +96,7 @@ can be transformed into the following representation with concrete types:
p, n = size(x)
params = Vector{T}(undef, n)
for i in 1:n
params[i] ~ truncated(Normal(), 0, Inf)
params[i] ~ truncated(Normal(); lower=0)
end
a = x * params
Expand All @@ -108,7 +108,7 @@ Alternatively, you could use `filldist` in this example:

```{julia}
@model function tmodel(x, y)
params ~ filldist(truncated(Normal(), 0, Inf), size(x, 2))
params ~ filldist(truncated(Normal(); lower=0), size(x, 2))
a = x * params
return y ~ MvNormal(a, I)
end
Expand Down

0 comments on commit efce447

Please sign in to comment.