Skip to content

Commit 15e84f5

Browse files
authored
Only specify lower bound of partially truncated distributions (#63)
1 parent c574fe0 commit 15e84f5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
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.0.1"
4+
version = "2.1.0"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
@@ -19,7 +19,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1919
Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
2020

2121
[compat]
22-
Distributions = "0.25"
22+
Distributions = "0.25.42"
2323
GLM = "1.5"
2424
LazyArrays = "0.22"
2525
MixedModels = "4.5"

src/turing_model.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{Normal})
180180
σ ~ Exponential(residual)
181181
μ = α .+ X * β
182182
if !isempty(intercept_ranef)
183-
τ ~ mad(y) * truncated(TDist(3), 0, Inf)
183+
τ ~ mad(y) * truncated(TDist(3); lower=0)
184184
zⱼ ~ filldist(Normal(), n_gr)
185185
αⱼ = zⱼ .* τ
186186
μ .+= αⱼ[idxs]
@@ -222,7 +222,7 @@ function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{TDist})
222222
ν ~ prior.auxiliary
223223
μ = α .+ X * β
224224
if !isempty(intercept_ranef)
225-
τ ~ 0 + mad(y) * truncated(TDist(3), 0, Inf)
225+
τ ~ 0 + mad(y) * truncated(TDist(3); lower=0)
226226
zⱼ ~ filldist(Normal(), n_gr)
227227
αⱼ = zⱼ .* τ
228228
μ .+= αⱼ[idxs]
@@ -262,7 +262,7 @@ function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{Bernoulli})
262262
β ~ filldist(prior.predictors, predictors)
263263
μ = α .+ X * β
264264
if !isempty(intercept_ranef)
265-
τ ~ mad(y) * truncated(TDist(3), 0, Inf)
265+
τ ~ mad(y) * truncated(TDist(3); lower=0)
266266
zⱼ ~ filldist(Normal(), n_gr)
267267
αⱼ = zⱼ .* τ
268268
μ .+= αⱼ[idxs]
@@ -300,7 +300,7 @@ function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{Poisson})
300300
β ~ filldist(prior.predictors, predictors)
301301
μ = α .+ X * β
302302
if !isempty(intercept_ranef)
303-
τ ~ mad(y) * truncated(TDist(3), 0, Inf)
303+
τ ~ mad(y) * truncated(TDist(3); lower=0)
304304
zⱼ ~ filldist(Normal(), n_gr)
305305
αⱼ = zⱼ .* τ
306306
μ .+= αⱼ[idxs]
@@ -340,7 +340,7 @@ function _model(μ_X, σ_X, prior, intercept_ranef, idx, ::Type{NegativeBinomial
340340
ϕ = 1 / ϕ⁻
341341
μ = α .+ X * β
342342
if !isempty(intercept_ranef)
343-
τ ~ mad(y) * truncated(TDist(3), 0, Inf)
343+
τ ~ mad(y) * truncated(TDist(3); lower=0)
344344
zⱼ ~ filldist(Normal(), n_gr)
345345
αⱼ = zⱼ .* τ
346346
μ .+= αⱼ[idxs]

0 commit comments

Comments
 (0)