Skip to content

Commit

Permalink
Merge branch 'master' into wct/improve-ad-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
willtebbutt authored Nov 8, 2024
2 parents cbe8efa + 4ec5d7f commit 5e03a1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tutorials/09-variational-inference/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ test = Matrix(test_cut[:, remove_names]);
# Bayesian linear regression.
@model function linear_regression(x, y, n_obs, n_vars, ::Type{T}=Vector{Float64}) where {T}
# Set variance prior.
σ² ~ truncated(Normal(0, 100), 0, Inf)
σ² ~ truncated(Normal(0, 100); lower=0)
# Set intercept prior.
intercept ~ Normal(0, 3)
Expand Down
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 5e03a1e

Please sign in to comment.