Skip to content

Commit

Permalink
fix: τ priors for hierarchical Bernoulli models (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli authored Apr 8, 2023
1 parent af9e0ff commit c52dea3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TuringGLM"
uuid = "0004c1f4-53c5-4d43-a221-a1dac6cf6b74"
authors = ["Jose Storopoli <[email protected]>, Rik Huijzer <[email protected]>, and contributors"]
version = "2.5"
version = "2.6"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
4 changes: 2 additions & 2 deletions src/turing_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@ function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{Bernoulli})
μ_X=μ_X,
σ_X=σ_X,
prior=prior,
mad_y=mad(y; normalize=true),
std_y=std(y; normalize=true),
)
α ~ prior.intercept
β ~ filldist(prior.predictors, predictors)
if isempty(intercept_ranef)
μ = α .+ X * β
else
τ ~ mad_y * truncated(TDist(3); lower=0)
τ ~ std_y * truncated(TDist(3); lower=0)
zⱼ ~ filldist(Normal(), n_gr)
μ = α .+ τ .* getindex.((zⱼ,), idxs) .+ X * β
end
Expand Down

2 comments on commit c52dea3

@storopoli
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/81246

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.6.0 -m "<description of version>" c52dea3b93dc1ff496958454c99eef7deddb08df
git push origin v2.6.0

Please sign in to comment.