Skip to content

Commit c52dea3

Browse files
authored
fix: τ priors for hierarchical Bernoulli models (#86)
1 parent af9e0ff commit c52dea3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TuringGLM"
22
uuid = "0004c1f4-53c5-4d43-a221-a1dac6cf6b74"
33
authors = ["Jose Storopoli <[email protected]>, Rik Huijzer <[email protected]>, and contributors"]
4-
version = "2.5"
4+
version = "2.6"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"

src/turing_model.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{Bernoulli})
263263
μ_X=μ_X,
264264
σ_X=σ_X,
265265
prior=prior,
266-
mad_y=mad(y; normalize=true),
266+
std_y=std(y; normalize=true),
267267
)
268268
α ~ prior.intercept
269269
β ~ filldist(prior.predictors, predictors)
270270
if isempty(intercept_ranef)
271271
μ = α .+ X * β
272272
else
273-
τ ~ mad_y * truncated(TDist(3); lower=0)
273+
τ ~ std_y * truncated(TDist(3); lower=0)
274274
zⱼ ~ filldist(Normal(), n_gr)
275275
μ = α .+ τ .* getindex.((zⱼ,), idxs) .+ X * β
276276
end

0 commit comments

Comments
 (0)